feat: redesign quickshell menus
This commit is contained in:
1 parent
4d1b53eb42
commit
cfe81c15f5
16 files changed
+645
-1076
No files matched your search
@@ -1,85 +1,62 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "components"
|
||||
import "core"
|
||||
|
||||
Scope {
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
delegate: Component {
|
||||
PanelWindow {
|
||||
id: topBar
|
||||
|
||||
required property var modelData
|
||||
property var hyprMonitor: Hyprland.monitorFor(modelData)
|
||||
import "components/Bar"
|
||||
import "components/CommandPalette"
|
||||
import "components/Shared"
|
||||
|
||||
screen: modelData
|
||||
ShellRoot {
|
||||
id: root
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
implicitHeight: 32 + 8 // Changed to implicitHeight per warnings
|
||||
color: "transparent"
|
||||
exclusiveZone: implicitHeight
|
||||
// --- Global State ---
|
||||
property bool commandPaletteOpen: false
|
||||
property bool commandPaletteOsdMode: false
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 8
|
||||
anchors.leftMargin: Theme.padding
|
||||
anchors.rightMargin: Theme.padding
|
||||
|
||||
// Left: Workspaces
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
// Wrap workspaces in a solid pill
|
||||
ModuleContainer {
|
||||
pillColor: Theme.bgAlt
|
||||
customContent: Component {
|
||||
Workspaces {
|
||||
monitor: hyprMonitor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Center: Clock
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
|
||||
Clock {
|
||||
pillColor: Theme.primary
|
||||
monitor: hyprMonitor
|
||||
exclusiveToScreen: true
|
||||
}
|
||||
}
|
||||
|
||||
// Right: Status Indicators
|
||||
RowLayout {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
StatusIndicators {
|
||||
monitor: hyprMonitor
|
||||
exclusiveToScreen: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
IpcHandler {
|
||||
target: "commandPalette"
|
||||
function toggle() {
|
||||
root.toggleCommandPalette();
|
||||
}
|
||||
function openOsd() {
|
||||
root.showOsd();
|
||||
}
|
||||
}
|
||||
|
||||
// Notification Daemon (Global, usually tied to primary monitor or floating)
|
||||
NotificationDaemon {}
|
||||
|
||||
// Global floating widget windows
|
||||
AppLauncherWindow {}
|
||||
ClipboardPickerWindow {}
|
||||
PowerMenuWindow {}
|
||||
function toggleCommandPalette() {
|
||||
if (commandPaletteOpen && !commandPaletteOsdMode) {
|
||||
commandPaletteOpen = false;
|
||||
} else {
|
||||
commandPaletteOsdMode = false;
|
||||
commandPaletteOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
function showOsd() {
|
||||
commandPaletteOsdMode = true;
|
||||
commandPaletteOpen = true;
|
||||
osdHideTimer.restart();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: osdHideTimer
|
||||
interval: 2000
|
||||
onTriggered: {
|
||||
if (root.commandPaletteOsdMode) {
|
||||
root.commandPaletteOpen = false;
|
||||
root.commandPaletteOsdMode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// --------------------
|
||||
|
||||
Bar {
|
||||
id: bar
|
||||
rootState: root
|
||||
}
|
||||
|
||||
CommandPalette {
|
||||
id: commandPalette
|
||||
rootState: root
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user