From 8ec1ad7255a6a67002554e2a5c665f1ee96bc2e7 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Fri, 5 Sep 2025 19:12:32 -0400 Subject: [PATCH] TaskBar converted to Layout --- Modules/Bar/Widgets/Taskbar.qml | 16 +++++++++------- Modules/Bar/Widgets/Workspace.qml | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Modules/Bar/Widgets/Taskbar.qml b/Modules/Bar/Widgets/Taskbar.qml index 623d7e7..0eef32c 100644 --- a/Modules/Bar/Widgets/Taskbar.qml +++ b/Modules/Bar/Widgets/Taskbar.qml @@ -2,6 +2,7 @@ pragma ComponentBehavior import QtQuick import QtQuick.Controls +import QtQuick.Layouts import Quickshell import Quickshell.Widgets import Quickshell.Wayland @@ -17,15 +18,14 @@ Rectangle { readonly property real itemSize: Style.baseWidgetSize * 0.8 * scaling // Always visible when there are toplevels - implicitWidth: taskbarRow.width + Style.marginM * scaling * 2 + implicitWidth: taskbarLayout.implicitWidth + Style.marginM * scaling * 2 implicitHeight: Math.round(Style.capsuleHeight * scaling) radius: Math.round(Style.radiusM * scaling) color: Color.mSurfaceVariant - Row { - id: taskbarRow - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter + RowLayout { + id: taskbarLayout + anchors.centerIn: parent spacing: Style.marginXXS * root.scaling Repeater { @@ -35,8 +35,10 @@ Rectangle { required property Toplevel modelData property Toplevel toplevel: modelData property bool isActive: ToplevelManager.activeToplevel === modelData - width: root.itemSize - height: root.itemSize + + Layout.preferredWidth: root.itemSize + Layout.preferredHeight: root.itemSize + Layout.alignment: Qt.AlignCenter Rectangle { id: iconBackground diff --git a/Modules/Bar/Widgets/Workspace.qml b/Modules/Bar/Widgets/Workspace.qml index 6c53e65..051bdea 100644 --- a/Modules/Bar/Widgets/Workspace.qml +++ b/Modules/Bar/Widgets/Workspace.qml @@ -11,7 +11,7 @@ import qs.Services Item { id: root - property ShellScreen screen: null + property ShellScreen screen property real scaling: 1.0 property bool isDestroying: false