mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 11:09:28 +08:00
remove tab selection
This commit is contained in:
parent
38cf74d83b
commit
4c21a68139
@ -64,7 +64,7 @@ namespace Wox.Plugin
|
||||
/// <summary>
|
||||
/// Open setting dialog
|
||||
/// </summary>
|
||||
void OpenSettingDialog(int tab = 0);
|
||||
void OpenSettingDialog();
|
||||
|
||||
/// <summary>
|
||||
/// Show loading animation
|
||||
|
@ -102,11 +102,9 @@ namespace Wox
|
||||
open.Click += (o, e) => App.API.ShowApp();
|
||||
var setting = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTraySettings"));
|
||||
setting.Click += (o, e) => App.API.OpenSettingDialog();
|
||||
var about = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTrayAbout"));
|
||||
about.Click += (o, e) => App.API.OpenSettingDialog((int) SettingWindowViewModel.Tab.About);
|
||||
var exit = new MenuItem(InternationalizationManager.Instance.GetTranslation("iconTrayExit"));
|
||||
exit.Click += (o, e) => Close();
|
||||
MenuItem[] childen = { open, setting, about, exit };
|
||||
MenuItem[] childen = { open, setting, exit };
|
||||
_notifyIcon.ContextMenu = new ContextMenu(childen);
|
||||
}
|
||||
|
||||
|
@ -97,11 +97,10 @@ namespace Wox
|
||||
});
|
||||
}
|
||||
|
||||
public void OpenSettingDialog(int tab = 0)
|
||||
public void OpenSettingDialog()
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
_settingsViewModel.SelectedTab = (Tab)tab;
|
||||
SettingWindow sw = SingletonWindowOpener.Open<SettingWindow>(this, _settingsViewModel);
|
||||
});
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="600" Width="800" PreviewKeyDown="Window_PreviewKeyDown"
|
||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
|
||||
<TabControl Height="auto" SelectedIndex="{Binding SelectedTab, FallbackValue=0}">
|
||||
<TabControl Height="auto" SelectedIndex="0">
|
||||
<TabItem Header="{DynamicResource general}" Height="24" VerticalAlignment="Top">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<CheckBox IsChecked="{Binding Settings.StartWoxOnSystemStartup}" Margin="10">
|
||||
|
@ -26,7 +26,6 @@ namespace Wox.ViewModel
|
||||
private readonly JsonStrorage<Settings> _storage;
|
||||
private readonly Dictionary<ISettingProvider, Control> _featureControls = new Dictionary<ISettingProvider, Control>();
|
||||
|
||||
public Tab SelectedTab { get; set; } = Tab.General;
|
||||
#region general
|
||||
public List<Language> Languages => InternationalizationManager.Instance.LoadAvailableLanguages();
|
||||
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);
|
||||
@ -296,15 +295,5 @@ namespace Wox.ViewModel
|
||||
{
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
public enum Tab
|
||||
{
|
||||
General = 0,
|
||||
Plugin = 1,
|
||||
Theme = 2,
|
||||
Hotkey = 3,
|
||||
Proxy = 4,
|
||||
About = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user