diff --git a/look-and-feel/contents/logout/ActionButton.qml b/look-and-feel/contents/logout/ActionButton.qml index e0611148..956c0c07 100644 --- a/look-and-feel/contents/logout/ActionButton.qml +++ b/look-and-feel/contents/logout/ActionButton.qml @@ -1,5 +1,6 @@ /* * SPDX-FileCopyrightText: 2016 David Edmundson + * SPDX-FileCopyrightText: 2022 Seshan Ravikumar * * SPDX-License-Identifier: LGPL-2.0-or-later */ @@ -16,81 +17,51 @@ Item { property alias containsMouse: mouseArea.containsMouse property alias font: label.font property alias labelRendering: label.renderType - property alias circleOpacity: iconCircle.opacity - property alias circleVisiblity: iconCircle.visible + property alias circleOpacity: buttonRect.opacity + property alias circleVisiblity: buttonRect.visible property int fontSize: config.fontSize readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software - + signal clicked activeFocusOnTab: true - property int iconSize: PlasmaCore.Units.gridUnit * 3 + property int iconSize: PlasmaCore.Units.gridUnit - implicitWidth: Math.max(iconSize + PlasmaCore.Units.largeSpacing * 2, label.contentWidth) + implicitWidth: PlasmaCore.Units.gridUnit * 14 implicitHeight: iconSize + PlasmaCore.Units.smallSpacing + label.implicitHeight - opacity: activeFocus || containsMouse ? 1 : 0.85 - Behavior on opacity { - PropertyAnimation { // OpacityAnimator makes it turn black at random intervals - duration: PlasmaCore.Units.longDuration - easing.type: Easing.InOutQuad - } - } - Rectangle { - id: iconCircle - anchors.centerIn: icon - width: iconSize + PlasmaCore.Units.smallSpacing - height: width - radius: width / 2 - color: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : PlasmaCore.ColorScope.textColor - opacity: activeFocus || containsMouse ? (softwareRendering ? 0.8 : 0.15) : (softwareRendering ? 0.6 : 0) - Behavior on opacity { - PropertyAnimation { // OpacityAnimator makes it turn black at random intervals - duration: PlasmaCore.Units.longDuration - easing.type: Easing.InOutQuad - } - } - } - - Rectangle { - anchors.centerIn: iconCircle - width: iconCircle.width - height: width - radius: width / 2 - scale: mouseArea.containsPress ? 1 : 0 - color: PlasmaCore.ColorScope.textColor - opacity: 0.15 - Behavior on scale { - PropertyAnimation { - duration: PlasmaCore.Units.shortDuration - easing.type: Easing.InOutQuart - } + id: buttonRect + width: root.width + height: iconSize * 2.2 + radius: PlasmaCore.Units.smallSpacing + color: PlasmaCore.ColorScope.backgroundColor + opacity: mouseArea.containsPress ? 0.8 : 0.3 + border { + color: Qt.rgba(255, 255, 255, 0.8) + width: 1 } } PlasmaCore.IconItem { id: icon anchors { - top: parent.top - horizontalCenter: parent.horizontalCenter + verticalCenter: buttonRect.verticalCenter + left: buttonRect.left + leftMargin: PlasmaCore.Units.mediumSpacing } width: iconSize height: iconSize colorGroup: PlasmaCore.ColorScope.colorGroup - active: mouseArea.containsMouse || root.activeFocus } PlasmaComponents3.Label { id: label font.pointSize: Math.max(fontSize + 1,PlasmaCore.Theme.defaultFont.pointSize + 1) anchors { - top: icon.bottom - topMargin: (softwareRendering ? 1.5 : 1) * PlasmaCore.Units.smallSpacing - left: parent.left - right: parent.right + centerIn: buttonRect } style: softwareRendering ? Text.Outline : Text.Normal styleColor: softwareRendering ? PlasmaCore.ColorScope.backgroundColor : "transparent" //no outline, doesn't matter diff --git a/look-and-feel/contents/logout/Logout.qml b/look-and-feel/contents/logout/Logout.qml index 4cc5c33b..34a87729 100644 --- a/look-and-feel/contents/logout/Logout.qml +++ b/look-and-feel/contents/logout/Logout.qml @@ -2,6 +2,7 @@ * SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez * SPDX-FileCopyrightText: 2020 Linus Jahn * SPDX-FileCopyrightText: 2020 Marco Martin * * SPDX-License-Identifier: GPL-2.0-or-later */ @@ -56,13 +57,6 @@ PlasmaCore.ColorScope { ParallelAnimation { id: openAnim running: true - ScaleAnimator { - target: lay - from: 10 - to: 1 - duration: PlasmaCore.Units.longDuration - easing.type: Easing.InOutQuad - } OpacityAnimator { target: lay from: 0 @@ -82,20 +76,13 @@ PlasmaCore.ColorScope { SequentialAnimation { id: closeAnim running: false - + property var callback function execute(call) { callback = call; closeAnim.restart(); } ParallelAnimation { - ScaleAnimator { - target: lay - from: 1 - to: 10 - duration: PlasmaCore.Units.longDuration - easing.type: Easing.InOutQuad - } OpacityAnimator { target: lay from: 1 @@ -122,13 +109,15 @@ PlasmaCore.ColorScope { } } } - GridLayout { + ColumnLayout { id: lay - anchors.centerIn: parent - columns: 2 - rowSpacing: PlasmaCore.Units.gridUnit * 2 - columnSpacing: PlasmaCore.Units.gridUnit * 2 - scale: 2 + anchors { + //top: root.top + //horizontalCenter: root.horizontalCenter + centerIn: root + } + + spacing: PlasmaCore.Units.gridUnit opacity: 0 ActionButton { iconSource: "system-reboot" @@ -147,14 +136,24 @@ PlasmaCore.ColorScope { } ActionButton { - //Remove this when we have more buttons - Layout.columnSpan: 2 - Layout.alignment: Qt.AlignCenter + iconSource: "system-log-out" + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log Out") + onClicked: { + closeAnim.execute(root.logoutRequested); + } + } + } + ActionButton { + anchors { + bottom: root.bottom + bottomMargin: PlasmaCore.Units.largeSpacing + horizontalCenter: parent.horizontalCenter + } iconSource: "dialog-cancel" text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Cancel") onClicked: { closeAnim.execute(root.cancelRequested); } - } } + }