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.Text.Json.Serialization;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
|
|
@ -113,6 +114,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
{
|
||||
_settingWindowFont = value;
|
||||
OnPropertyChanged();
|
||||
Application.Current.Resources["SettingWindowFont"] = new FontFamily(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
Width="530"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
Icon="Images\app.png"
|
||||
MouseDown="window_MouseDown"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
Width="530"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
Icon="Images\app.png"
|
||||
ResizeMode="NoResize"
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@
|
|||
<system:String x:Key="logLevel">Log Level</system:String>
|
||||
<system:String x:Key="LogLevelDEBUG">Debug</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 -->
|
||||
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,20 @@
|
|||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
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">
|
||||
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
|
||||
<MenuItem.Icon>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
<converters:TextConverter x:Key="TextConverter" />
|
||||
<core:TranslationConverter x:Key="TranslationConverter" />
|
||||
<FontFamily x:Key="SettingWindowFont">Segoe UI</FontFamily>
|
||||
|
||||
<!-- 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>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
Width="550"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="Height"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
Width="600"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="Height"
|
||||
|
|
|
|||
|
|
@ -103,10 +103,8 @@
|
|||
Margin="0 0 12 0"
|
||||
Command="{Binding AskClearLogFolderConfirmationCommand}"
|
||||
Content="{Binding LogFolderSize, Mode=OneWay}" />
|
||||
<Button
|
||||
Content=""
|
||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
||||
FontSize="20">
|
||||
<Button>
|
||||
<ui:FontIcon FontSize="20" Glyph="" />
|
||||
<ui:FlyoutService.Flyout>
|
||||
<ui:MenuFlyout>
|
||||
<MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}">
|
||||
|
|
@ -148,7 +146,7 @@
|
|||
SelectedValuePath="Value" />
|
||||
</cc:Card>
|
||||
<cc:Card
|
||||
Title="{DynamicResource settingWindowFont}"
|
||||
Title="{DynamicResource settingWindowFontTitle}"
|
||||
Icon=""
|
||||
Type="Inside">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@
|
|||
Margin="0 0 20 0"
|
||||
Command="{Binding OpenHelperCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
|
||||
Content=""
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="14" />
|
||||
FontSize="14">
|
||||
<ui:FontIcon FontSize="14" Glyph="" />
|
||||
</Button>
|
||||
<TextBox
|
||||
Name="PluginFilterTextbox"
|
||||
Width="150"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
MinHeight="600"
|
||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"
|
||||
Closed="OnClosed"
|
||||
FontFamily="{Binding Settings.SettingWindowFont, Mode=TwoWay}"
|
||||
Icon="Images\app.ico"
|
||||
Left="{Binding SettingWindowLeft, Mode=TwoWay}"
|
||||
Loaded="OnLoaded"
|
||||
|
|
|
|||
|
|
@ -140,21 +140,19 @@
|
|||
Height="40"
|
||||
Margin="8 5 0 5"
|
||||
Click="ForwardButton_Click"
|
||||
Content=""
|
||||
DockPanel.Dock="Right"
|
||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
||||
FontSize="18"
|
||||
IsEnabled="{Binding NextEnabled, Mode=OneWay}" />
|
||||
IsEnabled="{Binding NextEnabled, Mode=OneWay}">
|
||||
<ui:FontIcon FontSize="18" Glyph="" />
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="BackButton"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Click="BackwardButton_Click"
|
||||
Content=""
|
||||
DockPanel.Dock="Right"
|
||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
||||
FontSize="18"
|
||||
IsEnabled="{Binding BackEnabled, Mode=OneWay}" />
|
||||
IsEnabled="{Binding BackEnabled, Mode=OneWay}">
|
||||
<ui:FontIcon FontSize="18" Glyph="" />
|
||||
</Button>
|
||||
<StackPanel />
|
||||
</DockPanel>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue