Skip to content

Commit ae8f647

Browse files
committed
Use styles for JsonRPC settings panel
1 parent af3a1a3 commit ae8f647

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ public void Save()
188188
};
189189

190190
// Create a text block for name
191-
// TODO: Move to resource
192191
var name = new TextBlock()
193192
{
194193
Text = attributes.Label,
@@ -200,16 +199,14 @@ public void Save()
200199
TextBlock? desc = null;
201200
if (attributes.Description != null)
202201
{
203-
// TODO: Move to resource
204202
desc = new TextBlock()
205203
{
206204
Text = attributes.Description,
207-
FontSize = 12,
208205
VerticalAlignment = VerticalAlignment.Center,
209-
Margin = new(0, 2, 0, 0),
210206
TextWrapping = TextWrapping.WrapWithOverflow
211207
};
212-
desc.SetResourceReference(TextBlock.ForegroundProperty, "Color04B"); // for theme change
208+
209+
desc.SetResourceReference(TextBlock.StyleProperty, "SettingPanelTextBlockDescriptionStyle"); // for theme change
213210
}
214211

215212
// Add the name and description to the panel
@@ -446,15 +443,9 @@ Settings[attributes.Name] is bool isChecked
446443
}
447444
case "seperator":
448445
{
449-
// TODO: Move to resource
450-
var sep = new Separator
451-
{
452-
VerticalAlignment = VerticalAlignment.Top,
453-
Margin = new(-70, 13.5, -18, 13.5),
454-
Height = 1
455-
};
446+
var sep = new Separator();
456447

457-
sep.SetResourceReference(Separator.BackgroundProperty, "Color03B");
448+
sep.SetResourceReference(Separator.StyleProperty, "SettingPanelSeperatorStyle");
458449

459450
contentControl = sep;
460451

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5607,4 +5607,10 @@
56075607
<system:Double x:Key="SettingPanelPathTextBoxMinWidth">240</system:Double>
56085608
<system:Double x:Key="SettingPanelAreaTextBoxMinWidth">270</system:Double>
56095609
<system:Double x:Key="SettingPanelAreaTextBoxMinHeight">150</system:Double>
5610+
5611+
<Style x:Key="SettingPanelTextBlockDescriptionStyle" TargetType="TextBlock">
5612+
<Setter Property="FontSize" Value="12" />
5613+
<Setter Property="Margin" Value="0 2 0 0" />
5614+
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
5615+
</Style>
56105616
</ResourceDictionary>

0 commit comments

Comments
 (0)