diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index bcdd94e1c..bc96a86ff 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -64,6 +64,34 @@ public partial class SettingsPaneThemeViewModel : BaseModel } } + public double WindowHeightSize + { + get => Settings.WindowHeightSize; + set => Settings.WindowHeightSize = value; + } + + public double ItemHeightSize + { + get => Settings.ItemHeightSize; + set => Settings.ItemHeightSize = value; + } + + public double queryBoxFontSize + { + get => Settings.QueryBoxFontSize; + set => Settings.QueryBoxFontSize = value; + } + public double resultItemFontSize + { + get => Settings.ResultItemFontSize; + set => Settings.ResultItemFontSize = value; + } + + public double resultSubItemFontSize + { + get => Settings.ResultSubItemFontSize; + set => Settings.ResultSubItemFontSize = value; + } public List Themes => ThemeManager.Instance.LoadAvailableThemes().Select(Path.GetFileNameWithoutExtension).ToList(); @@ -375,6 +403,50 @@ public partial class SettingsPaneThemeViewModel : BaseModel } } + public FontFamily SelectedResultSubFont + { + get + { + if (Fonts.SystemFontFamilies.Count(o => + o.FamilyNames.Values != null && + o.FamilyNames.Values.Contains(Settings.ResultSubFont)) > 0) + { + var font = new FontFamily(Settings.ResultSubFont); + return font; + } + else + { + var font = new FontFamily("Segoe UI"); + return font; + } + } + set + { + Settings.ResultSubFont = value.ToString(); + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public FamilyTypeface SelectedResultSubFontFaces + { + get + { + var typeface = SyntaxSugars.CallOrRescueDefault( + () => SelectedResultSubFont.ConvertFromInvariantStringsOrNormal( + Settings.ResultSubFontStyle, + Settings.ResultSubFontWeight, + Settings.ResultSubFontStretch + )); + return typeface; + } + set + { + Settings.ResultSubFontStretch = value.Stretch.ToString(); + Settings.ResultSubFontWeight = value.Weight.ToString(); + Settings.ResultSubFontStyle = value.Style.ToString(); + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } public string ThemeImage => Constant.QueryTextBoxIconImagePath; [RelayCommand] diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 0dca6b11a..4b22458f7 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -24,7 +24,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + CornerRadius="6"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -180,7 +393,7 @@ Margin="0" Padding="0" HorizontalAlignment="Stretch" - BorderThickness="1,0,1,1" + BorderThickness="1 0 1 1" CornerRadius="0 0 5 5" Style="{DynamicResource SettingGroupBox}"> - + @@ -326,7 +539,7 @@ SelectedItem="{Binding SelectedResultFont}" /> @@ -346,7 +559,7 @@ - + - + + @@ -478,15 +691,15 @@