添加单实例限制、应用图标、移除托盘设置菜单、快捷键暂停/恢复功能

单实例限制:通过命名Mutex和窗口消息广播确保只能运行一个实例,再次启动时唤起已有窗口

应用图标:exe文件嵌入app.ico,托盘和窗口图标统一使用该图标文件

移除托盘右键菜单中与显示主界面重复的设置选项

快捷键暂停/恢复:托盘菜单和主界面侧边栏均添加切换按钮,通过MainViewModel.IsHotKeyEnabled双向同步
This commit is contained in:
2026-05-10 14:10:52 +08:00
parent b715904439
commit f33c89d2c4
8 changed files with 116 additions and 26 deletions

View File

@@ -178,6 +178,7 @@
<RowDefinition Height="42"/>
<RowDefinition Height="42"/>
<RowDefinition Height="45"/>
<RowDefinition Height="45"/>
</Grid.RowDefinitions>
<ListBox Grid.Row="0"
@@ -277,7 +278,7 @@
BorderBrush="{DynamicResource Theme.CardBorder}"
Foreground="{DynamicResource Theme.Foreground}"
FontSize="12"
Height="35" Margin="10,0,10,10"
Height="35" Margin="10,0,10,3"
Cursor="Hand">
<StackPanel Orientation="Horizontal">
<TextBlock Text="◐" FontSize="16" Margin="0,0,8,0"
@@ -285,6 +286,28 @@
<TextBlock Text="切换主题" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<Button Grid.Row="4"
Command="{Binding ToggleHotKeyCommand}"
Background="Transparent"
BorderThickness="1"
BorderBrush="{DynamicResource Theme.CardBorder}"
Foreground="{DynamicResource Theme.Foreground}"
FontSize="12"
Height="35" Margin="10,0,10,10"
Cursor="Hand">
<Button.Resources>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="⏸ 暂停快捷键"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsHotKeyEnabled}" Value="False">
<Setter Property="Text" Value="▶ 恢复快捷键"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Resources>
<TextBlock VerticalAlignment="Center" TextAlignment="Center"/>
</Button>
</Grid>
</Border>