Skip to content

Commit cd320f3

Browse files
committed
Move to resource
1 parent 317258a commit cd320f3

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class JsonRPCPluginSettings
2929
private static readonly Thickness SettingPanelItemLeftMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftMargin");
3030
private static readonly Thickness SettingPanelItemTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemTopBottomMargin");
3131
private static readonly Thickness SettingPanelItemLeftTopBottomMargin = (Thickness)Application.Current.FindResource("SettingPanelItemLeftTopBottomMargin");
32+
private static readonly double SettingPanelTextBlockMinWidth = (double)Application.Current.FindResource("SettingPanelTextBlockMinWidth");
33+
private static readonly double SettingPanelPathTextBlockMinWidth = (double)Application.Current.FindResource("SettingPanelPathTextBlockMinWidth");
3234

3335
public async Task InitializeAsync()
3436
{
@@ -236,7 +238,7 @@ public void Save()
236238
{
237239
var textBox = new TextBox()
238240
{
239-
MinWidth = 180,
241+
MinWidth = SettingPanelTextBlockMinWidth,
240242
HorizontalAlignment = HorizontalAlignment.Left,
241243
VerticalAlignment = VerticalAlignment.Center,
242244
Margin = SettingPanelItemLeftTopBottomMargin,
@@ -258,7 +260,7 @@ public void Save()
258260
{
259261
var textBox = new TextBox()
260262
{
261-
MinWidth = 240,
263+
MinWidth = SettingPanelPathTextBlockMinWidth,
262264
HorizontalAlignment = HorizontalAlignment.Left,
263265
VerticalAlignment = VerticalAlignment.Center,
264266
Margin = SettingPanelItemLeftMargin,
@@ -324,7 +326,7 @@ public void Save()
324326
var textBox = new TextBox()
325327
{
326328
MaxHeight = 150,
327-
MinWidth = 180,
329+
MinWidth = SettingPanelTextBlockMinWidth,
328330
HorizontalAlignment = HorizontalAlignment.Left,
329331
VerticalAlignment = VerticalAlignment.Center,
330332
Margin = SettingPanelItemLeftTopBottomMargin,
@@ -347,7 +349,7 @@ public void Save()
347349
{
348350
var passwordBox = new PasswordBox()
349351
{
350-
MinWidth = 180,
352+
MinWidth = SettingPanelTextBlockMinWidth,
351353
HorizontalAlignment = HorizontalAlignment.Left,
352354
VerticalAlignment = VerticalAlignment.Center,
353355
Margin = SettingPanelItemLeftTopBottomMargin,

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5602,4 +5602,7 @@
56025602
<Setter Property="VerticalAlignment" Value="Top" />
56035603
<Setter Property="Background" Value="{DynamicResource Color03B}" />
56045604
</Style>
5605+
5606+
<system:Double x:Key="SettingPanelTextBlockMinWidth">180</system:Double>
5607+
<system:Double x:Key="SettingPanelPathTextBlockMinWidth">240</system:Double>
56055608
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
175175
Orientation="Horizontal">
176176
<TextBox
177-
MinWidth="180"
177+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
178178
HorizontalAlignment="Left"
179179
VerticalAlignment="Center"
180180
Text="{Binding FileEditorPath}"
@@ -201,7 +201,7 @@
201201
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
202202
Orientation="Horizontal">
203203
<TextBox
204-
MinWidth="180"
204+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
205205
HorizontalAlignment="Left"
206206
VerticalAlignment="Center"
207207
Text="{Binding FolderEditorPath}"
@@ -228,7 +228,7 @@
228228
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
229229
Orientation="Horizontal">
230230
<TextBox
231-
MinWidth="180"
231+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
232232
HorizontalAlignment="Left"
233233
VerticalAlignment="Center"
234234
Text="{Binding ShellPath}"
@@ -299,7 +299,7 @@
299299
<TextBox
300300
Grid.Row="9"
301301
Grid.Column="1"
302-
MinWidth="180"
302+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
303303
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
304304
HorizontalAlignment="Left"
305305
Text="{Binding ExcludedFileTypes}"
@@ -314,7 +314,7 @@
314314
<TextBox
315315
Grid.Row="10"
316316
Grid.Column="1"
317-
MinWidth="180"
317+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
318318
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
319319
HorizontalAlignment="Left"
320320
VerticalAlignment="Center"
@@ -361,7 +361,7 @@
361361
Grid.Row="15"
362362
Grid.Column="0"
363363
Grid.ColumnSpan="2"
364-
MinWidth="180"
364+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
365365
MaxHeight="150"
366366
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
367367
HorizontalAlignment="Left"
@@ -381,7 +381,7 @@
381381
Grid.Row="17"
382382
Grid.Column="0"
383383
Grid.ColumnSpan="2"
384-
MinWidth="180"
384+
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
385385
MaxHeight="150"
386386
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
387387
HorizontalAlignment="Left"
@@ -529,7 +529,7 @@
529529
<TextBox
530530
Grid.Row="26"
531531
Grid.Column="1"
532-
MinWidth="240"
532+
MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
533533
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
534534
HorizontalAlignment="Left"
535535
Text="{Binding EverythingInstalledPath}" />

0 commit comments

Comments
 (0)