增加隐藏托盘图标的功能
This commit is contained in:
@@ -17,8 +17,9 @@
|
|||||||
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
<hc:UniformSpacingPanel Spacing="10" Margin="20,0,0,0" Grid.ColumnSpan="4">
|
<hc:UniformSpacingPanel Spacing="10" Margin="20,0,0,0" Grid.ColumnSpan="4">
|
||||||
<TextBlock Text="图片路径:" VerticalAlignment="Center"/>
|
<TextBlock Text="图片路径:" VerticalAlignment="Center" Margin="0,5,0,0"/>
|
||||||
<TextBlock Text="{Binding BacImgName}" Width="200"
|
<TextBlock Text="{Binding BacImgName}" Width="200"
|
||||||
|
Margin="0,5,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
hc:Poptip.HitMode="None"
|
hc:Poptip.HitMode="None"
|
||||||
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
|
||||||
@@ -39,6 +40,16 @@
|
|||||||
</CheckBox>
|
</CheckBox>
|
||||||
</hc:UniformSpacingPanel>
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
|
<hc:UniformSpacingPanel Spacing="10" Margin="20,5,0,0" Grid.ColumnSpan="4">
|
||||||
|
<CheckBox x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}">
|
||||||
|
<CheckBox.Background>
|
||||||
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||||
|
<GradientStop Color="#FF9EA3A6"/>
|
||||||
|
</LinearGradientBrush>
|
||||||
|
</CheckBox.Background>
|
||||||
|
</CheckBox>
|
||||||
|
</hc:UniformSpacingPanel>
|
||||||
|
|
||||||
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
|
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
|
||||||
|
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|||||||
@@ -119,10 +119,12 @@
|
|||||||
|
|
||||||
<uc:RightCardControl Grid.Row="1" Grid.Column="1"/>
|
<uc:RightCardControl Grid.Row="1" Grid.Column="1"/>
|
||||||
|
|
||||||
<hc:NotifyIcon Icon="/Taskbar.ico" Text="GeekDesk" Click="NotifyIcon_Click">
|
<hc:NotifyIcon Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
|
||||||
|
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
|
||||||
<hc:NotifyIcon.ContextMenu>
|
<hc:NotifyIcon.ContextMenu>
|
||||||
<ContextMenu Width="130">
|
<ContextMenu Width="130">
|
||||||
<MenuItem Header="打开面板" Click="ShowApp"/>
|
<MenuItem Header="打开面板" Click="ShowApp"/>
|
||||||
|
<MenuItem Header="关闭托盘图标" Click="CloseBarIcon"/>
|
||||||
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
<MenuItem Header="待办" Click="BacklogMenuClick"/>
|
||||||
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
<MenuItem Header="程序目录" Click="OpenThisDir"/>
|
||||||
<MenuItem Header="设置" Click="ConfigApp"/>
|
<MenuItem Header="设置" Click="ConfigApp"/>
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ namespace GeekDesk
|
|||||||
ShowApp();
|
ShowApp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BarIcon.Text = Constants.MY_NAME;
|
||||||
|
|
||||||
//注册热键
|
//注册热键
|
||||||
RegisterHotKey(true);
|
RegisterHotKey(true);
|
||||||
RegisterCreateToDoHotKey(true);
|
RegisterCreateToDoHotKey(true);
|
||||||
@@ -510,6 +512,16 @@ namespace GeekDesk
|
|||||||
p.Start();
|
p.Start();
|
||||||
Application.Current.Shutdown();
|
Application.Current.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关闭托盘图标
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void CloseBarIcon(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
appData.AppConfig.ShowBarIcon = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,22 @@ namespace GeekDesk.ViewModel
|
|||||||
|
|
||||||
private bool mouseMiddleShow = false; //鼠标中键呼出 默认不启用
|
private bool mouseMiddleShow = false; //鼠标中键呼出 默认不启用
|
||||||
|
|
||||||
|
private bool showBarIcon = true; //显示托盘图标 默认显示
|
||||||
|
|
||||||
#region GetSet
|
#region GetSet
|
||||||
|
public bool ShowBarIcon
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return showBarIcon;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
showBarIcon = value;
|
||||||
|
OnPropertyChanged("ShowBarIcon");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool MouseMiddleShow
|
public bool MouseMiddleShow
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
Reference in New Issue
Block a user