Skip to content

Commit

Permalink
fix(Modules): windowmanager
Browse files Browse the repository at this point in the history
windowmanager
  • Loading branch information
snomiao committed Nov 2, 2024
1 parent ea13c9c commit 61ca5e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
19 changes: 9 additions & 10 deletions Modules/CLX-WindowManager.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion Modules/TomatoLife.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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)"))

Expand Down Expand Up @@ -92,6 +92,7 @@ Return
; MsgBox, 番茄:%番茄状态%

; 状态动作
SendEvent {Media_Play_Pause}
if ("工作时间" == 番茄状态) {
TrayTip % t("番茄时钟:") . %番茄状态%, % t("工作时间到啦!")
SoundPlay % "Data/NoteC_G.mp3" ; 升调
Expand Down

0 comments on commit 61ca5e5

Please sign in to comment.