feat: 右键图标菜单栏中增加日志悬浮窗切换

This commit is contained in:
uye
2025-12-24 16:09:29 +08:00
parent 1bfc0ad74b
commit 9d0b09356f
7 changed files with 18 additions and 5 deletions

View File

@@ -736,6 +736,7 @@ Do not adjust the proxy multiplier setting in the game</system:String>
<system:String x:Key="ProcessPickerCancel">Cancel</system:String>
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">Left Click: Toggle Log Floating Window
Right Click: Select Target Process</system:String>
<system:String x:Key="ToggleOverlay">Toggle Log Overlay</system:String>
<!-- !Logs -->
<!-- !Farming -->
<system:String x:Key="Toolbox">Toolbox</system:String>

View File

@@ -737,6 +737,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="ProcessPickerCancel">キャンセル</system:String>
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">左クリック:ログフローティングウィンドウの切り替え
右クリック:ターゲットプロセスの選択</system:String>
<system:String x:Key="ToggleOverlay">ログオーバーレイのオン/オフ</system:String>
<!-- !Logs -->
<!-- !動作不明 -->
<system:String x:Key="Toolbox">ツールボックス</system:String>

View File

@@ -738,6 +738,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="ProcessPickerCancel">취소</system:String>
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">왼쪽 클릭: 로그 플로팅 창 전환
오른쪽 클릭: 대상 프로세스 선택</system:String>
<system:String x:Key="ToggleOverlay">로그 오버레이 켜기/끄기</system:String>
<!-- !로그 -->
<!-- !메인 화면 -->
<system:String x:Key="Toolbox">툴박스</system:String>
@@ -1338,7 +1339,7 @@ MAA를 독립된 새 폴더에 압축 해제하거나, MAA에 속하지 않는 D
<system:String x:Key="Achievement.UnexpectedCrash.Title">와장창!</system:String>
<system:String x:Key="Achievement.UnexpectedCrash.Description">으악! 뭔가 엄청난 걸 건드려버렸나 봐요...</system:String>
<system:String x:Key="Achievement.UnexpectedCrash.Conditions">처리되지 않은 예외 발생으로 인한 크래시 로그 기록</system:String>
<system:String x:Key="Achievement.CustomizationMaster.Title">꾸미기 장인</system:String>
<system:String x:Key="Achievement.CustomizationMaster.Description">바꾼 {key=BackgroundImage} 덕분에 화사해졌네요!</system:String>
<system:String x:Key="Achievement.CustomizationMaster.Conditions">{key=BackgroundImage} 1회 변경</system:String>

View File

@@ -735,8 +735,9 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="ProcessPickerRefresh">刷新</system:String>
<system:String x:Key="ProcessPickerConfirm">确定</system:String>
<system:String x:Key="ProcessPickerCancel">取消</system:String>
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">左键:开关日志悬浮窗
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">左键:开/关日志悬浮窗
右键:选择目标进程</system:String>
<system:String x:Key="ToggleOverlay">开/关日志悬浮窗</system:String>
<!-- !日志 -->
<!-- !一键长草 -->
<system:String x:Key="Toolbox">小工具</system:String>

View File

@@ -735,8 +735,9 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="ProcessPickerRefresh">重新整理</system:String>
<system:String x:Key="ProcessPickerConfirm">確定</system:String>
<system:String x:Key="ProcessPickerCancel">取消</system:String>
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">左鍵:開關日誌懸浮窗
<system:String x:Key="ProcessPickerToolTip" xml:space="preserve">左鍵:開/關日誌懸浮窗
右鍵:選擇目標進程</system:String>
<system:String x:Key="ToggleOverlay">開/關日誌懸浮窗</system:String>
<!-- !日誌 -->
<!-- !一鍵長草 -->
<system:String x:Key="Toolbox">小工具</system:String>

View File

@@ -21,6 +21,7 @@
<MenuItem Name="switchLangMenu" Header="{DynamicResource SwitchLanguage}" />
<MenuItem Name="forceShowMenu" Header="{DynamicResource ForceShow}" />
<MenuItem Name="hideTrayMenu" Header="{DynamicResource HideTray}" />
<MenuItem Name="toggleOverlayMenu" Header="{DynamicResource ToggleOverlay}" />
<MenuItem Name="restartMenu" Header="{DynamicResource Restart}" />
<MenuItem Name="exitMenu" Header="{DynamicResource Exit}" />
</ContextMenu>

View File

@@ -42,8 +42,9 @@ public partial class NotifyIcon
InitializeComponent();
uint doubleClickTime = GetDoubleClickTime();
_clickTimer = new(doubleClickTime);
_clickTimer.AutoReset = false;
_clickTimer = new(doubleClickTime) {
AutoReset = false,
};
_clickTimer.Elapsed += (s, e) =>
{
_canClick = true;
@@ -68,6 +69,7 @@ public partial class NotifyIcon
stopMenu.Click += StopTask;
forceShowMenu.Click += ForceShow;
hideTrayMenu.Click += HideTray;
toggleOverlayMenu.Click += ToggleOverlay;
restartMenu.Click += App_restart;
exitMenu.Click += App_exit;
@@ -149,6 +151,11 @@ public partial class NotifyIcon
_logger.Information("Use tray icon: {0}", SettingsViewModel.GuiSettings.UseTray);
}
private static void ToggleOverlay(object sender, RoutedEventArgs e)
{
Instances.TaskQueueViewModel?.ToggleOverlay();
}
private static void App_restart(object sender, RoutedEventArgs e)
{
if (Instances.TaskQueueViewModel.ConfirmExit())