From e4d35cab44f278b3f3a82906a55c06a150da0ae5 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Thu, 22 Jun 2023 19:34:06 +0300 Subject: TWin: Add active corner support to quick tiling Signed-off-by: Mavridis Philippe (cherry picked from commit 5b1934dd5dc3245fcfd4a771fd45ed30dcaace54) --- twin/geometry.cpp | 73 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 19 deletions(-) (limited to 'twin/geometry.cpp') 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; -- cgit v1.2.1