Move to resource

This commit is contained in:
Jack251970 2025-03-01 22:15:22 +08:00
parent 317258af2f
commit cd320f3de6
3 changed files with 17 additions and 12 deletions

View file

@ -29,6 +29,8 @@ namespace Flow.Launcher.Core.Plugin
private static readonly Thickness SettingPanelItemLeftMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftMargin"); private static readonly Thickness SettingPanelItemLeftMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftMargin");
private static readonly Thickness SettingPanelItemTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemTopBottomMargin"); private static readonly Thickness SettingPanelItemTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemTopBottomMargin");
private static readonly Thickness SettingPanelItemLeftTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftTopBottomMargin"); private static readonly Thickness SettingPanelItemLeftTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftTopBottomMargin");
private static readonly double SettingPanelTextBlockMinWidth = (double)Application.Current.FindResource("SettingPanelTextBlockMinWidth");
private static readonly double SettingPanelPathTextBlockMinWidth = (double)Application.Current.FindResource("SettingPanelPathTextBlockMinWidth");
public async Task InitializeAsync() public async Task InitializeAsync()
{ {
@ -236,7 +238,7 @@ namespace Flow.Launcher.Core.Plugin
{ {
var textBox = new TextBox() var textBox = new TextBox()
{ {
MinWidth = 180, MinWidth = SettingPanelTextBlockMinWidth,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
Margin = SettingPanelItemLeftTopBottomMargin, Margin = SettingPanelItemLeftTopBottomMargin,
@ -258,7 +260,7 @@ namespace Flow.Launcher.Core.Plugin
{ {
var textBox = new TextBox() var textBox = new TextBox()
{ {
MinWidth = 240, MinWidth = SettingPanelPathTextBlockMinWidth,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
Margin = SettingPanelItemLeftMargin, Margin = SettingPanelItemLeftMargin,
@ -324,7 +326,7 @@ namespace Flow.Launcher.Core.Plugin
var textBox = new TextBox() var textBox = new TextBox()
{ {
MaxHeight = 150, MaxHeight = 150,
MinWidth = 180, MinWidth = SettingPanelTextBlockMinWidth,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
Margin = SettingPanelItemLeftTopBottomMargin, Margin = SettingPanelItemLeftTopBottomMargin,
@ -347,7 +349,7 @@ namespace Flow.Launcher.Core.Plugin
{ {
var passwordBox = new PasswordBox() var passwordBox = new PasswordBox()
{ {
MinWidth = 180, MinWidth = SettingPanelTextBlockMinWidth,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
Margin = SettingPanelItemLeftTopBottomMargin, Margin = SettingPanelItemLeftTopBottomMargin,

View file

@ -5602,4 +5602,7 @@
<Setter Property="VerticalAlignment" Value="Top" /> <Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Background" Value="{DynamicResource Color03B}" /> <Setter Property="Background" Value="{DynamicResource Color03B}" />
</Style> </Style>
<system:Double x:Key="SettingPanelTextBlockMinWidth">180</system:Double>
<system:Double x:Key="SettingPanelPathTextBlockMinWidth">240</system:Double>
</ResourceDictionary> </ResourceDictionary>

View file

@ -174,7 +174,7 @@
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBox <TextBox
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding FileEditorPath}" Text="{Binding FileEditorPath}"
@ -201,7 +201,7 @@
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBox <TextBox
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding FolderEditorPath}" Text="{Binding FolderEditorPath}"
@ -228,7 +228,7 @@
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBox <TextBox
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{Binding ShellPath}" Text="{Binding ShellPath}"
@ -299,7 +299,7 @@
<TextBox <TextBox
Grid.Row="9" Grid.Row="9"
Grid.Column="1" Grid.Column="1"
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Text="{Binding ExcludedFileTypes}" Text="{Binding ExcludedFileTypes}"
@ -314,7 +314,7 @@
<TextBox <TextBox
Grid.Row="10" Grid.Row="10"
Grid.Column="1" Grid.Column="1"
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
@ -361,7 +361,7 @@
Grid.Row="15" Grid.Row="15"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
MaxHeight="150" MaxHeight="150"
Margin="{StaticResource SettingPanelItemTopBottomMargin}" Margin="{StaticResource SettingPanelItemTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
@ -381,7 +381,7 @@
Grid.Row="17" Grid.Row="17"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
MinWidth="180" MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
MaxHeight="150" MaxHeight="150"
Margin="{StaticResource SettingPanelItemTopBottomMargin}" Margin="{StaticResource SettingPanelItemTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
@ -529,7 +529,7 @@
<TextBox <TextBox
Grid.Row="26" Grid.Row="26"
Grid.Column="1" Grid.Column="1"
MinWidth="240" MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Text="{Binding EverythingInstalledPath}" /> Text="{Binding EverythingInstalledPath}" />