Add hotkey setting

This commit is contained in:
qianlifeng
2014-02-22 11:55:48 +08:00
parent efdd8daa01
commit 2f5a4f63b6
11 changed files with 208 additions and 130 deletions

View File

@@ -31,6 +31,8 @@ namespace Wox
this.mainWindow = mainWindow;
InitializeComponent();
Loaded += Setting_Loaded;
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
ctlHotkey.SetHotkey(CommonStorage.Instance.UserSetting.Hotkey);
cbReplaceWinR.Checked += (o, e) =>
{
CommonStorage.Instance.UserSetting.ReplaceWinR = true;
@@ -43,6 +45,16 @@ namespace Wox
};
}
void ctlHotkey_OnHotkeyChanged(object sender, System.EventArgs e)
{
if (ctlHotkey.CurrentHotkeyAvailable)
{
mainWindow.SetHotkey(ctlHotkey.CurrentHotkey.ToString());
CommonStorage.Instance.UserSetting.Hotkey = ctlHotkey.CurrentHotkey.ToString();
CommonStorage.Instance.Save();
}
}
private void Setting_Loaded(object sender, RoutedEventArgs e)
{
foreach (string theme in LoadAvailableThemes())