From 2a0e4428c71ec39276e4eae65edc0415798c7c72 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sat, 18 Apr 2026 11:27:24 +0200 Subject: [PATCH] Move close button to power panel The dismiss button in the drawer header was isolated from the other controls. Moving it to the top of the power panel groups everything in one place and lets the power icons sit centered between it and the user avatar. --- .../homescreens/folio/qml/AppDrawerHeader.qml | 16 ------ containments/homescreens/folio/qml/main.qml | 50 ++++++++++++++++++- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/containments/homescreens/folio/qml/AppDrawerHeader.qml b/containments/homescreens/folio/qml/AppDrawerHeader.qml index 688d968e..60268ad8 100644 --- a/containments/homescreens/folio/qml/AppDrawerHeader.qml +++ b/containments/homescreens/folio/qml/AppDrawerHeader.qml @@ -8,7 +8,6 @@ import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio import './delegate' @@ -90,21 +89,6 @@ Item { } } - // Close button for convergence mode - QQC2.ToolButton { - visible: ShellSettings.Settings.convergenceModeEnabled - icon.name: "window-close-symbolic" - icon.color: "white" - Layout.preferredWidth: Kirigami.Units.iconSizes.medium - Layout.preferredHeight: Kirigami.Units.iconSizes.medium - onClicked: folio.HomeScreenState.closeAppDrawer() - QQC2.ToolTip.text: i18n("Close") - QQC2.ToolTip.visible: hovered - QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay - - Kirigami.Theme.inherit: false - Kirigami.Theme.colorSet: Kirigami.Theme.Complementary - } } } diff --git a/containments/homescreens/folio/qml/main.qml b/containments/homescreens/folio/qml/main.qml index 14d8a755..0baf678e 100644 --- a/containments/homescreens/folio/qml/main.qml +++ b/containments/homescreens/folio/qml/main.qml @@ -400,10 +400,56 @@ ContainmentItem { id: powerSession } - // Power buttons stacked at top — icon only, tooltip on hover + // Close button anchored to top — smaller than power icons + Rectangle { + id: closeButton + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Kirigami.Units.smallSpacing + height: Kirigami.Units.iconSizes.smallMedium + 2 * Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius + color: closeArea.containsPress + ? Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, Kirigami.Theme.textColor.b, 0.2) + : closeArea.containsMouse + ? Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, Kirigami.Theme.textColor.b, 0.1) + : "transparent" + Kirigami.Icon { + anchors.centerIn: parent + width: Kirigami.Units.iconSizes.smallMedium + height: width + source: "window-close-symbolic" + active: closeArea.containsMouse + } + PlasmaComponents.ToolTip { + text: i18n("Close") + visible: closeArea.containsMouse + } + MouseArea { + id: closeArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: folio.HomeScreenState.closeAppDrawer() + } + } + + // Separator below close button + Rectangle { + anchors.top: closeButton.bottom + anchors.topMargin: Kirigami.Units.smallSpacing + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: Kirigami.Units.smallSpacing + anchors.rightMargin: Kirigami.Units.smallSpacing + height: 1 + color: Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, Kirigami.Theme.textColor.b, 0.15) + } + + // Power buttons centred vertically in the panel Column { id: powerColumn - anchors.top: parent.top + anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.right: parent.right anchors.margins: Kirigami.Units.smallSpacing