feat: initial commit for pixel-snapping components and helpers
This commit is contained in:
+55
-77
@@ -1,104 +1,82 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell
|
||||
import ZShell.Config
|
||||
import ZShell.Components
|
||||
import qs.Helpers
|
||||
import qs.Components
|
||||
import qs.Modules
|
||||
import ZShell.Config
|
||||
import qs.Modules.Dashboard.Dash
|
||||
import qs.Services
|
||||
|
||||
GridLayout {
|
||||
SnapLayout {
|
||||
orientation: Qt.Vertical
|
||||
id: root
|
||||
|
||||
readonly property bool dashboardVisible: screenState.dashboard
|
||||
required property int radius
|
||||
required property ScreenState screenState
|
||||
|
||||
columnSpacing: Tokens.spacing.small
|
||||
rowSpacing: Tokens.spacing.small
|
||||
spacing: ZUtils.snap(Tokens.spacing.small, root)
|
||||
|
||||
ParallelAnimation {
|
||||
id: openAnim
|
||||
height: ZUtils.snap(implicitHeight, root)
|
||||
width: ZUtils.snap(implicitWidth, root)
|
||||
|
||||
Anim {
|
||||
property: "opacity"
|
||||
target: root
|
||||
to: 1
|
||||
}
|
||||
|
||||
Anim {
|
||||
property: "scale"
|
||||
target: root
|
||||
to: 1
|
||||
}
|
||||
}
|
||||
|
||||
ParallelAnimation {
|
||||
id: closeAnim
|
||||
|
||||
Anim {
|
||||
property: "opacity"
|
||||
target: root
|
||||
to: 0
|
||||
}
|
||||
|
||||
Anim {
|
||||
property: "scale"
|
||||
target: root
|
||||
to: 0.9
|
||||
}
|
||||
}
|
||||
|
||||
Rect {
|
||||
Layout.column: 2
|
||||
Layout.columnSpan: 3
|
||||
Layout.preferredHeight: user.implicitHeight
|
||||
Layout.preferredWidth: user.implicitWidth
|
||||
radius: root.radius
|
||||
|
||||
User {
|
||||
id: user
|
||||
|
||||
screenState: root.screenState
|
||||
}
|
||||
}
|
||||
|
||||
Rect {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: Tokens.sizes.dashboard.weatherWidth
|
||||
Layout.row: 0
|
||||
radius: root.radius
|
||||
|
||||
Weather {}
|
||||
}
|
||||
|
||||
Rect {
|
||||
Layout.column: 0
|
||||
Layout.columnSpan: 3
|
||||
SnapLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: calendar.implicitHeight
|
||||
Layout.row: 1
|
||||
radius: root.radius
|
||||
spacing: parent.spacing
|
||||
|
||||
Calendar {
|
||||
id: calendar
|
||||
Rect {
|
||||
id: weatherRect
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: ZUtils.snap(Tokens.sizes.dashboard.weatherWidth, root)
|
||||
radius: root.radius
|
||||
|
||||
screenState: root.screenState
|
||||
Weather {}
|
||||
}
|
||||
|
||||
Rect {
|
||||
id: userRect
|
||||
Layout.preferredHeight: ZUtils.snap(user.implicitHeight, root)
|
||||
Layout.preferredWidth: ZUtils.snap(user.implicitWidth, root)
|
||||
radius: root.radius
|
||||
|
||||
User {
|
||||
id: user
|
||||
|
||||
screenState: root.screenState
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rect {
|
||||
Layout.column: 3
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: resources.implicitWidth
|
||||
Layout.row: 1
|
||||
radius: root.radius
|
||||
SnapLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: parent.spacing
|
||||
|
||||
Resources {
|
||||
id: resources
|
||||
Rect {
|
||||
id: calendarRect
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
implicitHeight: ZUtils.snap(calendar.implicitHeight, root)
|
||||
radius: root.radius
|
||||
|
||||
Calendar {
|
||||
id: calendar
|
||||
|
||||
screenState: root.screenState
|
||||
}
|
||||
}
|
||||
|
||||
Rect {
|
||||
id: resourcesRect
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: ZUtils.snap(resources.implicitWidth, root)
|
||||
radius: root.radius
|
||||
|
||||
Resources {
|
||||
id: resources
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user