mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[PTRun][Search]Add setting to exclude files/patterns from indexer (#31459)
* Add patterns exclusion to PTRun indexer * Apply xaml styling * Fix pattern escaping issues * Add placeholder to indexer exclusion options * Add placeholder text to textboxes * Fix failing to split multiline text in indexer settings * Add placeholder text to checkbox and textbox setting * Change generated source comments to english
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Combobox = 1,
|
||||
Textbox = 2,
|
||||
Numberbox = 3,
|
||||
MultilineTextbox = 4,
|
||||
CheckboxAndCombobox = 11,
|
||||
CheckboxAndTextbox = 12,
|
||||
CheckboxAndNumberbox = 13,
|
||||
@@ -71,6 +72,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public int? TextBoxMaxLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the placeholder of a textbox.
|
||||
/// </summary>
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string PlaceholderText { get; set; }
|
||||
|
||||
public double NumberValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -446,6 +446,29 @@
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
MaxWidth="450"
|
||||
MaxLength="{x:Bind TextBoxMaxLength, Mode=OneWay}"
|
||||
PlaceholderText="{x:Bind Path=PlaceholderText}"
|
||||
Text="{x:Bind TextValue, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
<!-- MultilineTextBox setting -->
|
||||
<tkcontrols:SettingsCard
|
||||
MinHeight="0"
|
||||
Margin="56,8,45,8"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0,0,0,0"
|
||||
ContentAlignment="Vertical"
|
||||
CornerRadius="0"
|
||||
Description="{x:Bind Path=DisplayDescription}"
|
||||
Header="{x:Bind Path=DisplayLabel}"
|
||||
Visibility="{x:Bind Path=ShowMultilineTextBox, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<TextBox
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
MinHeight="160"
|
||||
AcceptsReturn="True"
|
||||
PlaceholderText="{x:Bind Path=PlaceholderText}"
|
||||
ScrollViewer.IsVerticalRailEnabled="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
ScrollViewer.VerticalScrollMode="Enabled"
|
||||
Text="{x:Bind TextValue, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
<!-- NumberBox setting -->
|
||||
@@ -535,6 +558,7 @@
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
MaxWidth="450"
|
||||
MaxLength="{x:Bind TextBoxMaxLength, Mode=OneWay}"
|
||||
PlaceholderText="{x:Bind Path=PlaceholderText}"
|
||||
Text="{x:Bind TextValue, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
</StackPanel>
|
||||
|
||||
@@ -83,6 +83,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
// MultilineTextBox setting
|
||||
public bool ShowMultilineTextBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.MultilineTextbox;
|
||||
|
||||
public string PlaceholderText => _additionalOption.PlaceholderText;
|
||||
|
||||
// NumberBox setting
|
||||
public bool ShowNumberBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.Numberbox;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user