From e4225dc97b69b04c4a3ce8ff12a1e6f8937a3c69 Mon Sep 17 00:00:00 2001 From: reionwong Date: Sat, 7 Aug 2021 03:43:12 +0800 Subject: [PATCH] Adjust the shutdown dialog button UI --- shutdown-ui/IconButton.qml | 50 ++++++++++++++++++++++---------------- shutdown-ui/main.qml | 4 +-- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/shutdown-ui/IconButton.qml b/shutdown-ui/IconButton.qml index ba067e7..b571e6a 100644 --- a/shutdown-ui/IconButton.qml +++ b/shutdown-ui/IconButton.qml @@ -33,19 +33,6 @@ Item { property bool checked: false signal clicked - Rectangle { - anchors.fill: parent - color: "white" - opacity: mouseArea.pressed ? 0.1 : mouseArea.containsMouse || control.checked ? 0.2 : 0 - radius: height / 2 - - Behavior on opacity { - NumberAnimation { - duration: 100 - } - } - } - MouseArea { id: mouseArea anchors.fill: parent @@ -57,19 +44,40 @@ Item { ColumnLayout { id: layout anchors.fill: parent - spacing: FishUI.Units.largeSpacing + spacing: FishUI.Units.largeSpacing * 1.5 Item { Layout.fillHeight: true } - Image { - id: image - source: control.icon - sourceSize: Qt.size(width, height) - width: control.iconSize - height: width - Layout.alignment: Qt.AlignCenter + Item { + height: control.iconSize + Layout.fillWidth: true + + Rectangle { + anchors.centerIn: parent + width: parent.height + FishUI.Units.largeSpacing * 2 + height: parent.height + FishUI.Units.largeSpacing * 2 + z: -1 + color: "white" + opacity: mouseArea.pressed ? 0.1 : mouseArea.containsMouse || control.checked ? 0.2 : 0 + radius: height / 2 + + Behavior on opacity { + NumberAnimation { + duration: 100 + } + } + } + + Image { + id: image + anchors.centerIn: parent + source: control.icon + sourceSize: Qt.size(width, height) + width: control.iconSize + height: width + } } Label { diff --git a/shutdown-ui/main.qml b/shutdown-ui/main.qml index 30686aa..3cfe2f0 100644 --- a/shutdown-ui/main.qml +++ b/shutdown-ui/main.qml @@ -53,13 +53,13 @@ ApplicationWindow { asynchronous: false clip: true cache: false - smooth: true + smooth: false ColorOverlay { anchors.fill: parent source: parent color: "#000000" - opacity: 0.5 + opacity: 0.4 } }