mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[Settings] Run Plugin additional options: description (#17108)
* last changes * update ww settings * feedbvack and TimeDate plugin * Add property description
This commit is contained in:
@@ -10,6 +10,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
|
||||
public string DisplayLabel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value to show a description of this setting in the settings ui. (Optional)
|
||||
/// </summary>
|
||||
public string DisplayDescription { get; set; }
|
||||
|
||||
public bool Value { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
|
||||
public string DisplayLabel { get => _additionalOption.DisplayLabel; }
|
||||
|
||||
public string DisplayDescription { get => _additionalOption.DisplayDescription; }
|
||||
|
||||
public bool Value
|
||||
{
|
||||
get => _additionalOption.Value;
|
||||
|
||||
@@ -38,8 +38,18 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
|
||||
private void CheckBoxSubTextControl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
StackPanel panel = new StackPanel() { Orientation = Orientation.Vertical };
|
||||
panel.Children.Add(new TextBlock() { Margin = new Thickness(0, 10, 0, 0), Text = Header });
|
||||
panel.Children.Add(new IsEnabledTextBlock() { Style = (Style)App.Current.Resources["SecondaryIsEnabledTextBlockStyle"], Text = Description });
|
||||
|
||||
// Add text box only if the description is not empty. Required for additional plugin options.
|
||||
if (!string.IsNullOrWhiteSpace(Description))
|
||||
{
|
||||
panel.Children.Add(new TextBlock() { Margin = new Thickness(0, 10, 0, 0), Text = Header });
|
||||
panel.Children.Add(new IsEnabledTextBlock() { Style = (Style)App.Current.Resources["SecondaryIsEnabledTextBlockStyle"], Text = Description });
|
||||
}
|
||||
else
|
||||
{
|
||||
panel.Children.Add(new TextBlock() { Margin = new Thickness(0, 0, 0, 0), Text = Header });
|
||||
}
|
||||
|
||||
_checkBoxSubTextControl.Content = panel;
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
<DataTemplate x:DataType="ViewModels:PluginAdditionalOptionViewModel">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Rectangle Style="{StaticResource ExpanderSeparatorStyle}" />
|
||||
<CheckBox Content="{x:Bind Path=DisplayLabel}"
|
||||
<controls:CheckBoxWithDescriptionControl Header="{x:Bind Path=DisplayLabel}" Description="{x:Bind Path=DisplayDescription}"
|
||||
IsChecked="{x:Bind Path=Value, Mode=TwoWay}"
|
||||
Margin="{StaticResource ExpanderSettingMargin}"/>
|
||||
</StackPanel>
|
||||
|
||||
Reference in New Issue
Block a user