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); + } + } }