mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Implement dynamic font settings for the setting window
This commit is contained in:
parent
3da3c599d9
commit
f50f2ff27c
12 changed files with 30 additions and 22 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Media;
|
||||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
using Flow.Launcher.Infrastructure.Hotkey;
|
using Flow.Launcher.Infrastructure.Hotkey;
|
||||||
using Flow.Launcher.Infrastructure.Logger;
|
using Flow.Launcher.Infrastructure.Logger;
|
||||||
|
|
@ -113,6 +114,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
||||||
{
|
{
|
||||||
_settingWindowFont = value;
|
_settingWindowFont = value;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
|
Application.Current.Resources["SettingWindowFont"] = new FontFamily(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
Width="530"
|
Width="530"
|
||||||
Background="{DynamicResource PopuBGColor}"
|
Background="{DynamicResource PopuBGColor}"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
|
||||||
Foreground="{DynamicResource PopupTextColor}"
|
Foreground="{DynamicResource PopupTextColor}"
|
||||||
Icon="Images\app.png"
|
Icon="Images\app.png"
|
||||||
MouseDown="window_MouseDown"
|
MouseDown="window_MouseDown"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
Width="530"
|
Width="530"
|
||||||
Background="{DynamicResource PopuBGColor}"
|
Background="{DynamicResource PopuBGColor}"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
|
||||||
Foreground="{DynamicResource PopupTextColor}"
|
Foreground="{DynamicResource PopupTextColor}"
|
||||||
Icon="Images\app.png"
|
Icon="Images\app.png"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@
|
||||||
<system:String x:Key="logLevel">Log Level</system:String>
|
<system:String x:Key="logLevel">Log Level</system:String>
|
||||||
<system:String x:Key="LogLevelDEBUG">Debug</system:String>
|
<system:String x:Key="LogLevelDEBUG">Debug</system:String>
|
||||||
<system:String x:Key="LogLevelINFO">Info</system:String>
|
<system:String x:Key="LogLevelINFO">Info</system:String>
|
||||||
<system:String x:Key="settingWindowFont">Setting Window Font</system:String>
|
<system:String x:Key="settingWindowFontTitle">Setting Window Font</system:String>
|
||||||
|
|
||||||
<!-- FileManager Setting Dialog -->
|
<!-- FileManager Setting Dialog -->
|
||||||
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
|
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,20 @@
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||||
xmlns:ui="http://schemas.modernwpf.com/2019">
|
xmlns:ui="http://schemas.modernwpf.com/2019">
|
||||||
|
|
||||||
|
<!-- Setting Window Font -->
|
||||||
|
<Style TargetType="ui:FontIcon">
|
||||||
|
<Setter Property="FontFamily" Value="/Resources/#Segoe Fluent Icons" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Control">
|
||||||
|
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Window">
|
||||||
|
<Setter Property="FontFamily" Value="{DynamicResource SettingWindowFont}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
<ContextMenu x:Key="TextBoxContextMenu">
|
<ContextMenu x:Key="TextBoxContextMenu">
|
||||||
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
|
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||||
<converters:TextConverter x:Key="TextConverter" />
|
<converters:TextConverter x:Key="TextConverter" />
|
||||||
<core:TranslationConverter x:Key="TranslationConverter" />
|
<core:TranslationConverter x:Key="TranslationConverter" />
|
||||||
|
<FontFamily x:Key="SettingWindowFont">Segoe UI</FontFamily>
|
||||||
|
|
||||||
<!-- Icon for Theme Type Label -->
|
<!-- Icon for Theme Type Label -->
|
||||||
<Geometry x:Key="circle_half_stroke_solid">F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z</Geometry>
|
<Geometry x:Key="circle_half_stroke_solid">F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z</Geometry>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
Width="550"
|
Width="550"
|
||||||
Background="{DynamicResource PopuBGColor}"
|
Background="{DynamicResource PopuBGColor}"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
|
||||||
Foreground="{DynamicResource PopupTextColor}"
|
Foreground="{DynamicResource PopupTextColor}"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
SizeToContent="Height"
|
SizeToContent="Height"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
Width="600"
|
Width="600"
|
||||||
Background="{DynamicResource PopuBGColor}"
|
Background="{DynamicResource PopuBGColor}"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
|
||||||
Foreground="{DynamicResource PopupTextColor}"
|
Foreground="{DynamicResource PopupTextColor}"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
SizeToContent="Height"
|
SizeToContent="Height"
|
||||||
|
|
|
||||||
|
|
@ -103,10 +103,8 @@
|
||||||
Margin="0 0 12 0"
|
Margin="0 0 12 0"
|
||||||
Command="{Binding AskClearLogFolderConfirmationCommand}"
|
Command="{Binding AskClearLogFolderConfirmationCommand}"
|
||||||
Content="{Binding LogFolderSize, Mode=OneWay}" />
|
Content="{Binding LogFolderSize, Mode=OneWay}" />
|
||||||
<Button
|
<Button>
|
||||||
Content=""
|
<ui:FontIcon FontSize="20" Glyph="" />
|
||||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
|
||||||
FontSize="20">
|
|
||||||
<ui:FlyoutService.Flyout>
|
<ui:FlyoutService.Flyout>
|
||||||
<ui:MenuFlyout>
|
<ui:MenuFlyout>
|
||||||
<MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}">
|
<MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}">
|
||||||
|
|
@ -148,7 +146,7 @@
|
||||||
SelectedValuePath="Value" />
|
SelectedValuePath="Value" />
|
||||||
</cc:Card>
|
</cc:Card>
|
||||||
<cc:Card
|
<cc:Card
|
||||||
Title="{DynamicResource settingWindowFont}"
|
Title="{DynamicResource settingWindowFontTitle}"
|
||||||
Icon=""
|
Icon=""
|
||||||
Type="Inside">
|
Type="Inside">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,9 @@
|
||||||
Margin="0 0 20 0"
|
Margin="0 0 20 0"
|
||||||
Command="{Binding OpenHelperCommand}"
|
Command="{Binding OpenHelperCommand}"
|
||||||
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
Content=""
|
FontSize="14">
|
||||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
<ui:FontIcon FontSize="14" Glyph="" />
|
||||||
FontSize="14" />
|
</Button>
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="PluginFilterTextbox"
|
Name="PluginFilterTextbox"
|
||||||
Width="150"
|
Width="150"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
MinHeight="600"
|
MinHeight="600"
|
||||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"
|
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"
|
||||||
Closed="OnClosed"
|
Closed="OnClosed"
|
||||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
|
||||||
Icon="Images\app.ico"
|
Icon="Images\app.ico"
|
||||||
Left="{Binding SettingWindowLeft, Mode=TwoWay}"
|
Left="{Binding SettingWindowLeft, Mode=TwoWay}"
|
||||||
Loaded="OnLoaded"
|
Loaded="OnLoaded"
|
||||||
|
|
|
||||||
|
|
@ -140,21 +140,19 @@
|
||||||
Height="40"
|
Height="40"
|
||||||
Margin="8 5 0 5"
|
Margin="8 5 0 5"
|
||||||
Click="ForwardButton_Click"
|
Click="ForwardButton_Click"
|
||||||
Content=""
|
|
||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
IsEnabled="{Binding NextEnabled, Mode=OneWay}">
|
||||||
FontSize="18"
|
<ui:FontIcon FontSize="18" Glyph="" />
|
||||||
IsEnabled="{Binding NextEnabled, Mode=OneWay}" />
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
x:Name="BackButton"
|
x:Name="BackButton"
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Click="BackwardButton_Click"
|
Click="BackwardButton_Click"
|
||||||
Content=""
|
|
||||||
DockPanel.Dock="Right"
|
DockPanel.Dock="Right"
|
||||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
IsEnabled="{Binding BackEnabled, Mode=OneWay}">
|
||||||
FontSize="18"
|
<ui:FontIcon FontSize="18" Glyph="" />
|
||||||
IsEnabled="{Binding BackEnabled, Mode=OneWay}" />
|
</Button>
|
||||||
<StackPanel />
|
<StackPanel />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue