diff --git a/doc/CHANGES.md b/doc/CHANGES.md index cb657a5..48b096f 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -9,11 +9,14 @@ ### 9.0.0 1. `~` Renamed the function `Manager_toggleDecor` to `Window_toggleDecor` +2. `~` Renamed the function `View_toggleFloating` to `View_toggleFloatingWindow` -| # | Configuration variables | Hotkeys | -| --:| ----------------------- | -------------------------------- | -| 1. | | `-` `#+d::Manager_toggleDecor()` | -| | | `+` `#+d::Window_toggleDecor()` | +| # | Configuration variables | Hotkeys | +| --:| ----------------------- | -------------------------------------- | +| 1. | | `-` `#+d::Manager_toggleDecor()` | +| | | `+` `#+d::Window_toggleDecor()` | +| 2. | | `-` `#+f::View_toggleFloating()` | +| | | `+` `#+f::View_toggleFloatingWindow()` | ### 8.4.0 diff --git a/doc/Default_hotkeys.md b/doc/Default_hotkeys.md index ee49dda..153319e 100644 --- a/doc/Default_hotkeys.md +++ b/doc/Default_hotkeys.md @@ -39,7 +39,7 @@ quitting bug.n. `#+d::Window_toggleDecor()` > Show / Hide the title bar of the active window. -`#+f::View_toggleFloating()` +`#+f::View_toggleFloatingWindow()` > Toggle the floating status of the active window (i. e. dis- / regard it when tiling). diff --git a/src/Config.ahk b/src/Config.ahk index e6616e8..d1ca31b 100644 --- a/src/Config.ahk +++ b/src/Config.ahk @@ -392,7 +392,7 @@ Config_saveSession(original, target) #+Enter::View_shuffleWindow(0) #c::Manager_closeWindow() #+d::Window_toggleDecor() -#+f::View_toggleFloating() +#+f::View_toggleFloatingWindow() #+m::Manager_moveWindow() #+s::Manager_sizeWindow() #+x::Manager_maximizeWindow() diff --git a/src/Manager.ahk b/src/Manager.ahk index e90fc6e..5be9672 100644 --- a/src/Manager.ahk +++ b/src/Manager.ahk @@ -436,29 +436,23 @@ Manager_manage(preferredMonitor, preferredView, wndId) Return, a } -Manager_maximizeWindow() -{ - Local aWndId, l, v +Manager_maximizeWindow() { + Local aWndId WinGet, aWndId, ID, A - v := Monitor_#%Manager_aMonitor%_aView_#1 - l := View_#%Manager_aMonitor%_#%v%_layout_#1 - If Not Window_#%aWndId%_isFloating And Not (Config_layoutFunction_#%l% = "") - View_toggleFloating() + If Not Window_#%aWndId%_isFloating + View_toggleFloatingWindow(aWndId) Window_set(aWndId, "Top", "") Window_move(aWndId, Monitor_#%Manager_aMonitor%_x, Monitor_#%Manager_aMonitor%_y, Monitor_#%Manager_aMonitor%_width, Monitor_#%Manager_aMonitor%_height) } -Manager_moveWindow() -{ - Local aWndId, l, SC_MOVE, v, WM_SYSCOMMAND +Manager_moveWindow() { + Local aWndId, SC_MOVE, WM_SYSCOMMAND WinGet, aWndId, ID, A - v := Monitor_#%Manager_aMonitor%_aView_#1 - l := View_#%Manager_aMonitor%_#%v%_layout_#1 - If Not Window_#%aWndId%_isFloating And Not (Config_layoutFunction_#%l% = "") - View_toggleFloating() + If Not Window_#%aWndId%_isFloating + View_toggleFloatingWindow(aWndId) Window_set(aWndId, "Top", "") WM_SYSCOMMAND = 0x112 @@ -824,15 +818,12 @@ Manager_setWindowMonitor(d) } } -Manager_sizeWindow() -{ - Local aWndId, l, SC_SIZE, v, WM_SYSCOMMAND +Manager_sizeWindow() { + Local aWndId, SC_SIZE, WM_SYSCOMMAND WinGet, aWndId, ID, A - v := Monitor_#%Manager_aMonitor%_aView_#1 - l := View_#%Manager_aMonitor%_#%v%_layout_#1 - If Not Window_#%aWndId%_isFloating And Not (Config_layoutFunction_#%l% = "") - View_toggleFloating() + If Not Window_#%aWndId%_isFloating + View_toggleFloatingWindow(aWndId) Window_set(aWndId, "Top", "") WM_SYSCOMMAND = 0x112 diff --git a/src/View.ahk b/src/View.ahk index f11e6f4..cd8da3f 100644 --- a/src/View.ahk +++ b/src/View.ahk @@ -726,16 +726,15 @@ View_stackWindows(arrayName, startPos, len, d, axis, x, y, w, h, padding) } } -View_toggleFloating() -{ - Local aWndId, l, v +View_toggleFloatingWindow(wndId = 0) { + Local l, v - WinGet, aWndId, ID, A + If (wndId = 0) + WinGet, wndId, ID, A v := Monitor_#%Manager_aMonitor%_aView_#1 l := View_#%Manager_aMonitor%_#%v%_layout_#1 - If (Config_layoutFunction_#%l% And InStr(Manager_managedWndIds, aWndId ";")) - { - Window_#%aWndId%_isFloating := Not Window_#%aWndId%_isFloating + If (Config_layoutFunction_#%l% And InStr(Manager_managedWndIds, wndId ";")) { + Window_#%wndId%_isFloating := Not Window_#%wndId%_isFloating View_arrange(Manager_aMonitor, v) Bar_updateTitle() }