feat: initial commit for pixel-snapping components and helpers

This commit is contained in:
2026-10-29 17:34:57 +01:00
parent 9d8bde1413
commit 9cbb90f9e1
163 changed files with 2671 additions and 951 deletions
+10 -6
View File
@@ -3,8 +3,10 @@ pragma ComponentBehavior: Bound
import Quickshell
import QtQuick
import QtQuick.Layouts
import qs.Components
import ZShell.Components
import ZShell
import ZShell.Config
import qs.Components
import qs.Helpers
import qs.Services
@@ -15,17 +17,18 @@ CustomRect {
Layout.fillWidth: true
color: Colors.tPalette.m3surfaceContainer
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
implicitHeight: ZUtils.snap(layout.implicitHeight + layout.anchors.margins * 2, root)
radius: Tokens.rounding.small
ColumnLayout {
SnapLayout {
orientation: Qt.Vertical
id: layout
anchors.fill: parent
anchors.margins: Tokens.padding.large
spacing: Tokens.spacing.medium
RowLayout {
SnapLayout {
spacing: Tokens.spacing.medium
z: 1
@@ -50,7 +53,8 @@ CustomRect {
}
}
ColumnLayout {
SnapLayout {
orientation: Qt.Vertical
Layout.fillWidth: true
spacing: 0
@@ -194,7 +198,7 @@ CustomRect {
Component {
id: recordingControls
RowLayout {
SnapLayout {
spacing: Tokens.spacing.medium
CustomRect {
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ZShell.Components
import Quickshell
import Quickshell.Widgets
import ZShell.Models
@@ -11,7 +12,8 @@ import qs.Paths
import ZShell.Config
import qs.Services
ColumnLayout {
SnapLayout {
orientation: Qt.Vertical
id: root
required property ScreenState screenState
@@ -24,7 +26,7 @@ ColumnLayout {
onClicked: root.screenState.recordingListExpanded = !root.screenState.recordingListExpanded
RowLayout {
SnapLayout {
spacing: Tokens.spacing.small
MaterialIcon {
@@ -74,7 +76,7 @@ ColumnLayout {
to: 1
}
}
delegate: RowLayout {
delegate: SnapLayout {
id: recording
property string baseName
@@ -168,7 +170,8 @@ ColumnLayout {
Behavior on opacity {
Anim {}
}
sourceComponent: ColumnLayout {
sourceComponent: SnapLayout {
orientation: Qt.Vertical
spacing: Tokens.spacing.small
MaterialIcon {
@@ -191,7 +194,7 @@ ColumnLayout {
}
}
RowLayout {
SnapLayout {
spacing: Tokens.spacing.small
MaterialIcon {
+2 -1
View File
@@ -45,7 +45,8 @@ CustomRect {
implicitHeight: layout.implicitHeight + Tokens.padding.extraLargeIncreased
radius: Tokens.rounding.small
ColumnLayout {
SnapLayout {
orientation: Qt.Vertical
id: layout
anchors.fill: parent
+8 -4
View File
@@ -2,22 +2,26 @@ import Quickshell
import QtQuick
import QtQuick.Layouts
import ZShell.Config
import ZShell
import qs.Components
import qs.Modules.Sidebar.Utils.Cards
import ZShell.Components
Item {
id: root
required property ScreenState screenState
implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
implicitHeight: ZUtils.snap(layout.implicitHeight, root)
implicitWidth: ZUtils.snap(layout.implicitWidth, root)
ColumnLayout {
SnapLayout {
id: layout
anchors.fill: parent
spacing: 8
spacing: Tokens.spacing.small
orientation: Qt.Vertical
IdleInhibit {}
+12 -7
View File
@@ -1,8 +1,10 @@
import qs.Components
import ZShell.Config
import qs.Helpers
import QtQuick
import QtQuick.Layouts
import ZShell
import ZShell.Config
import ZShell.Components
import qs.Components
import qs.Helpers
import qs.Services
CustomRect {
@@ -11,21 +13,22 @@ CustomRect {
Layout.fillWidth: true
clip: true
color: Colors.tPalette.m3surfaceContainer
implicitHeight: layout.implicitHeight + (IdleInhibitor.enabled ? activeChip.implicitHeight + activeChip.anchors.topMargin : 0) + 18 * 2
implicitHeight: ZUtils.snap((layout.implicitHeight + (IdleInhibitor.enabled ? activeChip.implicitHeight + activeChip.anchors.topMargin : 0) + 18 * 2), root)
radius: Tokens.rounding.small
Behavior on implicitHeight {
Anim {}
}
RowLayout {
SnapLayout {
id: layout
anchors.left: parent.left
anchors.margins: 18
anchors.right: parent.right
anchors.top: parent.top
spacing: 10
spacing: Tokens.spacing.medium
CustomRect {
color: IdleInhibitor.enabled ? Colors.palette.m3secondary : Colors.palette.m3secondaryContainer
@@ -43,9 +46,11 @@ CustomRect {
}
}
ColumnLayout {
SnapLayout {
Layout.fillWidth: true
spacing: 0
orientation: Qt.Vertical
CustomText {
Layout.fillWidth: true