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