TaskBar converted to Layout

This commit is contained in:
LemmyCook 2025-09-05 19:12:32 -04:00
parent 1efa1f4aa3
commit 8ec1ad7255
2 changed files with 10 additions and 8 deletions

View file

@ -2,6 +2,7 @@ pragma ComponentBehavior
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Wayland import Quickshell.Wayland
@ -17,15 +18,14 @@ Rectangle {
readonly property real itemSize: Style.baseWidgetSize * 0.8 * scaling readonly property real itemSize: Style.baseWidgetSize * 0.8 * scaling
// Always visible when there are toplevels // 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) implicitHeight: Math.round(Style.capsuleHeight * scaling)
radius: Math.round(Style.radiusM * scaling) radius: Math.round(Style.radiusM * scaling)
color: Color.mSurfaceVariant color: Color.mSurfaceVariant
Row { RowLayout {
id: taskbarRow id: taskbarLayout
anchors.verticalCenter: parent.verticalCenter anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
spacing: Style.marginXXS * root.scaling spacing: Style.marginXXS * root.scaling
Repeater { Repeater {
@ -35,8 +35,10 @@ Rectangle {
required property Toplevel modelData required property Toplevel modelData
property Toplevel toplevel: modelData property Toplevel toplevel: modelData
property bool isActive: ToplevelManager.activeToplevel === 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 { Rectangle {
id: iconBackground id: iconBackground

View file

@ -11,7 +11,7 @@ import qs.Services
Item { Item {
id: root id: root
property ShellScreen screen: null property ShellScreen screen
property real scaling: 1.0 property real scaling: 1.0
property bool isDestroying: false property bool isDestroying: false