Skip to content

Commit f54409a

Browse files
authored
Merge pull request #910 from onesounds/PythonSettingPanelStyle
Adjust Vertical Alignment and Margins in JsonSettingPanel
2 parents 5d2368a + a05f2bb commit f54409a

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ public virtual async Task InitAsync(PluginInitContext context)
354354
this.context = context;
355355
await InitSettingAsync();
356356
}
357-
private static readonly Thickness settingControlMargin = new(10);
357+
private static readonly Thickness settingControlMargin = new(10, 4, 10, 4);
358+
private static readonly Thickness settingPanelMargin = new(15, 20, 15, 20);
359+
private static readonly Thickness settingTextBlockMargin = new(10, 4, 10, 4);
358360
private JsonRpcConfigurationModel _settingsTemplate;
359361
public Control CreateSettingPanel()
360362
{
@@ -363,7 +365,7 @@ public Control CreateSettingPanel()
363365
var settingWindow = new UserControl();
364366
var mainPanel = new StackPanel
365367
{
366-
Margin = settingControlMargin,
368+
Margin = settingPanelMargin,
367369
Orientation = Orientation.Vertical
368370
};
369371
settingWindow.Content = mainPanel;
@@ -375,10 +377,13 @@ public Control CreateSettingPanel()
375377
Orientation = Orientation.Horizontal,
376378
Margin = settingControlMargin
377379
};
378-
var name = new Label()
380+
var name = new TextBlock()
379381
{
380-
Content = attribute.Label,
381-
Margin = settingControlMargin
382+
Text = attribute.Label,
383+
Width = 120,
384+
VerticalAlignment = VerticalAlignment.Center,
385+
Margin = settingControlMargin,
386+
TextWrapping = TextWrapping.WrapWithOverflow
382387
};
383388

384389
FrameworkElement contentControl;
@@ -390,8 +395,8 @@ public Control CreateSettingPanel()
390395
contentControl = new TextBlock
391396
{
392397
Text = attribute.Description.Replace("\\r\\n", "\r\n"),
393-
Margin = settingControlMargin,
394-
MaxWidth = 400,
398+
Margin = settingTextBlockMargin,
399+
MaxWidth = 500,
395400
TextWrapping = TextWrapping.WrapWithOverflow
396401
};
397402
break;

0 commit comments

Comments
 (0)