diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2023-06-22 19:34:06 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2023-07-04 15:28:28 +0300 |
commit | e4d35cab44f278b3f3a82906a55c06a150da0ae5 (patch) | |
tree | e73ccdea23e05fd5fd369ded0af9e7793ed76caa /twin/geometry.cpp | |
parent | 87b9269efb6aa965c1979972be7bdb045ef1ea58 (diff) | |
download | tdebase-e4d35cab44f278b3f3a82906a55c06a150da0ae5.tar.gz tdebase-e4d35cab44f278b3f3a82906a55c06a150da0ae5.zip |
TWin: Add active corner support to quick tiling
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 5b1934dd5dc3245fcfd4a771fd45ed30dcaace54)
Diffstat (limited to 'twin/geometry.cpp')
-rw-r--r-- | twin/geometry.cpp | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/twin/geometry.cpp b/twin/geometry.cpp index 7dd38bee2..fc5f919cf 100644 --- a/twin/geometry.cpp +++ b/twin/geometry.cpp @@ -2718,6 +2718,14 @@ ActiveMaximizingMode Client::activeBorderMode() const return activeMode; } +void Client::setActiveBorder(ActiveBorder border) { + currentActiveBorder = border; +} + +ActiveBorder Client::activeBorder() const { + return currentActiveBorder; +} + bool Client::isActiveBorderMaximizing() const { return activeMaximizing; @@ -2740,7 +2748,7 @@ TQRect Client::activeBorderMaximizeGeometry() { TQRect ret; TQRect max = workspace()->clientArea(MaximizeArea, TQCursor::pos(), workspace()->currentDesktop()); - switch (activeMode) + switch (activeBorderMode()) { case ActiveMaximizeMode: { @@ -2750,25 +2758,52 @@ TQRect Client::activeBorderMaximizeGeometry() ret = max; break; } - case ActiveLeftMode: - { - ret = TQRect( max.x(), max.y(), max.width()/2, max.height() ); - break; - } - case ActiveRightMode: - { - ret = TQRect( max.x() + max.width()/2, max.y(), max.width()/2, max.height() ); - break; - } - case ActiveTopMode: - { - ret = TQRect( max.x(), max.y(), max.width(), max.height()/2 ); - break; - } - case ActiveBottomMode: + + case ActiveTilingMode: { - ret = TQRect( max.x(), max.y() + max.height()/2, max.width(), max.height()/2 ); - break; + switch (activeBorder()) + { + case ActiveLeft: + { + ret = TQRect( max.x(), max.y(), max.width()/2, max.height() ); + break; + } + case ActiveRight: + { + ret = TQRect( max.x() + max.width()/2, max.y(), max.width()/2, max.height() ); + break; + } + case ActiveTop: + { + ret = TQRect( max.x(), max.y(), max.width(), max.height()/2 ); + break; + } + case ActiveBottom: + { + ret = TQRect( max.x(), max.y() + max.height()/2, max.width(), max.height()/2 ); + break; + } + case ActiveTopLeft: + { + ret = TQRect( max.x(), max.y(), max.width()/2, max.height()/2 ); + break; + } + case ActiveTopRight: + { + ret = TQRect( max.x() + max.width()/2, max.y(), max.width()/2, max.height()/2 ); + break; + } + case ActiveBottomLeft: + { + ret = TQRect( max.x(), max.y() + max.height()/2, max.width()/2, max.height()/2 ); + break; + } + case ActiveBottomRight: + { + ret = TQRect( max.x() + max.width()/2, max.y() + max.height()/2, max.width()/2, max.height()/2); + break; + } + } } } return ret; |