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
+11 -4
View File
@@ -1,5 +1,7 @@
pragma ComponentBehavior: Bound
import ZShell
import ZShell.Components
import ZShell.Config
import ZShell.Llm
import QtQuick
@@ -22,21 +24,25 @@ Item {
target: ChatState
}
ColumnLayout {
SnapLayout {
id: layout
anchors.fill: parent
spacing: Tokens.spacing.small
orientation: Qt.Vertical
Tabs {
id: tabs
Layout.fillWidth: true
Layout.preferredHeight: ChatState.isWindow || !Config.llm.enabled ? 0 : implicitHeight
Layout.preferredHeight: ZUtils.snap(ChatState.isWindow || !Config.llm.enabled ? 0 : implicitHeight, root)
screenState: root.screenState
nonAnimWidth: layout.width
visible: height > 0
}
Item {
id: tabContent
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
@@ -161,10 +167,11 @@ Item {
}
CustomRect {
id: separator
Layout.fillWidth: true
Layout.topMargin: Tokens.padding.small - layout.spacing
Layout.topMargin: ZUtils.snap(Tokens.padding.small - layout.spacing, root)
color: Colors.tPalette.m3outlineVariant
implicitHeight: 1
implicitHeight: Math.abs(pages.x) > root.width / 2 ? ZUtils.snapFloor(1, root) : ZUtils.snap(1, root)
}
}
}