mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
decouple Shell from the ComboBox SelectedIndex
enables us to add new `Shell` options without messing with the user's saved settings, while keeping the `RunCommand` option last.
This commit is contained in:
parent
1b68d09d51
commit
e6baa88002
1 changed files with 14 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
|
@ -68,10 +68,21 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
_settings.ReplaceWinR = false;
|
||||
};
|
||||
|
||||
ShellComboBox.SelectedIndex = (int) _settings.Shell;
|
||||
ShellComboBox.SelectedIndex = _settings.Shell switch
|
||||
{
|
||||
Shell.Cmd => 0,
|
||||
Shell.Powershell => 1,
|
||||
_ => ShellComboBox.Items.Count - 1
|
||||
};
|
||||
|
||||
ShellComboBox.SelectionChanged += (o, e) =>
|
||||
{
|
||||
_settings.Shell = (Shell) ShellComboBox.SelectedIndex;
|
||||
_settings.Shell = ShellComboBox.SelectedIndex switch
|
||||
{
|
||||
0 => Shell.Cmd,
|
||||
1 => Shell.Powershell,
|
||||
_ => Shell.RunCommand
|
||||
};
|
||||
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue