Add FontFamily Style

This commit is contained in:
DB P 2025-04-19 15:40:11 +09:00
parent 647f2bb0a1
commit 942b29061e
7 changed files with 101 additions and 29 deletions

View file

@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
Title="{DynamicResource customeQueryHotkeyTitle}"
Width="530"
Background="{DynamicResource PopuBGColor}"

View file

@ -1,6 +1,7 @@
using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.UserSettings;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Input;
@ -13,7 +14,25 @@ namespace Flow.Launcher
private readonly Settings _settings;
private bool update;
private CustomPluginHotkey updateCustomHotkey;
public event PropertyChangedEventHandler PropertyChanged;
public string SettingWindowFont
{
get => _settings.SettingWindowFont;
set
{
if (_settings.SettingWindowFont != value)
{
_settings.SettingWindowFont = value;
OnPropertyChanged(nameof(SettingWindowFont));
}
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public CustomQueryHotkeySetting(Settings settings)
{
_settings = settings;

View file

@ -1,6 +1,8 @@
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.SettingPages.ViewModels;
namespace Flow.Launcher
@ -13,7 +15,26 @@ namespace Flow.Launcher
private string originalKey { get; } = null;
private string originalValue { get; } = null;
private bool update { get; } = false;
private readonly Settings _settings;
public event PropertyChangedEventHandler PropertyChanged;
public string SettingWindowFont
{
get => _settings.SettingWindowFont;
set
{
if (_settings.SettingWindowFont != value)
{
_settings.SettingWindowFont = value;
OnPropertyChanged(nameof(SettingWindowFont));
}
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public CustomShortcutSetting(SettingsPaneHotkeyViewModel vm)
{
_hotkeyVm = vm;

View file

@ -10,6 +10,7 @@
Width="550"
Background="{DynamicResource PopuBGColor}"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
Foreground="{DynamicResource PopupTextColor}"
ResizeMode="NoResize"
SizeToContent="Height"
@ -54,11 +55,11 @@
</Button>
</Grid>
</StackPanel>
<StackPanel Margin="26,12,26,0">
<StackPanel Margin="0,0,0,12">
<StackPanel Margin="26 12 26 0">
<StackPanel Margin="0 0 0 12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
Margin="0 0 0 0"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource defaultBrowserTitle}"
@ -73,7 +74,7 @@
</StackPanel>
<StackPanel Margin="14,28,0,0" Orientation="Horizontal">
<StackPanel Margin="14 28 0 0" Orientation="Horizontal">
<TextBlock
Grid.Column="1"
HorizontalAlignment="Left"
@ -84,7 +85,7 @@
Name="comboBox"
Height="35"
MinWidth="200"
Margin="14,0,0,0"
Margin="14 0 0 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsSource="{Binding CustomBrowsers}"
@ -96,11 +97,11 @@
</ComboBox.ItemTemplate>
</ComboBox>
<Button
Margin="10,0,0,0"
Margin="10 0 0 0"
Click="btnAdd_Click"
Content="{DynamicResource add}" />
<Button
Margin="10,0,0,0"
Margin="10 0 0 0"
Click="btnDelete_Click"
Content="{DynamicResource delete}"
IsEnabled="{Binding CustomBrowser.Editable}" />
@ -108,10 +109,10 @@
</StackPanel>
<Rectangle
Height="1"
Margin="0,20,0,12"
Margin="0 20 0 12"
Fill="{DynamicResource SeparatorForeground}" />
<StackPanel
Margin="0,0,0,0"
Margin="0 0 0 0"
HorizontalAlignment="Stretch"
DataContext="{Binding CustomBrowser}"
Orientation="Horizontal">
@ -129,7 +130,7 @@
<TextBlock
Grid.Row="0"
Grid.Column="0"
Margin="14,5,10,0"
Margin="14 5 10 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
@ -139,7 +140,7 @@
Grid.Row="0"
Grid.Column="1"
Width="Auto"
Margin="10,5,0,0"
Margin="10 5 0 0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
@ -147,7 +148,7 @@
<TextBlock
Grid.Row="1"
Grid.Column="0"
Margin="14,10,0,0"
Margin="14 10 0 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
@ -159,7 +160,7 @@
LastChildFill="True">
<Button
Name="btnBrowseFile"
Margin="0,10,0,0"
Margin="0 10 0 0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="btnBrowseFile_Click"
@ -177,7 +178,7 @@
</Button>
<TextBox
x:Name="PathTextBox"
Margin="10,10,5,0"
Margin="10 10 5 0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
@ -187,19 +188,17 @@
<StackPanel
Grid.Row="2"
Grid.Column="1"
Margin="14,10,14,0"
Margin="14 10 14 0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton IsChecked="{Binding OpenInTab}"
Content="{DynamicResource defaultBrowser_newTab}"></RadioButton>
<RadioButton IsChecked="{Binding OpenInNewWindow, Mode=OneTime}"
Content="{DynamicResource defaultBrowser_newWindow}"></RadioButton>
<RadioButton Content="{DynamicResource defaultBrowser_newTab}" IsChecked="{Binding OpenInTab}" />
<RadioButton Content="{DynamicResource defaultBrowser_newWindow}" IsChecked="{Binding OpenInNewWindow, Mode=OneTime}" />
</StackPanel>
<TextBlock
Grid.Row="3"
Grid.Column="0"
Margin="14,10,0,20"
Margin="14 10 0 20"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
@ -207,17 +206,17 @@
<StackPanel
Grid.Row="3"
Grid.Column="1"
Margin="0,10,0,15"
Margin="0 10 0 15"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBox
x:Name="fileArgTextBox"
Width="180"
Margin="10,0,0,0"
Margin="10 0 0 0"
Text="{Binding PrivateArg}" />
<CheckBox
Margin="12,0,0,0"
Margin="12 0 0 0"
VerticalAlignment="Center"
IsChecked="{Binding EnablePrivate}">
<CheckBox.Style>
@ -239,18 +238,18 @@
Grid.Row="1"
Background="{DynamicResource PopupButtonAreaBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0,1,0,0">
BorderThickness="0 1 0 0">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
x:Name="btnCancel"
Width="145"
Margin="0,0,5,0"
Margin="0 0 5 0"
Click="btnCancel_Click"
Content="{DynamicResource cancel}" />
<Button
x:Name="btnDone"
Width="145"
Margin="5,0,0,0"
Margin="5 0 0 0"
Click="btnDone_Click"
Content="{DynamicResource done}"
ForceCursor="True"

View file

@ -15,7 +15,22 @@ namespace Flow.Launcher
public event PropertyChangedEventHandler PropertyChanged;
public Settings Settings { get; }
public string SettingWindowFont
{
get => Settings.SettingWindowFont;
set
{
if (Settings.SettingWindowFont != value)
{
Settings.SettingWindowFont = value;
OnPropertyChanged(nameof(SettingWindowFont));
}
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public int SelectedCustomBrowserIndex
{
get => selectedCustomBrowserIndex; set

View file

@ -10,6 +10,7 @@
Width="600"
Background="{DynamicResource PopuBGColor}"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
FontFamily="{Binding SettingWindowFont, Mode=TwoWay}"
Foreground="{DynamicResource PopupTextColor}"
ResizeMode="NoResize"
SizeToContent="Height"

View file

@ -17,6 +17,22 @@ namespace Flow.Launcher
public Settings Settings { get; }
public string SettingWindowFont
{
get => Settings.SettingWindowFont;
set
{
if (Settings.SettingWindowFont != value)
{
Settings.SettingWindowFont = value;
OnPropertyChanged(nameof(SettingWindowFont));
}
}
}
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public int SelectedCustomExplorerIndex
{
get => selectedCustomExplorerIndex; set