style: move some settings to Appearance tab

This commit is contained in:
leo 2024-03-22 12:29:40 +08:00
parent a992485d11
commit 8042091836
5 changed files with 157 additions and 132 deletions

View file

@ -2238,6 +2238,51 @@ namespace SourceGit.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Appearance.
/// </summary>
public static string Text_Preference_Appearance {
get {
return ResourceManager.GetString("Text.Preference.Appearance", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Default FontFamily.
/// </summary>
public static string Text_Preference_Appearance_DefaultFont {
get {
return ResourceManager.GetString("Text.Preference.Appearance.DefaultFont", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Default Font Size.
/// </summary>
public static string Text_Preference_Appearance_DefaultFontSize {
get {
return ResourceManager.GetString("Text.Preference.Appearance.DefaultFontSize", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Monospace FontFamily.
/// </summary>
public static string Text_Preference_Appearance_MonospaceFont {
get {
return ResourceManager.GetString("Text.Preference.Appearance.MonospaceFont", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Theme.
/// </summary>
public static string Text_Preference_Appearance_Theme {
get {
return ResourceManager.GetString("Text.Preference.Appearance.Theme", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GENERAL.
/// </summary>
@ -2256,24 +2301,6 @@ namespace SourceGit.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Default FontFamily.
/// </summary>
public static string Text_Preference_General_DefaultFont {
get {
return ResourceManager.GetString("Text.Preference.General.DefaultFont", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Default Font Size.
/// </summary>
public static string Text_Preference_General_DefaultFontSize {
get {
return ResourceManager.GetString("Text.Preference.General.DefaultFontSize", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Language.
/// </summary>
@ -2292,15 +2319,6 @@ namespace SourceGit.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Monospace FontFamily.
/// </summary>
public static string Text_Preference_General_MonospaceFont {
get {
return ResourceManager.GetString("Text.Preference.General.MonospaceFont", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Restore windows.
/// </summary>
@ -2310,15 +2328,6 @@ namespace SourceGit.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Theme.
/// </summary>
public static string Text_Preference_General_Theme {
get {
return ResourceManager.GetString("Text.Preference.General.Theme", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use fixed tab width in titlebar.
/// </summary>

View file

@ -984,7 +984,7 @@
<data xml:space="preserve" name="Text.Preference.General.AvatarServer">
<value>Avatar Server</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.Theme">
<data xml:space="preserve" name="Text.Preference.Appearance.Theme">
<value>Theme</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.MaxHistoryCommits">
@ -1290,13 +1290,16 @@
<data name="Text.Diff.SyntaxHighlight" xml:space="preserve">
<value>Syntax Highlighting</value>
</data>
<data name="Text.Preference.General.DefaultFont" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFont" xml:space="preserve">
<value>Default FontFamily</value>
</data>
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<data name="Text.Preference.Appearance.MonospaceFont" xml:space="preserve">
<value>Monospace FontFamily</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFontSize" xml:space="preserve">
<value>Default Font Size</value>
</data>
<data name="Text.Preference.Appearance" xml:space="preserve">
<value>APPEARANCE</value>
</data>
</root>

View file

@ -984,7 +984,7 @@
<data xml:space="preserve" name="Text.Preference.General.AvatarServer">
<value>Avatar Server</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.Theme">
<data xml:space="preserve" name="Text.Preference.Appearance.Theme">
<value>Theme</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.MaxHistoryCommits">
@ -1290,13 +1290,16 @@
<data name="Text.Diff.SyntaxHighlight" xml:space="preserve">
<value>Syntax Highlighting</value>
</data>
<data name="Text.Preference.General.DefaultFont" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFont" xml:space="preserve">
<value>Default FontFamily</value>
</data>
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<data name="Text.Preference.Appearance.MonospaceFont" xml:space="preserve">
<value>Monospace FontFamily</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFontSize" xml:space="preserve">
<value>Default Font Size</value>
</data>
<data name="Text.Preference.Appearance" xml:space="preserve">
<value>Appearance</value>
</data>
</root>

View file

@ -984,7 +984,7 @@
<data xml:space="preserve" name="Text.Preference.General.AvatarServer">
<value>头像服务</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.Theme">
<data xml:space="preserve" name="Text.Preference.Appearance.Theme">
<value>主题</value>
</data>
<data xml:space="preserve" name="Text.Preference.General.MaxHistoryCommits">
@ -1290,13 +1290,16 @@
<data name="Text.Diff.SyntaxHighlight" xml:space="preserve">
<value>语法高亮</value>
</data>
<data name="Text.Preference.General.DefaultFont" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFont" xml:space="preserve">
<value>缺省字体</value>
</data>
<data name="Text.Preference.General.MonospaceFont" xml:space="preserve">
<data name="Text.Preference.Appearance.MonospaceFont" xml:space="preserve">
<value>等宽字体</value>
</data>
<data name="Text.Preference.General.DefaultFontSize" xml:space="preserve">
<data name="Text.Preference.Appearance.DefaultFontSize" xml:space="preserve">
<value>默认字体大小</value>
</data>
<data name="Text.Preference.Appearance" xml:space="preserve">
<value>外观配置</value>
</data>
</root>

View file

@ -67,7 +67,7 @@
<TabItem.Header>
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.General}"/>
</TabItem.Header>
<Grid Margin="8" RowDefinitions="32,32,32,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
<Grid Margin="8" RowDefinitions="32,32,32,32,32" ColumnDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.Locale}"
HorizontalAlignment="Right"
@ -96,90 +96,10 @@
</ComboBox>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.Theme}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="2" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
DisplayMemberBinding="{Binding Key, x:DataType=ThemeVariant}"
SelectedItem="{Binding Theme, Mode=TwoWay, Converter={x:Static c:StringConverters.ToTheme}}">
<ComboBox.Items>
<ThemeVariant>Default</ThemeVariant>
<ThemeVariant>Dark</ThemeVariant>
<ThemeVariant>Light</ThemeVariant>
</ComboBox.Items>
</ComboBox>
<TextBlock Grid.Row="3" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.DefaultFont}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="3" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
ItemsSource="{Binding #me.InstalledFonts}"
SelectedItem="{Binding DefaultFont, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="FontFamily">
<Border Height="24">
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontFamily="{Binding}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="4" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.MonospaceFont}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="4" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
ItemsSource="{Binding #me.InstalledMonospaceFonts}"
SelectedItem="{Binding MonospaceFont, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="FontFamily">
<Border Height="24">
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontFamily="{Binding}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="5" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.DefaultFontSize}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<NumericUpDown Grid.Row="5" Grid.Column="1"
Minimum="10" Maximum="16" Increment="0.5"
Height="28"
Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
CornerRadius="3"
Value="{Binding DefaultFontSize, Mode=TwoWay}">
<NumericUpDown.Styles>
<Style Selector="NumericUpDown /template/ ButtonSpinner#PART_Spinner">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Height" Value="28"/>
</Style>
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Height" Value="28"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="CornerRadius" Value="3,0,0,3"/>
</Style>
</NumericUpDown.Styles>
</NumericUpDown>
<TextBlock Grid.Row="6" Grid.Column="0"
Text="{DynamicResource Text.Preference.General.MaxHistoryCommits}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<Grid Grid.Row="6" Grid.Column="1" ColumnDefinitions="*,64">
<Grid Grid.Row="2" Grid.Column="1" ColumnDefinitions="*,64">
<Slider Grid.Column="0"
Minimum="20000" Maximum="100000"
TickPlacement="BottomRight" TickFrequency="5000"
@ -203,17 +123,104 @@
Text="{Binding MaxHistoryCommits}"/>
</Grid>
<CheckBox Grid.Row="7" Grid.Column="1"
<CheckBox Grid.Row="3" Grid.Column="1"
Content="{DynamicResource Text.Preference.General.RestoreTabs}"
IsChecked="{Binding RestoreTabs, Mode=TwoWay}"/>
<CheckBox Grid.Row="8" Grid.Column="1"
<CheckBox Grid.Row="4" Grid.Column="1"
Height="32"
Content="{DynamicResource Text.Preference.General.UseFixedTabWidth}"
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseFixedTabWidth, Mode=TwoWay}"/>
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.Appearance}"/>
</TabItem.Header>
<Grid Margin="8" RowDefinitions="32,32,32,32" ColumnDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0"
Text="{DynamicResource Text.Preference.Appearance.Theme}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="0" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
DisplayMemberBinding="{Binding Key, x:DataType=ThemeVariant}"
SelectedItem="{Binding Theme, Mode=TwoWay, Converter={x:Static c:StringConverters.ToTheme}}">
<ComboBox.Items>
<ThemeVariant>Default</ThemeVariant>
<ThemeVariant>Dark</ThemeVariant>
<ThemeVariant>Light</ThemeVariant>
</ComboBox.Items>
</ComboBox>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="{DynamicResource Text.Preference.Appearance.DefaultFont}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="1" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
ItemsSource="{Binding #me.InstalledFonts}"
SelectedItem="{Binding DefaultFont, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="FontFamily">
<Border Height="24">
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontFamily="{Binding}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.Appearance.MonospaceFont}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<ComboBox Grid.Row="2" Grid.Column="1"
MinHeight="28"
Padding="8,0"
HorizontalAlignment="Stretch"
ItemsSource="{Binding #me.InstalledMonospaceFonts}"
SelectedItem="{Binding MonospaceFont, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="FontFamily">
<Border Height="24">
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" FontFamily="{Binding}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="3" Grid.Column="0"
Text="{DynamicResource Text.Preference.Appearance.DefaultFontSize}"
HorizontalAlignment="Right"
Margin="0,0,16,0"/>
<NumericUpDown Grid.Row="3" Grid.Column="1"
Minimum="10" Maximum="16" Increment="0.5"
Height="28"
Padding="4"
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
CornerRadius="3"
Value="{Binding DefaultFontSize, Mode=TwoWay}">
<NumericUpDown.Styles>
<Style Selector="NumericUpDown /template/ ButtonSpinner#PART_Spinner">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Height" Value="28"/>
</Style>
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox">
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Height" Value="28"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="CornerRadius" Value="3,0,0,3"/>
</Style>
</NumericUpDown.Styles>
</NumericUpDown>
</Grid>
</TabItem>
<TabItem>
<TabItem.Header>
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.Git}"/>