From acc593a1e44d1c5d1ff2f838446fdbff7afeaab7 Mon Sep 17 00:00:00 2001 From: Johannes Kresner Date: Wed, 26 Aug 2026 23:22:11 +0200 Subject: [PATCH] feat: cleanup --- .../quickshell/components/Bar/Bar.qml | 69 ------------------- .../CommandPalette/CommandPalette.qml | 22 ++++-- 2 files changed, 16 insertions(+), 75 deletions(-) diff --git a/mutable_config/quickshell/components/Bar/Bar.qml b/mutable_config/quickshell/components/Bar/Bar.qml index 8d0aa3b..a18396c 100644 --- a/mutable_config/quickshell/components/Bar/Bar.qml +++ b/mutable_config/quickshell/components/Bar/Bar.qml @@ -2,7 +2,6 @@ import QtQuick import Quickshell import Quickshell.Wayland import Quickshell.Hyprland -import Quickshell.Services.SystemTray import Quickshell.Io import "../Shared" @@ -107,72 +106,4 @@ PanelWindow { font.bold: true } } - - // Right Pill (Tray / System) - Rectangle { - id: rightPill - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: parent.height - width: trayRow.width + Theme.geometry.padding * 4 - radius: Theme.geometry.pillRadius - color: Theme.colors.surface - border.color: Theme.colors.border - border.width: 1 - - Row { - id: trayRow - anchors.centerIn: parent - spacing: Theme.geometry.spacing - - Repeater { - model: SystemTray.items.values - - delegate: Image { - width: 20 - height: 20 - source: modelData.icon.name || "" - visible: source != "" - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton - onClicked: (mouse) => { - if (mouse.button === Qt.LeftButton) modelData.activate(); - else if (mouse.button === Qt.RightButton) modelData.contextMenu(); - else if (mouse.button === Qt.MiddleButton) modelData.secondaryActivate(); - } - } - } - } - - Rectangle { - width: 1 - height: 20 - color: Theme.colors.border - visible: SystemTray.items.values.length > 0 - } - - Rectangle { - width: 24 - height: 24 - radius: 12 - color: rootState.commandPaletteOpen ? Theme.colors.primary : "transparent" - - Text { - anchors.centerIn: parent - text: "☰" - color: rootState.commandPaletteOpen ? Theme.colors.background : Theme.colors.text - font.pixelSize: 14 - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: rootState.toggleCommandPalette() - } - } - } - } } diff --git a/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml b/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml index ff29602..06bd913 100644 --- a/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml +++ b/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml @@ -95,19 +95,28 @@ PanelWindow { searchTimer.restart(); } - Keys.onEscapePressed: { + Keys.onEscapePressed: (event) => { rootState.commandPaletteOpen = false; + event.accepted = true; } - Keys.onUpPressed: { - if (appList.currentIndex > 0) appList.currentIndex--; + Keys.onUpPressed: (event) => { + if (appList.currentIndex > 0) { + appList.currentIndex--; + appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); + } + event.accepted = true; } - Keys.onDownPressed: { - if (appList.currentIndex < appList.count - 1) appList.currentIndex++; + Keys.onDownPressed: (event) => { + if (appList.currentIndex < appList.count - 1) { + appList.currentIndex++; + appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); + } + event.accepted = true; } - Keys.onReturnPressed: { + Keys.onReturnPressed: (event) => { if (appList.currentIndex >= 0 && appList.currentIndex < appModel.count) { let item = appModel.get(appList.currentIndex); let desktopName = item.desktopName; @@ -124,6 +133,7 @@ PanelWindow { launchProcess.restart(); rootState.commandPaletteOpen = false; } + event.accepted = true; } } }