mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[PTRun][Shell]Shell selection and combobox improvements (#28972)
* Make combobox items sortable * Update plugin settings * settings description * fix settings hang on outdated plugin code * spell fixes, shell implementation, translation improvements * rename property * backward compatibility * comment changes * comment changes * review feedback 1 * review feedback 2 * Code clean up
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
|
||||
@@ -47,18 +48,18 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
|
||||
// ComboBox setting
|
||||
public bool ShowComboBox => _additionalOption.PluginOptionType == PluginAdditionalOption.AdditionalOptionType.Combobox &&
|
||||
_additionalOption.ComboBoxOptions != null && _additionalOption.ComboBoxOptions.Count > 0;
|
||||
_additionalOption.ComboBoxItems != null && _additionalOption.ComboBoxItems.Count > 0;
|
||||
|
||||
public List<string> ComboBoxOptions => _additionalOption.ComboBoxOptions;
|
||||
public List<KeyValuePair<string, string>> ComboBoxItems => _additionalOption.ComboBoxItems;
|
||||
|
||||
public int ComboBoxValue
|
||||
public string ComboBoxValue
|
||||
{
|
||||
get => _additionalOption.ComboBoxValue;
|
||||
get => _additionalOption.ComboBoxValue.ToString(CultureInfo.InvariantCulture);
|
||||
set
|
||||
{
|
||||
if (value != _additionalOption.ComboBoxValue)
|
||||
if (int.Parse(value, CultureInfo.InvariantCulture) != _additionalOption.ComboBoxValue)
|
||||
{
|
||||
_additionalOption.ComboBoxValue = value;
|
||||
_additionalOption.ComboBoxValue = int.Parse(value, CultureInfo.InvariantCulture);
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user