Skip to content

Commit

Permalink
Merge pull request #129 from TetsuOtter/127-disable-font-autoscale
Browse files Browse the repository at this point in the history
  • Loading branch information
TetsuOtter authored May 19, 2024
2 parents 9396fad + 51e7ce7 commit 3f8fae1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TRViS/DTAC/DTACElementStyles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static Style LabelStyleResource
_labelStyleResource.Setters.Add(Label.MarginProperty, new Thickness(4, 0));
_labelStyleResource.Setters.Add(Label.LineBreakModeProperty, LineBreakMode.CharacterWrap);
_labelStyleResource.Setters.Add(Label.LineHeightProperty, DeviceInfo.Platform == DevicePlatform.Android ? 0.75 : 1.1);
_labelStyleResource.Setters.Add(Label.FontAutoScalingEnabledProperty, false);

return _labelStyleResource;
}
Expand All @@ -128,6 +129,8 @@ public static Style LabelStyleResource

v.LineHeight = DeviceInfo.Platform == DevicePlatform.Android ? 0.75 : 1.1;

v.FontAutoScalingEnabled = false;

return v;
}

Expand Down Expand Up @@ -177,6 +180,7 @@ public static Style HeaderLabelStyleResource
{
T v = AffectDateLabelStyle<T>();

v.Margin = new(0, 0, v.Margin.Left, 0);
v.FontAttributes = FontAttributes.Bold;
v.FontSize = DefaultTextSize;
v.Text = null;
Expand Down
2 changes: 2 additions & 0 deletions TRViS/DTAC/HakoParts/SimpleRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,12 @@ static FormattedString GetTimeLabelText(TimeData value)
Text = $"{value.Hour:00}:{value.Minute:00}",
FontAttributes = FontAttributes.Bold,
FontSize = baseTextSize,
FontAutoScalingEnabled = false,
});
fs.Spans.Add(new(){
Text = value.Second?.ToString("00"),
FontSize = TimeLabelFontSize_SS,
FontAutoScalingEnabled = false,
});

return fs;
Expand Down
1 change: 1 addition & 0 deletions TRViS/DTAC/OpenCloseButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public OpenCloseButton()
BorderWidth = 0;
FontFamily = "MaterialIconsRegular";
FontSize = 40;
FontAutoScalingEnabled = false;
DTACElementStyles.OpenCloseButtonBGColor.Apply(this, BackgroundColorProperty);
DTACElementStyles.OpenCloseButtonTextColor.Apply(this, TextColorProperty);

Expand Down
2 changes: 2 additions & 0 deletions TRViS/DTAC/Remarks.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
Grid.Row="0"
FontSize="28"
FontFamily="Hiragino Sans W6"
FontAutoScalingEnabled="False"
Margin="16,0"
Text="注 意 事 項"
HorizontalOptions="Start"
Expand All @@ -52,6 +53,7 @@
<ctrls:HtmlAutoDetectLabel
x:Name="RemarksLabel"
Style="{x:Static dtac:DTACElementStyles.LabelStyleResource}"
FontAutoScalingEnabled="True"
HorizontalOptions="Start"
VerticalOptions="Start"/>
</ScrollView>
Expand Down
3 changes: 3 additions & 0 deletions TRViS/DTAC/SelectMarkerPopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:local="clr-namespace:TRViS.DTAC"
xmlns:vm="clr-namespace:TRViS.ViewModels"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
x:Class="TRViS.DTAC.SelectMarkerPopup"
Expand All @@ -29,6 +30,7 @@
<Frame
Margin="4"
Padding="16"
BackgroundColor="{x:Static local:DTACElementStyles.TabAreaBGColor}"
WidthRequest="80">
<ListView
SelectionMode="Single"
Expand Down Expand Up @@ -64,6 +66,7 @@
<Frame
Margin="4"
Padding="16"
BackgroundColor="{x:Static local:DTACElementStyles.TabAreaBGColor}"
WidthRequest="128">
<ListView
SelectionMode="Single"
Expand Down
2 changes: 2 additions & 0 deletions TRViS/DTAC/SelectMarkerPopup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public SelectMarkerPopup(DTACMarkerViewModel viewModel)

InitializeComponent();

DTACElementStyles.DefaultBGColor.Apply(this, ColorProperty);

logger.Trace("Created");
}

Expand Down
2 changes: 2 additions & 0 deletions TRViS/DTAC/StartEndRunButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
TextColor="{x:Static local:DTACElementStyles.StartEndRunButtonTextColor}"
FontFamily="MaterialIconsRegular"
FontSize="32"
FontAutoScalingEnabled="False"
VerticalOptions="Center"
Margin="2"
Padding="0">
Expand All @@ -42,6 +43,7 @@
TextColor="{x:Static local:DTACElementStyles.StartEndRunButtonTextColor}"
FontFamily="Hiragino Sans"
FontSize="24"
FontAutoScalingEnabled="False"
FontAttributes="Bold"
VerticalOptions="Center"
Margin="4"
Expand Down
1 change: 1 addition & 0 deletions TRViS/DTAC/TabButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
x:Name="ButtonLabel"
FontFamily="Hiragino Sans"
FontSize="18"
FontAutoScalingEnabled="False"
FontAttributes="Bold"
VerticalOptions="Center"
HorizontalOptions="Center"/>
Expand Down
1 change: 1 addition & 0 deletions TRViS/DTAC/VerticalTimetableRow.Init.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ public VerticalTimetableRow(Grid parent, int rowIndex, TimetableRow rowData, DTA
IsEnabled = true,
FontFamily = "Hiragino Sans",
FontSize = 18,
FontAutoScalingEnabled = false,
FontAttributes = FontAttributes.Bold,
BorderColor = Colors.Transparent,
CornerRadius = 4,
Expand Down

0 comments on commit 3f8fae1

Please sign in to comment.