From b707a6ee3ebfb5b527af63f0eacfb63ec1a580cb Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 8 Jul 2025 18:25:20 +0800 Subject: init --- bar/Bar.qml | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ bar/Workspace.qml | 21 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 bar/Bar.qml create mode 100644 bar/Workspace.qml (limited to 'bar') diff --git a/bar/Bar.qml b/bar/Bar.qml new file mode 100644 index 0000000..f28b836 --- /dev/null +++ b/bar/Bar.qml @@ -0,0 +1,62 @@ +import "../utils" +import "../config" +import QtQuick +import Quickshell +import QtQuick.Layouts + +Scope { + id: root + + Variants { + model: Quickshell.screens + + IWindow { + name: "Bar" + + anchors { + top: true + left: true + right: true + } + implicitHeight: child.implicitHeight + Bar.topMargin * 2 + + Rectangle { + id: child + radius: Bar.borderRadius + implicitHeight: Bar.height + implicitWidth: parent.width + + anchors { + left: parent.left + right: parent.mid + fill: parent + top: parent.top + topMargin: Bar.topMargin + leftMargin: Bar.leftMargin + rightMargin: Bar.rightMargin + } + RowLayout { + anchors { + fill: parent + left: parent.left + } + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter + id: row + + Workspace { + id: workspace + } + // Workspace { + // + // id: workspace2 + // } + // Workspace { + // + // id: workspace3 + // } + } + + } + } + } +} diff --git a/bar/Workspace.qml b/bar/Workspace.qml new file mode 100644 index 0000000..2f8d1ea --- /dev/null +++ b/bar/Workspace.qml @@ -0,0 +1,21 @@ +import "../services" +import QtQuick.Layouts +import QtQuick +import Quickshell + +Item { + Layout.preferredHeight: 50 + Layout.preferredWidth: parent.width / 3 + + RowLayout { + anchors.fill: parent + spacing: 0 + Repeater { + model: Hyprland.workspaces + + Text { + text: modelData.active ? modelData.name + " (Active)" : modelData.name + } + } + } +} -- cgit v1.2.3