Skip to content

Commit

Permalink
Improved fontsize
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 22, 2024
1 parent 5a78361 commit 3bf2dc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
16 changes: 7 additions & 9 deletions v2rayN/v2rayN/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Application
x:Class="v2rayN.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
ShutdownMode="OnExplicitShutdown"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
Expand All @@ -18,8 +18,6 @@
<system:Double x:Key="MenuItemHeight">26</system:Double>
<system:Double x:Key="StdFontSize">12</system:Double>
<system:Double x:Key="StdFontSize1">13</system:Double>
<system:Double x:Key="StdFontSize2">14</system:Double>
<system:Double x:Key="StdFontSizeMsg">11</system:Double>
<system:Double x:Key="StdFontSize-1">11</system:Double>

<conv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
Expand Down Expand Up @@ -69,7 +67,7 @@
x:Key="ModuleTitle"
BasedOn="{StaticResource MaterialDesignTextBlock}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize2}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
</Style>
<Style
x:Key="ToolbarTextBlock"
Expand Down Expand Up @@ -121,21 +119,21 @@
x:Key="DefButton"
BasedOn="{StaticResource MaterialDesignRaisedButton}"
TargetType="{x:Type ButtonBase}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
</Style>
<Style
x:Key="DefContextMenu"
BasedOn="{StaticResource MaterialDesignContextMenu}"
TargetType="{x:Type ContextMenu}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
<Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
</Style>

<Style
x:Key="ToolbarMenu"
BasedOn="{StaticResource MaterialDesignMenu}"
TargetType="{x:Type Menu}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
<Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
</Style>

Expand Down Expand Up @@ -185,13 +183,13 @@
<Setter Property="Padding" Value="{StaticResource OutlinedTextBoxDefaultPadding}" />
</Style>
<Style x:Key="ListItemChip" TargetType="{x:Type materialDesign:Chip}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
</Style>
<Style
x:Key="ListItemTitle"
BasedOn="{StaticResource MaterialDesignTextBlock}"
TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
</Style>
<Style
x:Key="ListItemSubTitle"
Expand Down
2 changes: 0 additions & 2 deletions v2rayN/v2rayN/ViewModels/ThemeSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ private void BindingUI()
double size = (long)CurrentFontSize;
Application.Current.Resources["StdFontSize"] = size;
Application.Current.Resources["StdFontSize1"] = size + 1;
Application.Current.Resources["StdFontSize2"] = size + 2;
Application.Current.Resources["StdFontSizeMsg"] = size - 1;
Application.Current.Resources["StdFontSize-1"] = size - 1;
ConfigHandler.SaveConfig(_config);
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/MsgView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<TextBox
Name="txtMsg"
BorderThickness="0"
FontSize="{DynamicResource StdFontSizeMsg}"
FontSize="{DynamicResource StdFontSize-1}"
HorizontalScrollBarVisibility="Auto"
IsReadOnly="True"
IsReadOnlyCaretVisible="True"
Expand Down

0 comments on commit 3bf2dc7

Please sign in to comment.