mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Bugfix
This commit is contained in:
parent
334d58df29
commit
d394d86201
6 changed files with 11 additions and 10 deletions
|
|
@ -46,7 +46,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public void Deconstruct(out string key, out string value)
|
||||
{
|
||||
key = Key;
|
||||
value = Expand();
|
||||
value = Value;
|
||||
}
|
||||
|
||||
public static implicit operator (string Key, string Value)(CustomShortcutModel shortcut)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using Flow.Launcher.Plugin;
|
|||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using Flow.Launcher;
|
||||
using Flow.Launcher.ViewModel;
|
||||
|
||||
namespace Flow.Launcher.Infrastructure.UserSettings
|
||||
{
|
||||
public class Settings : BaseModel
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ namespace Flow.Launcher
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
public CustomShortcutSetting((string, string) shortcut, Settings settings)
|
||||
public CustomShortcutSetting(CustomShortcutModel shortcut, Settings settings)
|
||||
{
|
||||
(Key, Value) = shortcut;
|
||||
Key = shortcut.Key;
|
||||
Value = shortcut.Value;
|
||||
_settings = settings;
|
||||
update = true;
|
||||
InitializeComponent();
|
||||
|
|
|
|||
|
|
@ -2131,7 +2131,8 @@
|
|||
<GridView>
|
||||
<GridViewColumn Width="180" Header="{DynamicResource hotkey}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate DataType="userSettings:CustomPluginHotkey">
|
||||
<DataTemplate
|
||||
="userSettings:CustomPluginHotkey">
|
||||
<TextBlock Text="{Binding Hotkey}" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
|
|
@ -2184,7 +2185,6 @@
|
|||
BorderThickness="1"
|
||||
ItemsSource="{Binding ShortCuts}"
|
||||
SelectedItem="{Binding SelectedCustomShortcut}"
|
||||
SelectedIndex="{Binding SelectCustomShortcutIndex}"
|
||||
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ namespace Flow.Launcher
|
|||
var shortcutSettingWindow = new CustomShortcutSetting(item, settings);
|
||||
if (shortcutSettingWindow.ShowDialog() == true)
|
||||
{
|
||||
viewModel.EditShortcut(item);
|
||||
viewModel.EditShortcut(item, shortcutSettingWindow.ShortCut);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -543,7 +543,6 @@ namespace Flow.Launcher.ViewModel
|
|||
public CustomPluginHotkey SelectedCustomPluginHotkey { get; set; }
|
||||
|
||||
public CustomShortcutModel? SelectedCustomShortcut { get; set; }
|
||||
public int? SelectCustomShortcutIndex { get; set; }
|
||||
|
||||
public void AddShortcut(CustomShortcutModel shortcut)
|
||||
{
|
||||
|
|
@ -551,10 +550,10 @@ namespace Flow.Launcher.ViewModel
|
|||
ShortCuts.Add(shortcut);
|
||||
}
|
||||
|
||||
public void EditShortcut(CustomShortcutModel shortcut)
|
||||
public void EditShortcut(CustomShortcutModel oldShortcut, CustomShortcutModel newShortcut)
|
||||
{
|
||||
Settings.CustomShortcuts[ShortCuts.IndexOf(shortcut)] = shortcut;
|
||||
ShortCuts[ShortCuts.IndexOf(shortcut)] = shortcut;
|
||||
RemoveShortcut(oldShortcut);
|
||||
AddShortcut(newShortcut);
|
||||
}
|
||||
|
||||
public void RemoveShortcut(CustomShortcutModel shortcut)
|
||||
|
|
|
|||
Loading…
Reference in a new issue