diff --git a/dots/.config/quickshell/ii/modules/common/widgets/Box.qml b/dots/.config/quickshell/ii/modules/common/widgets/Box.qml new file mode 100644 index 000000000..a043e4bcb --- /dev/null +++ b/dots/.config/quickshell/ii/modules/common/widgets/Box.qml @@ -0,0 +1,11 @@ +pragma ComponentBehavior: Bound +import QtQuick + +// A type that's both capable of being rows and columns +// Qt Row is just a locked down Grid smh +// Calling it a Box because that's how row-or-column widget is called in Gtk +Grid { + property bool vertical: false + columns: vertical ? 1 : -1 + rows: vertical ? -1 : 1 +} diff --git a/dots/.config/quickshell/ii/modules/common/widgets/BoxLayout.qml b/dots/.config/quickshell/ii/modules/common/widgets/BoxLayout.qml new file mode 100644 index 000000000..47747a730 --- /dev/null +++ b/dots/.config/quickshell/ii/modules/common/widgets/BoxLayout.qml @@ -0,0 +1,13 @@ +pragma ComponentBehavior: Bound +import QtQuick +import QtQuick.Layouts + +// Box, Layout version +// A type that's both capable of being rows and columns +// Qt Row is just a locked down Grid smh +// Calling it a Box because that's how row-or-column widget is called in Gtk +GridLayout { + property bool vertical: false + columns: vertical ? 1 : -1 + rows: vertical ? -1 : 1 +} diff --git a/dots/.config/quickshell/ii/modules/common/widgets/ChoreographerGridLayout.qml b/dots/.config/quickshell/ii/modules/common/widgets/ChoreographerGridLayout.qml index b723cc27e..1581f0601 100644 --- a/dots/.config/quickshell/ii/modules/common/widgets/ChoreographerGridLayout.qml +++ b/dots/.config/quickshell/ii/modules/common/widgets/ChoreographerGridLayout.qml @@ -2,11 +2,10 @@ pragma ComponentBehavior: Bound import QtQuick import QtQuick.Layouts -GridLayout { +BoxLayout { id: root - property bool vertical: true - columns: vertical ? 1 : -1 + vertical: true property real totalDuration: 250 property real interval: totalDuration / count diff --git a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HWorkspaces.qml b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HWorkspaces.qml index da2b6a8bc..db4700967 100644 --- a/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HWorkspaces.qml +++ b/dots/.config/quickshell/ii/modules/hefty/topLayer/bar/widgets/HWorkspaces.qml @@ -339,7 +339,7 @@ HBarWidgetContainer { } /////////////////// Components /////////////////// - component WorkspaceLayout: Grid { + component WorkspaceLayout: Box { anchors { top: !root.vertical ? parent.top : undefined bottom: !root.vertical ? parent.bottom : undefined @@ -349,8 +349,7 @@ HBarWidgetContainer { rowSpacing: 0 columnSpacing: 0 - columns: root.vertical ? 1 : -1 - rows: root.vertical ? -1 : 1 + vertical: root.vertical } component WorkspaceItem: Item { diff --git a/dots/.config/quickshell/ii/modules/ii/bar/BarGroup.qml b/dots/.config/quickshell/ii/modules/ii/bar/BarGroup.qml index 35769e405..fc8708d6e 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/BarGroup.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/BarGroup.qml @@ -1,4 +1,5 @@ import qs.modules.common +import qs.modules.common.widgets import QtQuick import QtQuick.Layouts @@ -23,9 +24,9 @@ Item { radius: Appearance.rounding.small } - GridLayout { + BoxLayout { id: gridLayout - columns: root.vertical ? 1 : -1 + vertical: root.vertical anchors { verticalCenter: root.vertical ? undefined : parent.verticalCenter horizontalCenter: root.vertical ? parent.horizontalCenter : undefined diff --git a/dots/.config/quickshell/ii/modules/ii/bar/SysTray.qml b/dots/.config/quickshell/ii/modules/ii/bar/SysTray.qml index 56d33e0d4..98b9c7fa6 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/SysTray.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/SysTray.qml @@ -60,9 +60,9 @@ Item { } } - GridLayout { + BoxLayout { id: gridLayout - columns: root.vertical ? 1 : -1 + vertical: root.vertical anchors.fill: parent rowSpacing: 8 columnSpacing: 15 diff --git a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml index 05c7399b9..fe755d4ed 100644 --- a/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml +++ b/dots/.config/quickshell/ii/modules/ii/bar/Workspaces.qml @@ -82,14 +82,13 @@ Item { } // Workspaces - background - Grid { + Box { z: 1 anchors.centerIn: parent rowSpacing: 0 columnSpacing: 0 - columns: root.vertical ? 1 : -1 - rows: root.vertical ? -1 : 1 + vertical: root.vertical Repeater { model: wsModel.shownCount @@ -160,13 +159,12 @@ Item { } // Workspaces - numbers - Grid { + Box { id: wsNumbers z: 3 anchors.fill: parent - columns: root.vertical ? 1 : -1 - rows: root.vertical ? -1 : 1 + vertical: root.vertical columnSpacing: 0 rowSpacing: 0