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.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

View File

@@ -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