mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[PTRun][Shell]Select which shell is used (#28121)
* [PTRun] LeaveShellOpen condition added to run command * [PTRun] Keep shell open added to shell plugin settings. * [PTRun] Unnecessary variable deleted. Formatting. * [PTRun] Variable name changed. * [PTRun] Shell selection * [PTRun] Bugfix * [PTRun] Review comments. * [PTRun] Revert commit * [PTRun] An enumaration is added to PluginAdditionalOption for selection types.
This commit is contained in:
@@ -444,11 +444,21 @@
|
||||
BorderThickness="0,0,0,0"
|
||||
ContentAlignment="Left"
|
||||
CornerRadius="0">
|
||||
<controls:CheckBoxWithDescriptionControl
|
||||
Margin="56,0,0,0"
|
||||
Description="{x:Bind Path=DisplayDescription}"
|
||||
Header="{x:Bind Path=DisplayLabel}"
|
||||
IsChecked="{x:Bind Path=Value, Mode=TwoWay}" />
|
||||
<StackPanel Orientation="Vertical">
|
||||
<controls:CheckBoxWithDescriptionControl
|
||||
Margin="56,0,0,0"
|
||||
Description="{x:Bind Path=DisplayDescription}"
|
||||
Header="{x:Bind Path=DisplayLabel}"
|
||||
IsChecked="{x:Bind Path=Value, Mode=TwoWay}"
|
||||
Visibility="{x:Bind Path=ShowCheckBox, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<ComboBox
|
||||
Margin="56,0,0,0"
|
||||
Description="{x:Bind Path=DisplayDescription}"
|
||||
Header="{x:Bind Path=DisplayLabel}"
|
||||
ItemsSource="{x:Bind Path=ComboBoxOptions}"
|
||||
SelectedIndex="{x:Bind Path=Option, Mode=TwoWay}"
|
||||
Visibility="{x:Bind Path=ShowComboBox, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||
</StackPanel>
|
||||
</labs:SettingsCard>
|
||||
<Rectangle
|
||||
Height="1"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
@@ -17,9 +18,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_additionalOption = additionalOption;
|
||||
}
|
||||
|
||||
public string DisplayLabel { get => _additionalOption.DisplayLabel; }
|
||||
public string DisplayLabel => _additionalOption.DisplayLabel;
|
||||
|
||||
public string DisplayDescription { get => _additionalOption.DisplayDescription; }
|
||||
public string DisplayDescription => _additionalOption.DisplayDescription;
|
||||
|
||||
public bool Value
|
||||
{
|
||||
@@ -34,6 +35,25 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> ComboBoxOptions => _additionalOption.ComboBoxOptions;
|
||||
|
||||
public int Option
|
||||
{
|
||||
get => _additionalOption.Option;
|
||||
set
|
||||
{
|
||||
if (value != _additionalOption.Option)
|
||||
{
|
||||
_additionalOption.Option = value;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowComboBox => _additionalOption.SelectionTypeValue == (int)PluginAdditionalOption.SelectionType.Combobox && _additionalOption.ComboBoxOptions != null && _additionalOption.ComboBoxOptions.Count > 0;
|
||||
|
||||
public bool ShowCheckBox => _additionalOption.SelectionTypeValue == (int)PluginAdditionalOption.SelectionType.Checkbox;
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
|
||||
|
||||
Reference in New Issue
Block a user