From 049582536ab4c6338c3c45d954808849e9cee5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 25 Sep 2012 22:26:35 +0200 Subject: [PATCH] Fix enabled borders and padding for maximized Aurorae decos In the maximized state the enabled borders were still enabled causing the actual borders to be still shown. In addition the padding is not adjusted to be 0. This is done in the C++ part is it does not make any sense to have shadows being thrown to another screen for a maximized window. REVIEW: 106576 BUG: 307365 FIXED-IN: 4.9.2 --- clients/aurorae/src/aurorae.cpp | 4 ++++ clients/aurorae/src/qml/AuroraeButtonGroup.qml | 2 +- clients/aurorae/src/qml/aurorae.qml | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 4277b65bef..6053b85c91 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -313,6 +313,10 @@ void AuroraeClient::padding(int &left, int &right, int &top, int &bottom) const left = right = top = bottom = 0; return; } + if (maximizeMode() == MaximizeFull && !options()->moveResizeMaximizedWindows()) { + left = right = top = bottom = 0; + return; + } left = m_item->property("paddingLeft").toInt(); right = m_item->property("paddingRight").toInt(); top = m_item->property("paddingTop").toInt(); diff --git a/clients/aurorae/src/qml/AuroraeButtonGroup.qml b/clients/aurorae/src/qml/AuroraeButtonGroup.qml index 89916f07f4..7c1bebe318 100644 --- a/clients/aurorae/src/qml/AuroraeButtonGroup.qml +++ b/clients/aurorae/src/qml/AuroraeButtonGroup.qml @@ -50,7 +50,7 @@ Item { } anchors { top: parent.top - topMargin: (decoration.maximized ? auroraeTheme.titleEdgeTopMaximized : auroraeTheme.titleEdgeTop) + root.paddingTop + auroraeTheme.buttonMarginTop + topMargin: (decoration.maximized ? auroraeTheme.titleEdgeTopMaximized : auroraeTheme.titleEdgeTop + root.paddingTop) + auroraeTheme.buttonMarginTop } Behavior on anchors.topMargin { NumberAnimation { diff --git a/clients/aurorae/src/qml/aurorae.qml b/clients/aurorae/src/qml/aurorae.qml index acd6d7aa37..ad107a6322 100644 --- a/clients/aurorae/src/qml/aurorae.qml +++ b/clients/aurorae/src/qml/aurorae.qml @@ -47,6 +47,7 @@ Decoration { imagePath: backgroundSvg.imagePath prefix: "decoration" opacity: shown ? 1 : 0 + enabledBorders: decoration.maximized ? PlasmaCore.FrameSvg.NoBorder : PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime @@ -59,6 +60,7 @@ Decoration { imagePath: backgroundSvg.imagePath prefix: "decoration-inactive" opacity: (!decoration.active && backgroundSvg.supportsInactive) ? 1 : 0 + enabledBorders: decoration.maximized ? PlasmaCore.FrameSvg.NoBorder : PlasmaCore.FrameSvg.TopBorder | PlasmaCore.FrameSvg.BottomBorder | PlasmaCore.FrameSvg.LeftBorder | PlasmaCore.FrameSvg.RightBorder Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime @@ -80,6 +82,7 @@ Decoration { prefix: "decoration-maximized" height: parent.borderTopMaximized opacity: shown ? 1 : 0 + enabledBorders: PlasmaCore.FrameSvg.NoBorder Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime @@ -100,6 +103,7 @@ Decoration { prefix: "decoration-maximized-inactive" height: parent.borderTopMaximized opacity: (!decoration.active && decoration.maximized && backgroundSvg.supportsMaximizedInactive) ? 1 : 0 + enabledBorders: PlasmaCore.FrameSvg.NoBorder Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime @@ -112,7 +116,7 @@ Decoration { width: childrenRect.width anchors { left: parent.left - leftMargin: (decoration.maximized ? auroraeTheme.titleEdgeLeftMaximized : auroraeTheme.titleEdgeLeft) + root.paddingLeft + leftMargin: decoration.maximized ? auroraeTheme.titleEdgeLeftMaximized : (auroraeTheme.titleEdgeLeft + root.paddingLeft) } Behavior on anchors.leftMargin { NumberAnimation { @@ -126,7 +130,7 @@ Decoration { width: childrenRect.width anchors { right: parent.right - rightMargin: (decoration.maximized ? auroraeTheme.titleEdgeRightMaximized : auroraeTheme.titleEdgeRight) + root.paddingRight + rightMargin: decoration.maximized ? auroraeTheme.titleEdgeRightMaximized : (auroraeTheme.titleEdgeRight + root.paddingRight) } Behavior on anchors.rightMargin { NumberAnimation { @@ -148,7 +152,7 @@ Decoration { left: leftButtonGroup.right right: rightButtonGroup.left top: root.top - topMargin: (decoration.maximized ? auroraeTheme.titleEdgeTopMaximized : auroraeTheme.titleEdgeTop) + root.paddingTop + topMargin: decoration.maximized ? auroraeTheme.titleEdgeTopMaximized : (auroraeTheme.titleEdgeTop + root.paddingTop) leftMargin: auroraeTheme.titleBorderLeft rightMargin: auroraeTheme.titleBorderRight }