dashboard
This commit is contained in:
@@ -75,6 +75,7 @@ Item {
|
|||||||
index: 0
|
index: 0
|
||||||
sourceComponent: Dash {
|
sourceComponent: Dash {
|
||||||
state: root.state
|
state: root.state
|
||||||
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
import qs.Components
|
import qs.Components
|
||||||
@@ -10,11 +11,52 @@ import qs.Modules.Dashboard.Dash
|
|||||||
GridLayout {
|
GridLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
required property PersistentProperties visibilities
|
||||||
required property PersistentProperties state
|
required property PersistentProperties state
|
||||||
|
readonly property bool dashboardVisible: visibilities.dashboard
|
||||||
|
|
||||||
rowSpacing: Appearance.spacing.normal
|
rowSpacing: Appearance.spacing.normal
|
||||||
columnSpacing: Appearance.spacing.normal
|
columnSpacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
opacity: 0
|
||||||
|
scale: 0.9
|
||||||
|
|
||||||
|
onDashboardVisibleChanged: {
|
||||||
|
if (dashboardVisible) {
|
||||||
|
openAnim.start();
|
||||||
|
} else {
|
||||||
|
closeAnim.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
id: openAnim
|
||||||
|
Anim {
|
||||||
|
target: root
|
||||||
|
property: "opacity"
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
Anim {
|
||||||
|
target: root
|
||||||
|
property: "scale"
|
||||||
|
to: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ParallelAnimation {
|
||||||
|
id: closeAnim
|
||||||
|
Anim {
|
||||||
|
target: root
|
||||||
|
property: "opacity"
|
||||||
|
to: 0
|
||||||
|
}
|
||||||
|
Anim {
|
||||||
|
target: root
|
||||||
|
property: "scale"
|
||||||
|
to: 0.9
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rect {
|
Rect {
|
||||||
Layout.column: 2
|
Layout.column: 2
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ CustomMouseArea {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: model.shortName
|
text: model.shortName
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
color: (model.day === 0 || model.day === 6) ? DynamicColors.palette.m3secondary : DynamicColors.palette.m3onSurfaceVariant
|
color: (model.day === 0) ? DynamicColors.palette.m3secondary : DynamicColors.palette.m3onSurfaceVariant
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ CustomMouseArea {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
spacing: 3
|
spacing: 3
|
||||||
locale: Qt.locale()
|
locale: Qt.locale("en_SE")
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: dayItem
|
id: dayItem
|
||||||
@@ -177,7 +177,7 @@ CustomMouseArea {
|
|||||||
text: grid.locale.toString(dayItem.model.day)
|
text: grid.locale.toString(dayItem.model.day)
|
||||||
color: {
|
color: {
|
||||||
const dayOfWeek = dayItem.model.date.getUTCDay();
|
const dayOfWeek = dayItem.model.date.getUTCDay();
|
||||||
if (dayOfWeek === 0 || dayOfWeek === 6)
|
if (dayOfWeek === 6)
|
||||||
return DynamicColors.palette.m3secondary;
|
return DynamicColors.palette.m3secondary;
|
||||||
|
|
||||||
return DynamicColors.palette.m3onSurfaceVariant;
|
return DynamicColors.palette.m3onSurfaceVariant;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Item {
|
|||||||
animate: true
|
animate: true
|
||||||
text: Weather.icon
|
text: Weather.icon
|
||||||
color: DynamicColors.palette.m3secondary
|
color: DynamicColors.palette.m3secondary
|
||||||
font.pointSize: 24
|
font.pointSize: 54
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -29,6 +29,7 @@ Item {
|
|||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: icon.right
|
anchors.left: icon.right
|
||||||
|
anchors.leftMargin: Appearance.spacing.large
|
||||||
|
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ Item {
|
|||||||
Modules.Anim {
|
Modules.Anim {
|
||||||
target: root
|
target: root
|
||||||
property: "implicitHeight"
|
property: "implicitHeight"
|
||||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
duration: MaterialEasing.expressiveEffectsTime
|
||||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Transition {
|
Transition {
|
||||||
@@ -60,7 +60,7 @@ Item {
|
|||||||
Modules.Anim {
|
Modules.Anim {
|
||||||
target: root
|
target: root
|
||||||
property: "implicitHeight"
|
property: "implicitHeight"
|
||||||
easing.bezierCurve: Appearance.anim.curves.emphasized
|
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user