Resolve conflicts in SettingsPaneHotkey.xaml.cs

This commit is contained in:
Jack251970 2025-10-05 19:45:06 +08:00
parent d36b8b2851
commit a64bed34fe

View file

@ -10,6 +10,7 @@ using Flow.Launcher.Plugin;
using Flow.Launcher.Resources.Controls; using Flow.Launcher.Resources.Controls;
using Flow.Launcher.SettingPages.ViewModels; using Flow.Launcher.SettingPages.ViewModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using iNKORE.UI.WPF.Modern.Controls;
namespace Flow.Launcher.SettingPages.Views; namespace Flow.Launcher.SettingPages.Views;
@ -50,9 +51,9 @@ public partial class SettingsPaneHotkey
var allHotkeyInvisible = hotkeyInfo.All(h => !h.Visible); var allHotkeyInvisible = hotkeyInfo.All(h => !h.Visible);
if (allHotkeyInvisible) continue; if (allHotkeyInvisible) continue;
var excard = new ExCard() var excard = new SettingsExpander()
{ {
Title = metadata.Name, Header = metadata.Name,
Margin = new Thickness(0, 4, 0, 0), Margin = new Thickness(0, 4, 0, 0),
}; };
var hotkeyStackPanel = new StackPanel var hotkeyStackPanel = new StackPanel
@ -66,12 +67,11 @@ public partial class SettingsPaneHotkey
// Skip invisible hotkeys // Skip invisible hotkeys
if (!hotkey.Visible) continue; if (!hotkey.Visible) continue;
var card = new Card() var card = new SettingsCard()
{ {
Title = hotkey.Name, Header = hotkey.Name,
Sub = hotkey.Description, Description = hotkey.Description,
Icon = hotkey.Glyph.Glyph, HeaderIcon = new FontIcon() { Glyph = hotkey.Glyph.Glyph }
Type = Card.CardType.Inside
}; };
var hotkeySetting = metadata.PluginHotkeys.Find(h => h.Id == hotkey.Id)?.Hotkey ?? hotkey.DefaultHotkey; var hotkeySetting = metadata.PluginHotkeys.Find(h => h.Id == hotkey.Id)?.Hotkey ?? hotkey.DefaultHotkey;
if (hotkey.Editable) if (hotkey.Editable)
@ -83,9 +83,9 @@ public partial class SettingsPaneHotkey
HotkeyControl.HotkeyType.WindowPluginHotkey, HotkeyControl.HotkeyType.WindowPluginHotkey,
DefaultHotkey = hotkey.DefaultHotkey, DefaultHotkey = hotkey.DefaultHotkey,
ValidateKeyGesture = false, ValidateKeyGesture = false,
Hotkey = hotkeySetting Hotkey = hotkeySetting,
ChangeHotkey = new RelayCommand<HotkeyModel>((h) => ChangePluginHotkey(metadata, hotkey, h))
}; };
hotkeyControl.ChangeHotkey = new RelayCommand<HotkeyModel>((h) => ChangePluginHotkey(metadata, hotkey, h));
card.Content = hotkeyControl; card.Content = hotkeyControl;
} }
else else