- add option to hide main window on startup
- Fixed #586
This commit is contained in:
xzhao 2016-05-14 21:48:58 +08:00 committed by bao-qian
parent 67ab979a9b
commit 87497d2d09
6 changed files with 18 additions and 1 deletions

View File

@ -44,6 +44,7 @@ namespace Wox.Core.UserSettings
public bool EnableUpdateLog { get; set; }
public bool StartWoxOnSystemStartup { get; set; }
public bool HideOnStartup { get; set; }
public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactive { get; set; }
public bool RememberLastLaunchLocation { get; set; }

View File

@ -18,6 +18,7 @@
<system:String x:Key="wox_settings">Wox Settings</system:String>
<system:String x:Key="general">General</system:String>
<system:String x:Key="startWoxOnSystemStartup">Start Wox on system startup</system:String>
<system:String x:Key="hideOnStartup">Hide Wox on startup</system:String>
<system:String x:Key="hideWoxWhenLoseFocus">Hide Wox when loses focus</system:String>
<system:String x:Key="dontPromptUpdateMsg">Don't show upgrade msg if new version available</system:String>
<system:String x:Key="rememberLastLocation">Remember last launch location</system:String>

View File

@ -18,6 +18,7 @@
<system:String x:Key="woxsettings">Wox设置</system:String>
<system:String x:Key="general">通用</system:String>
<system:String x:Key="startWoxOnSystemStartup">开机启动</system:String>
<system:String x:Key="hideOnStartup">启动时不显示主窗口</system:String>
<system:String x:Key="hideWoxWhenLoseFocus">失去焦点时自动隐藏Wox</system:String>
<system:String x:Key="dontPromptUpdateMsg">不显示新版本提示</system:String>
<system:String x:Key="rememberLastLocation">记住上次启动位置</system:String>

View File

@ -65,7 +65,7 @@ namespace Wox
// happlebao todo delete
vm.Left = GetWindowsLeft();
vm.Top = GetWindowsTop();
vm.MainWindowVisibility = Visibility.Visible;
vm.MainWindowVisibility = _settings.HideOnStartup ? Visibility.Hidden : Visibility.Visible;
}
private void RegisterEvents(MainViewModel vm)

View File

@ -25,6 +25,9 @@
Checked="CbStartWithWindows_OnChecked" Margin="10">
<TextBlock Text="{DynamicResource startWoxOnSystemStartup}" />
</CheckBox>
<CheckBox x:Name="cbHideOnStartup" Margin="10">
<TextBlock Text="{DynamicResource hideOnStartup}" />
</CheckBox>
<CheckBox x:Name="cbHideWhenDeactive" Margin="10">
<TextBlock Text="{DynamicResource hideWoxWhenLoseFocus}" />
</CheckBox>

View File

@ -54,6 +54,16 @@ namespace Wox
{
#region General
cbHideOnStartup.Checked += (o, e) =>
{
_settings.HideOnStartup = true;
};
cbHideOnStartup.Unchecked += (o, e) =>
{
_settings.HideOnStartup = false;
};
cbHideWhenDeactive.Checked += (o, e) =>
{
_settings.HideWhenDeactive = true;
@ -114,6 +124,7 @@ namespace Wox
//MainWindow.pnlResult.lbResults.GetBindingExpression(MaxHeightProperty).UpdateTarget();
};
cbHideOnStartup.IsChecked = _settings.HideOnStartup;
cbHideWhenDeactive.IsChecked = _settings.HideWhenDeactive;
cbDontPromptUpdateMsg.IsChecked = _settings.DontPromptUpdateMsg;
cbRememberLastLocation.IsChecked = _settings.RememberLastLaunchLocation;