Skip to content

Commit 942b290

Browse files
committed
Add FontFamily Style
1 parent 647f2bb commit 942b290

7 files changed

+101
-29
lines changed

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
7+
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
78
Title="{DynamicResource customeQueryHotkeyTitle}"
89
Width="530"
910
Background="{DynamicResource PopuBGColor}"

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Flow.Launcher.Helper;
22
using Flow.Launcher.Infrastructure.UserSettings;
33
using System.Collections.ObjectModel;
4+
using System.ComponentModel;
45
using System.Linq;
56
using System.Windows;
67
using System.Windows.Input;
@@ -13,7 +14,25 @@ public partial class CustomQueryHotkeySetting : Window
1314
private readonly Settings _settings;
1415
private bool update;
1516
private CustomPluginHotkey updateCustomHotkey;
16-
17+
public event PropertyChangedEventHandler PropertyChanged;
18+
19+
public string SettingWindowFont
20+
{
21+
get => _settings.SettingWindowFont;
22+
set
23+
{
24+
if (_settings.SettingWindowFont != value)
25+
{
26+
_settings.SettingWindowFont = value;
27+
OnPropertyChanged(nameof(SettingWindowFont));
28+
}
29+
}
30+
}
31+
32+
protected virtual void OnPropertyChanged(string propertyName)
33+
{
34+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
35+
}
1736
public CustomQueryHotkeySetting(Settings settings)
1837
{
1938
_settings = settings;

Flow.Launcher/CustomShortcutSetting.xaml.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
2+
using System.ComponentModel;
23
using System.Windows;
34
using System.Windows.Input;
5+
using Flow.Launcher.Infrastructure.UserSettings;
46
using Flow.Launcher.SettingPages.ViewModels;
57

68
namespace Flow.Launcher
@@ -13,7 +15,26 @@ public partial class CustomShortcutSetting : Window
1315
private string originalKey { get; } = null;
1416
private string originalValue { get; } = null;
1517
private bool update { get; } = false;
16-
18+
private readonly Settings _settings;
19+
public event PropertyChangedEventHandler PropertyChanged;
20+
21+
public string SettingWindowFont
22+
{
23+
get => _settings.SettingWindowFont;
24+
set
25+
{
26+
if (_settings.SettingWindowFont != value)
27+
{
28+
_settings.SettingWindowFont = value;
29+
OnPropertyChanged(nameof(SettingWindowFont));
30+
}
31+
}
32+
}
33+
34+
protected virtual void OnPropertyChanged(string propertyName)
35+
{
36+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
37+
}
1738
public CustomShortcutSetting(SettingsPaneHotkeyViewModel vm)
1839
{
1940
_hotkeyVm = vm;

Flow.Launcher/SelectBrowserWindow.xaml

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Width="550"
1111
Background="{DynamicResource PopuBGColor}"
1212
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13+
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
1314
Foreground="{DynamicResource PopupTextColor}"
1415
ResizeMode="NoResize"
1516
SizeToContent="Height"
@@ -54,11 +55,11 @@
5455
</Button>
5556
</Grid>
5657
</StackPanel>
57-
<StackPanel Margin="26,12,26,0">
58-
<StackPanel Margin="0,0,0,12">
58+
<StackPanel Margin="26 12 26 0">
59+
<StackPanel Margin="0 0 0 12">
5960
<TextBlock
6061
Grid.Column="0"
61-
Margin="0,0,0,0"
62+
Margin="0 0 0 0"
6263
FontSize="20"
6364
FontWeight="SemiBold"
6465
Text="{DynamicResource defaultBrowserTitle}"
@@ -73,7 +74,7 @@
7374
</StackPanel>
7475

7576

76-
<StackPanel Margin="14,28,0,0" Orientation="Horizontal">
77+
<StackPanel Margin="14 28 0 0" Orientation="Horizontal">
7778
<TextBlock
7879
Grid.Column="1"
7980
HorizontalAlignment="Left"
@@ -84,7 +85,7 @@
8485
Name="comboBox"
8586
Height="35"
8687
MinWidth="200"
87-
Margin="14,0,0,0"
88+
Margin="14 0 0 0"
8889
HorizontalAlignment="Left"
8990
VerticalAlignment="Center"
9091
ItemsSource="{Binding CustomBrowsers}"
@@ -96,22 +97,22 @@
9697
</ComboBox.ItemTemplate>
9798
</ComboBox>
9899
<Button
99-
Margin="10,0,0,0"
100+
Margin="10 0 0 0"
100101
Click="btnAdd_Click"
101102
Content="{DynamicResource add}" />
102103
<Button
103-
Margin="10,0,0,0"
104+
Margin="10 0 0 0"
104105
Click="btnDelete_Click"
105106
Content="{DynamicResource delete}"
106107
IsEnabled="{Binding CustomBrowser.Editable}" />
107108

108109
</StackPanel>
109110
<Rectangle
110111
Height="1"
111-
Margin="0,20,0,12"
112+
Margin="0 20 0 12"
112113
Fill="{DynamicResource SeparatorForeground}" />
113114
<StackPanel
114-
Margin="0,0,0,0"
115+
Margin="0 0 0 0"
115116
HorizontalAlignment="Stretch"
116117
DataContext="{Binding CustomBrowser}"
117118
Orientation="Horizontal">
@@ -129,7 +130,7 @@
129130
<TextBlock
130131
Grid.Row="0"
131132
Grid.Column="0"
132-
Margin="14,5,10,0"
133+
Margin="14 5 10 0"
133134
HorizontalAlignment="Left"
134135
VerticalAlignment="Center"
135136
FontSize="14"
@@ -139,15 +140,15 @@
139140
Grid.Row="0"
140141
Grid.Column="1"
141142
Width="Auto"
142-
Margin="10,5,0,0"
143+
Margin="10 5 0 0"
143144
HorizontalAlignment="Stretch"
144145
VerticalAlignment="Center"
145146
IsEnabled="{Binding Editable}"
146147
Text="{Binding Name}" />
147148
<TextBlock
148149
Grid.Row="1"
149150
Grid.Column="0"
150-
Margin="14,10,0,0"
151+
Margin="14 10 0 0"
151152
HorizontalAlignment="Left"
152153
VerticalAlignment="Center"
153154
FontSize="14"
@@ -159,7 +160,7 @@
159160
LastChildFill="True">
160161
<Button
161162
Name="btnBrowseFile"
162-
Margin="0,10,0,0"
163+
Margin="0 10 0 0"
163164
HorizontalAlignment="Right"
164165
VerticalAlignment="Center"
165166
Click="btnBrowseFile_Click"
@@ -177,7 +178,7 @@
177178
</Button>
178179
<TextBox
179180
x:Name="PathTextBox"
180-
Margin="10,10,5,0"
181+
Margin="10 10 5 0"
181182
HorizontalAlignment="Stretch"
182183
VerticalAlignment="Center"
183184
IsEnabled="{Binding Editable}"
@@ -187,37 +188,35 @@
187188
<StackPanel
188189
Grid.Row="2"
189190
Grid.Column="1"
190-
Margin="14,10,14,0"
191+
Margin="14 10 14 0"
191192
HorizontalAlignment="Left"
192193
VerticalAlignment="Center"
193194
Orientation="Horizontal">
194-
<RadioButton IsChecked="{Binding OpenInTab}"
195-
Content="{DynamicResource defaultBrowser_newTab}"></RadioButton>
196-
<RadioButton IsChecked="{Binding OpenInNewWindow, Mode=OneTime}"
197-
Content="{DynamicResource defaultBrowser_newWindow}"></RadioButton>
195+
<RadioButton Content="{DynamicResource defaultBrowser_newTab}" IsChecked="{Binding OpenInTab}" />
196+
<RadioButton Content="{DynamicResource defaultBrowser_newWindow}" IsChecked="{Binding OpenInNewWindow, Mode=OneTime}" />
198197
</StackPanel>
199198
<TextBlock
200199
Grid.Row="3"
201200
Grid.Column="0"
202-
Margin="14,10,0,20"
201+
Margin="14 10 0 20"
203202
HorizontalAlignment="Left"
204203
VerticalAlignment="Center"
205204
FontSize="14"
206205
Text="{DynamicResource defaultBrowser_parameter}" />
207206
<StackPanel
208207
Grid.Row="3"
209208
Grid.Column="1"
210-
Margin="0,10,0,15"
209+
Margin="0 10 0 15"
211210
HorizontalAlignment="Stretch"
212211
VerticalAlignment="Center"
213212
Orientation="Horizontal">
214213
<TextBox
215214
x:Name="fileArgTextBox"
216215
Width="180"
217-
Margin="10,0,0,0"
216+
Margin="10 0 0 0"
218217
Text="{Binding PrivateArg}" />
219218
<CheckBox
220-
Margin="12,0,0,0"
219+
Margin="12 0 0 0"
221220
VerticalAlignment="Center"
222221
IsChecked="{Binding EnablePrivate}">
223222
<CheckBox.Style>
@@ -239,18 +238,18 @@
239238
Grid.Row="1"
240239
Background="{DynamicResource PopupButtonAreaBGColor}"
241240
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
242-
BorderThickness="0,1,0,0">
241+
BorderThickness="0 1 0 0">
243242
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
244243
<Button
245244
x:Name="btnCancel"
246245
Width="145"
247-
Margin="0,0,5,0"
246+
Margin="0 0 5 0"
248247
Click="btnCancel_Click"
249248
Content="{DynamicResource cancel}" />
250249
<Button
251250
x:Name="btnDone"
252251
Width="145"
253-
Margin="5,0,0,0"
252+
Margin="5 0 0 0"
254253
Click="btnDone_Click"
255254
Content="{DynamicResource done}"
256255
ForceCursor="True"

Flow.Launcher/SelectBrowserWindow.xaml.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,22 @@ public partial class SelectBrowserWindow : Window, INotifyPropertyChanged
1515
public event PropertyChangedEventHandler PropertyChanged;
1616

1717
public Settings Settings { get; }
18-
18+
public string SettingWindowFont
19+
{
20+
get => Settings.SettingWindowFont;
21+
set
22+
{
23+
if (Settings.SettingWindowFont != value)
24+
{
25+
Settings.SettingWindowFont = value;
26+
OnPropertyChanged(nameof(SettingWindowFont));
27+
}
28+
}
29+
}
30+
protected virtual void OnPropertyChanged(string propertyName)
31+
{
32+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
33+
}
1934
public int SelectedCustomBrowserIndex
2035
{
2136
get => selectedCustomBrowserIndex; set

Flow.Launcher/SelectFileManagerWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Width="600"
1111
Background="{DynamicResource PopuBGColor}"
1212
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13+
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
1314
Foreground="{DynamicResource PopupTextColor}"
1415
ResizeMode="NoResize"
1516
SizeToContent="Height"

Flow.Launcher/SelectFileManagerWindow.xaml.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged
1717

1818
public Settings Settings { get; }
1919

20+
public string SettingWindowFont
21+
{
22+
get => Settings.SettingWindowFont;
23+
set
24+
{
25+
if (Settings.SettingWindowFont != value)
26+
{
27+
Settings.SettingWindowFont = value;
28+
OnPropertyChanged(nameof(SettingWindowFont));
29+
}
30+
}
31+
}
32+
protected virtual void OnPropertyChanged(string propertyName)
33+
{
34+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
35+
}
2036
public int SelectedCustomExplorerIndex
2137
{
2238
get => selectedCustomExplorerIndex; set

0 commit comments

Comments
 (0)