From 61ca5e5485907821fc4b285048aca66a1fb67d2c Mon Sep 17 00:00:00 2001 From: snomiao Date: Sat, 2 Nov 2024 10:01:58 +0900 Subject: [PATCH] fix(Modules): windowmanager windowmanager --- Modules/CLX-WindowManager.ahk | 19 +++++++++---------- Modules/TomatoLife.ahk | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Modules/CLX-WindowManager.ahk b/Modules/CLX-WindowManager.ahk index e664da1..9d16d22 100644 --- a/Modules/CLX-WindowManager.ahk +++ b/Modules/CLX-WindowManager.ahk @@ -347,12 +347,12 @@ ArrangeWindows(arrangeFlags = "0") { arrangeFlags += 0 ; string to number SysGet, MonitorCount, MonitorCount - ; 列出每个显示器内的窗口 + ; "List the windows within each monitor." 列出每个显示器内的窗口 loop %MonitorCount% { MonitorIndex := A_Index listOfWindow_%MonitorIndex% := WindowsListOfMonitorInCurrentDesktop(arrangeFlags, MonitorIndex) } - ; 位置调整 + ; 位置调整 Position Adjust loop %MonitorCount% { MonitorIndex := A_Index if (arrangeFlags & ARRANGE_STACKED) { @@ -361,7 +361,7 @@ ArrangeWindows(arrangeFlags = "0") ArrangeWindowsSideBySide(listOfWindow_%MonitorIndex%, arrangeFlags | ARRANGE_MOVING, MonitorIndex) } } - ; Z_Order 调整 + ; Z_Order Adjust Z_Order 调整 loop %MonitorCount% { MonitorIndex := A_Index if (arrangeFlags & ARRANGE_STACKED) { @@ -473,11 +473,7 @@ ArrangeWindowsSideBySide(listOfWindow, arrangeFlags = "0", MonitorIndex = "") } } ArrangeWindowsStacked(listOfWindow, arrangeFlags = "0", MonitorIndex = "") -{ - - dx := 96 - dy := 96 - +{ arrangeFlags += 0 ; string to number n := StrSplit(listOfWindow, "`n", "`r").Count() - 1 ; try parse work rect from monitor @@ -493,11 +489,14 @@ ArrangeWindowsStacked(listOfWindow, arrangeFlags = "0", MonitorIndex = "") AreaW := MonitorWorkAreaRight - MonitorWorkAreaLeft AreaH := MonitorWorkAreaBottom - MonitorWorkAreaTop } + + dx := Min(48, AreaW / n - 4 * AreaX) + dy := Min(48, AreaH / n - 4 * AreaY) if (arrangeFlags & ARRANGE_MOVING) { k := 0 - w := AreaW - 2 * dx - n * dx + dx - h := AreaH - 2 * dy - n * dy + dy + w := Max(AreaW/2, (AreaW - 2 * dx - n * dx + dx)) + h := Max(AreaH/2, (AreaH - 2 * dy - n * dy + dy)) lasthWnd := -2 loop, Parse, listOfWindow, `n { diff --git a/Modules/TomatoLife.ahk b/Modules/TomatoLife.ahk index ebc025b..02fb6d8 100644 --- a/Modules/TomatoLife.ahk +++ b/Modules/TomatoLife.ahk @@ -8,7 +8,7 @@ ; ========== CapsLockX ========== global T_TomatoLife := CLX_Config("TomatoLife", "Enable", 0, t("使用番茄时钟(默认禁用,改为 1 开启)")) -global T_TomatoLife_NoticeOnLaunch := CLX_Config("TomatoLife", "NoticeOnLaunch", 1, t("启动时报告番茄状态")) +global T_TomatoLife_NoticeOnLaunch := CLX_Config("TomatoLife", "NoticeOnLaunch", 0, t("启动时报告番茄状态")) global T_TomatoLife_UseTomatoLifeSound := CLX_Config("TomatoLife", "UseTomatoLifeSound", 1, t("使用番茄报时(00分和30分播放工作铃声,每小时的25分和55分播放休息铃声)(需要先开启番茄时钟)")) global T_TomatoLife_UseTomatoLifeSwitchVirtualDesktop := CLX_Config("TomatoLife", "UseTomatoLifeSwitchVirtualDesktop", 1, t("使用番茄报时时,自动切换桌面(休息为桌面1,工作为桌面2)")) @@ -92,6 +92,7 @@ Return ; MsgBox, 番茄:%番茄状态% ; 状态动作 + SendEvent {Media_Play_Pause} if ("工作时间" == 番茄状态) { TrayTip % t("番茄时钟:") . %番茄状态%, % t("工作时间到啦!") SoundPlay % "Data/NoteC_G.mp3" ; 升调