From 7cdb76f8310ffba13ea6dbd02416c76ac81f9add Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 11 Jul 2025 14:50:36 +0800 Subject: fix layout + new import root:/ syntax --- bar/Bar.qml | 65 +++++++++++++++++++++++++++++++++++++------------------ bar/Workspace.qml | 5 ++--- 2 files changed, 46 insertions(+), 24 deletions(-) (limited to 'bar') diff --git a/bar/Bar.qml b/bar/Bar.qml index f28b836..4bb56e5 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -1,8 +1,8 @@ -import "../utils" -import "../config" import QtQuick import Quickshell import QtQuick.Layouts +import qs.utils +import qs.config Scope { id: root @@ -11,7 +11,7 @@ Scope { model: Quickshell.screens IWindow { - name: "Bar" + name: "Bar" anchors { top: true @@ -24,7 +24,7 @@ Scope { id: child radius: Bar.borderRadius implicitHeight: Bar.height - implicitWidth: parent.width + implicitWidth: parent.width anchors { left: parent.left @@ -36,26 +36,49 @@ Scope { rightMargin: Bar.rightMargin } RowLayout { - anchors { - fill: parent - left: parent.left - } - Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter - id: row + id: rowLayout + anchors.fill: parent + + RowLayout { + id: leftRow + Layout.preferredWidth: 1 + Layout.fillWidth: true + // Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter - Workspace { - id: workspace + Workspace { + id: workspace + Layout.preferredWidth: 3 + Layout.fillWidth: true + } + Mpris { + id: mpris + Layout.fillWidth: true + Layout.preferredWidth: 1 + } + } + RowLayout { + id: centerRow + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredWidth: 1 + Rectangle { + Layout.fillWidth: true + implicitHeight: 1 + color: "#000000" + } + } + RowLayout { + id: rightRow + Layout.fillWidth: true + Layout.preferredWidth: 1 + Rectangle { + Layout.fillWidth: true + Text { + text: "a" + } + } } - // Workspace { - // - // id: workspace2 - // } - // Workspace { - // - // id: workspace3 - // } } - } } } diff --git a/bar/Workspace.qml b/bar/Workspace.qml index afdc776..fd9d521 100644 --- a/bar/Workspace.qml +++ b/bar/Workspace.qml @@ -1,12 +1,11 @@ import QtQuick.Layouts import QtQuick import Quickshell -import "../services" -import "../config" +import qs.services +import qs.config Item { Layout.fillHeight: true - Layout.preferredWidth: parent.width / 3 property list workspaceOccupied: [] -- cgit v1.2.3