From 558e35757577dbe79c5f8995185e32453cb3da9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 7 Jul 2014 08:38:41 +0200 Subject: [PATCH] [aurorae] Fix MaximizeRestore Button of Aurorae Themes Seems like porting to new infrastructure was incomplete. The MaximizeRestore button consists of two buttons on top of each other with an own mouse area in each and both always visible. This means the restore button was stealing the mouse events of the maximize button breaking maximization. The solution is to have an additional MouseArea which controls the whole button making the two button types just visualization. --- .../aurorae/src/qml/AuroraeMaximizeButton.qml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/clients/aurorae/src/qml/AuroraeMaximizeButton.qml b/clients/aurorae/src/qml/AuroraeMaximizeButton.qml index f08a5ef0c4..1f99db7246 100644 --- a/clients/aurorae/src/qml/AuroraeMaximizeButton.qml +++ b/clients/aurorae/src/qml/AuroraeMaximizeButton.qml @@ -21,11 +21,17 @@ Item { id: button width: auroraeTheme.buttonWidthMaximizeRestore * auroraeTheme.buttonSizeFactor height: auroraeTheme.buttonHeight * auroraeTheme.buttonSizeFactor + property bool hovered: false + property bool pressed: false + property bool toggled: false AuroraeButton { id: maximizeButton anchors.fill: parent buttonType: DecorationOptions.DecorationButtonMaximizeRestore opacity: (!decoration.maximized || auroraeTheme.restoreButtonPath == "") ? 1 : 0 + hovered: button.hovered + pressed: button.pressed + toggled: button.toggled Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime @@ -37,10 +43,27 @@ Item { anchors.fill: parent buttonType: DecorationOptions.DecorationButtonMaximizeRestore + 100 opacity: (decoration.maximized && auroraeTheme.restoreButtonPath != "") ? 1 : 0 + hovered: button.hovered + pressed: button.pressed + toggled: button.toggled Behavior on opacity { NumberAnimation { duration: auroraeTheme.animationTime } } } + MouseArea { + anchors.fill: parent + acceptedButtons: { + return Qt.LeftButton | Qt.RightButton | Qt.MiddleButton; + } + hoverEnabled: true + onEntered: button.hovered = true + onExited: button.hovered = false + onPressed: button.pressed = true + onReleased: button.pressed = false + onClicked: { + decoration.maximize(mouse.button); + } + } }