Skip to content

Commit af3a1a3

Browse files
committed
Unify text area min width & height
1 parent bc7f4fe commit af3a1a3

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ 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");
32+
private static readonly double SettingPanelTextBoxMinWidth = (double)Application.Current.FindResource("SettingPanelTextBoxMinWidth");
33+
private static readonly double SettingPanelPathTextBoxMinWidth = (double)Application.Current.FindResource("SettingPanelPathTextBoxMinWidth");
34+
private static readonly double SettingPanelAreaTextBoxMinWidth = (double)Application.Current.FindResource("SettingPanelAreaTextBoxMinWidth");
35+
private static readonly double SettingPanelAreaTextBoxMinHeight = (double)Application.Current.FindResource("SettingPanelAreaTextBoxMinHeight");
3436

3537
public async Task InitializeAsync()
3638
{
@@ -229,7 +231,7 @@ public void Save()
229231
VerticalAlignment = VerticalAlignment.Center,
230232
Margin = SettingPanelItemTopBottomMargin,
231233
TextAlignment = TextAlignment.Left,
232-
TextWrapping = TextWrapping.Wrap // TODO: Check password and others
234+
TextWrapping = TextWrapping.Wrap
233235
};
234236

235237
break;
@@ -238,7 +240,7 @@ public void Save()
238240
{
239241
var textBox = new TextBox()
240242
{
241-
MinWidth = SettingPanelTextBlockMinWidth,
243+
MinWidth = SettingPanelTextBoxMinWidth,
242244
HorizontalAlignment = HorizontalAlignment.Left,
243245
VerticalAlignment = VerticalAlignment.Center,
244246
Margin = SettingPanelItemLeftTopBottomMargin,
@@ -260,7 +262,7 @@ public void Save()
260262
{
261263
var textBox = new TextBox()
262264
{
263-
MinWidth = SettingPanelPathTextBlockMinWidth,
265+
MinWidth = SettingPanelPathTextBoxMinWidth,
264266
HorizontalAlignment = HorizontalAlignment.Left,
265267
VerticalAlignment = VerticalAlignment.Center,
266268
Margin = SettingPanelItemLeftMargin,
@@ -325,8 +327,8 @@ public void Save()
325327
{
326328
var textBox = new TextBox()
327329
{
328-
MinHeight = 150,
329-
MinWidth = 240,
330+
MinHeight = SettingPanelAreaTextBoxMinHeight,
331+
MinWidth = SettingPanelAreaTextBoxMinWidth,
330332
HorizontalAlignment = HorizontalAlignment.Left,
331333
VerticalAlignment = VerticalAlignment.Center,
332334
Margin = SettingPanelItemLeftTopBottomMargin,
@@ -349,15 +351,16 @@ public void Save()
349351
{
350352
var passwordBox = new PasswordBox()
351353
{
352-
MinWidth = SettingPanelTextBlockMinWidth,
354+
MinWidth = SettingPanelTextBoxMinWidth,
353355
HorizontalAlignment = HorizontalAlignment.Left,
354356
VerticalAlignment = VerticalAlignment.Center,
355357
Margin = SettingPanelItemLeftTopBottomMargin,
356358
Password = Settings[attributes.Name] as string ?? string.Empty,
357359
PasswordChar = attributes.passwordChar == default ? '*' : attributes.passwordChar,
358-
ToolTip = attributes.Description
360+
ToolTip = attributes.Description,
359361
};
360362

363+
// TODO: Fix issue here
361364
passwordBox.PasswordChanged += (sender, _) =>
362365
{
363366
Settings[attributes.Name] = ((PasswordBox)sender).Password;

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5603,6 +5603,8 @@
56035603
<Setter Property="Background" Value="{DynamicResource Color03B}" />
56045604
</Style>
56055605

5606-
<system:Double x:Key="SettingPanelTextBlockMinWidth">180</system:Double>
5607-
<system:Double x:Key="SettingPanelPathTextBlockMinWidth">240</system:Double>
5606+
<system:Double x:Key="SettingPanelTextBoxMinWidth">180</system:Double>
5607+
<system:Double x:Key="SettingPanelPathTextBoxMinWidth">240</system:Double>
5608+
<system:Double x:Key="SettingPanelAreaTextBoxMinWidth">270</system:Double>
5609+
<system:Double x:Key="SettingPanelAreaTextBoxMinHeight">150</system:Double>
56085610
</ResourceDictionary>

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
175175
Orientation="Horizontal">
176176
<TextBox
177-
MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
177+
MinWidth="{StaticResource SettingPanelPathTextBoxMinWidth}"
178178
HorizontalAlignment="Left"
179179
VerticalAlignment="Center"
180180
Text="{Binding FileEditorPath}"
@@ -200,7 +200,7 @@
200200
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
201201
Orientation="Horizontal">
202202
<TextBox
203-
MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
203+
MinWidth="{StaticResource SettingPanelPathTextBoxMinWidth}"
204204
HorizontalAlignment="Left"
205205
VerticalAlignment="Center"
206206
Text="{Binding FolderEditorPath}"
@@ -226,7 +226,7 @@
226226
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
227227
Orientation="Horizontal">
228228
<TextBox
229-
MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
229+
MinWidth="{StaticResource SettingPanelPathTextBoxMinWidth}"
230230
HorizontalAlignment="Left"
231231
VerticalAlignment="Center"
232232
Text="{Binding ShellPath}"
@@ -296,7 +296,7 @@
296296
<TextBox
297297
Grid.Row="9"
298298
Grid.Column="1"
299-
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
299+
MinWidth="{StaticResource SettingPanelTextBoxMinWidth}"
300300
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
301301
HorizontalAlignment="Left"
302302
Text="{Binding ExcludedFileTypes}"
@@ -311,7 +311,7 @@
311311
<TextBox
312312
Grid.Row="10"
313313
Grid.Column="1"
314-
MinWidth="{StaticResource SettingPanelTextBlockMinWidth}"
314+
MinWidth="{StaticResource SettingPanelTextBoxMinWidth}"
315315
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
316316
HorizontalAlignment="Left"
317317
VerticalAlignment="Center"
@@ -358,8 +358,8 @@
358358
Grid.Row="15"
359359
Grid.Column="0"
360360
Grid.ColumnSpan="2"
361-
MinWidth="240"
362-
MinHeight="150"
361+
MinWidth="{StaticResource SettingPanelAreaTextBoxMinWidth}"
362+
MinHeight="{StaticResource SettingPanelAreaTextBoxMinHeight}"
363363
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
364364
HorizontalAlignment="Left"
365365
AcceptsReturn="True"
@@ -378,8 +378,8 @@
378378
Grid.Row="17"
379379
Grid.Column="0"
380380
Grid.ColumnSpan="2"
381-
MinWidth="240"
382-
MinHeight="150"
381+
MinWidth="{StaticResource SettingPanelAreaTextBoxMinWidth}"
382+
MinHeight="{StaticResource SettingPanelAreaTextBoxMinHeight}"
383383
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
384384
HorizontalAlignment="Left"
385385
AcceptsReturn="True"
@@ -526,7 +526,7 @@
526526
<TextBox
527527
Grid.Row="26"
528528
Grid.Column="1"
529-
MinWidth="{StaticResource SettingPanelPathTextBlockMinWidth}"
529+
MinWidth="{StaticResource SettingPanelPathTextBoxMinWidth}"
530530
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
531531
HorizontalAlignment="Left"
532532
Text="{Binding EverythingInstalledPath}" />

0 commit comments

Comments
 (0)