From 960042b3b835c2d21b051979272d4282796a8387 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Tue, 4 Nov 2025 22:58:04 +0100 Subject: [PATCH] Tray: fix layout for single tray app --- Modules/Bar/Widgets/Tray.qml | 54 ++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/Modules/Bar/Widgets/Tray.qml b/Modules/Bar/Widgets/Tray.qml index 15176b76..4c2c0654 100644 --- a/Modules/Bar/Widgets/Tray.qml +++ b/Modules/Bar/Widgets/Tray.qml @@ -303,31 +303,37 @@ Rectangle { } } - // Dropdown opener - NIconButton { - id: dropdownButton + // Dropdown opener - wrapped in Item for proper alignment + Item { visible: dropdownItems.length > 0 - width: Math.round(itemSize * 1.4) - height: Math.round(itemSize * 1.4) - icon: { - if (barPosition === "top") - return "chevron-down" - else if (barPosition === "bottom") - return "chevron-up" - else if (barPosition === "left") - return "chevron-right" - else if (barPosition === "right") - return "chevron-left" - else - return "chevron-down" // default fallback - } - tooltipText: I18n.tr("open-control-center") // reuse generic tooltip text - onClicked: { - const panel = PanelService.getPanel("trayDropdownPanel", root.screen) - if (panel) { - panel.widgetSection = root.section - panel.widgetIndex = root.sectionWidgetIndex - panel.toggle(this) + width: itemSize + height: itemSize + + NIconButton { + id: dropdownButton + anchors.centerIn: parent + width: itemSize + height: itemSize + icon: { + if (barPosition === "top") + return "chevron-down" + else if (barPosition === "bottom") + return "chevron-up" + else if (barPosition === "left") + return "chevron-right" + else if (barPosition === "right") + return "chevron-left" + else + return "chevron-down" // default fallback + } + tooltipText: I18n.tr("open-control-center") // reuse generic tooltip text + onClicked: { + const panel = PanelService.getPanel("trayDropdownPanel", root.screen) + if (panel) { + panel.widgetSection = root.section + panel.widgetIndex = root.sectionWidgetIndex + panel.toggle(this) + } } } }