Refactoring.

This commit is contained in:
qianlifeng
2014-12-27 12:34:51 +08:00
parent ccc8d7e5cd
commit d9b2863382
14 changed files with 184 additions and 148 deletions

View File

@@ -172,8 +172,7 @@ namespace Wox
}
//PreviewPanel
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
#endregion
#region Plugin
@@ -366,7 +365,7 @@ namespace Wox
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
string themeName = themeComboBox.SelectedItem.ToString();
MainWindow.SetTheme(themeName);
ThemeManager.ChangeTheme(themeName);
UserSettingStorage.Instance.Theme = themeName;
UserSettingStorage.Instance.Save();
}
@@ -379,7 +378,7 @@ namespace Wox
this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
UserSettingStorage.Instance.Save();
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
}
private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -399,7 +398,7 @@ namespace Wox
UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString();
UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString();
UserSettingStorage.Instance.Save();
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
}
}
@@ -411,7 +410,7 @@ namespace Wox
this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
UserSettingStorage.Instance.Save();
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
}
private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -422,8 +421,6 @@ namespace Wox
{
if (cbResultItemFontFaces.Items.Count > 0)
cbResultItemFontFaces.SelectedIndex = 0;
return;
}
else
{
@@ -431,7 +428,7 @@ namespace Wox
UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString();
UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString();
UserSettingStorage.Instance.Save();
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
}
}
@@ -445,7 +442,7 @@ namespace Wox
else
PreviewMainPanel.Opacity = 1;
App.Window.SetTheme(UserSettingStorage.Instance.Theme);
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
}
#endregion