feat: cleanup
This commit is contained in:
1 parent
8aa254bb87
commit
fda7ea8524
2 files changed
+16
-75
No files matched your search
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user