mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
hide tray icon (close #563)
This commit is contained in:
@@ -44,6 +44,16 @@ namespace Wox.Infrastructure.UserSettings
|
|||||||
|
|
||||||
public bool StartWoxOnSystemStartup { get; set; } = true;
|
public bool StartWoxOnSystemStartup { get; set; } = true;
|
||||||
public bool HideOnStartup { get; set; }
|
public bool HideOnStartup { get; set; }
|
||||||
|
bool _hideNotifyIcon { get; set; }
|
||||||
|
public bool HideNotifyIcon
|
||||||
|
{
|
||||||
|
get { return _hideNotifyIcon; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_hideNotifyIcon = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool LeaveCmdOpen { get; set; }
|
public bool LeaveCmdOpen { get; set; }
|
||||||
public bool HideWhenDeactive { get; set; }
|
public bool HideWhenDeactive { get; set; }
|
||||||
public bool RememberLastLaunchLocation { get; set; }
|
public bool RememberLastLaunchLocation { get; set; }
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<system:String x:Key="autoUpdates">Auto Update</system:String>
|
<system:String x:Key="autoUpdates">Auto Update</system:String>
|
||||||
<system:String x:Key="selectPythonDirectory">Select</system:String>
|
<system:String x:Key="selectPythonDirectory">Select</system:String>
|
||||||
<system:String x:Key="hideOnStartup">Hide Wox on startup</system:String>
|
<system:String x:Key="hideOnStartup">Hide Wox on startup</system:String>
|
||||||
|
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
|
||||||
|
|
||||||
<!--Setting Plugin-->
|
<!--Setting Plugin-->
|
||||||
<system:String x:Key="plugin">Plugin</system:String>
|
<system:String x:Key="plugin">Plugin</system:String>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<system:String x:Key="autoUpdates">自动更新</system:String>
|
<system:String x:Key="autoUpdates">自动更新</system:String>
|
||||||
<system:String x:Key="selectPythonDirectory">Select</system:String>
|
<system:String x:Key="selectPythonDirectory">Select</system:String>
|
||||||
<system:String x:Key="hideOnStartup">启动时不显示主窗口</system:String>
|
<system:String x:Key="hideOnStartup">启动时不显示主窗口</system:String>
|
||||||
|
<system:String x:Key="hideNotifyIcon">隐藏任务栏图标</system:String>
|
||||||
|
|
||||||
<!--设置,插件-->
|
<!--设置,插件-->
|
||||||
<system:String x:Key="plugin">插件</system:String>
|
<system:String x:Key="plugin">插件</system:String>
|
||||||
|
|||||||
@@ -85,6 +85,13 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
_settings.PropertyChanged += (o, e) =>
|
||||||
|
{
|
||||||
|
if (e.PropertyName == nameof(Settings.HideNotifyIcon))
|
||||||
|
{
|
||||||
|
_notifyIcon.Visible = !_settings.HideNotifyIcon;
|
||||||
|
}
|
||||||
|
};
|
||||||
InitializePosition();
|
InitializePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +109,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
Text = Infrastructure.Constant.Wox,
|
Text = Infrastructure.Constant.Wox,
|
||||||
Icon = Properties.Resources.app,
|
Icon = Properties.Resources.app,
|
||||||
Visible = true
|
Visible = !_settings.HideNotifyIcon
|
||||||
};
|
};
|
||||||
var menu = new ContextMenuStrip();
|
var menu = new ContextMenuStrip();
|
||||||
var items = menu.Items;
|
var items = menu.Items;
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
<CheckBox Margin="10" IsChecked="{Binding Settings.HideWhenDeactive}">
|
<CheckBox Margin="10" IsChecked="{Binding Settings.HideWhenDeactive}">
|
||||||
<TextBlock Text="{DynamicResource hideWoxWhenLoseFocus}" />
|
<TextBlock Text="{DynamicResource hideWoxWhenLoseFocus}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
<CheckBox Margin="10" IsChecked="{Binding Settings.HideNotifyIcon}">
|
||||||
|
<TextBlock Text="{DynamicResource hideNotifyIcon}" />
|
||||||
|
</CheckBox>
|
||||||
<CheckBox Margin="10" IsChecked="{Binding Settings.RememberLastLaunchLocation}">
|
<CheckBox Margin="10" IsChecked="{Binding Settings.RememberLastLaunchLocation}">
|
||||||
<TextBlock Text="{DynamicResource rememberLastLocation}" />
|
<TextBlock Text="{DynamicResource rememberLastLocation}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
|
|||||||
Reference in New Issue
Block a user