feat: initial commit for pixel-snapping components and helpers
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user