feat: dashboard show on hover, media and weather tabs added

This commit is contained in:
2026-09-30 14:22:22 +02:00
parent d259c6ffbe
commit 2c90339c77
97 changed files with 4480 additions and 990 deletions
+85
View File
@@ -0,0 +1,85 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ZShell.Config
import qs.Components
import qs.Services
ConnectedRect {
id: root
property alias label: label.text
property string subtext
property string value
property alias placeholderText: input.placeholderText
property string errorText
property alias maximumLength: input.maximumLength
property alias validate: input.validate
property alias validator: input.validator
property bool smallField
readonly property alias field: input
signal valueEdited(value: string)
signal editingFinished(value: string)
function clear(): void {
input.clear();
}
Component.onDestruction: {
if (value !== input.text)
editingFinished(input.text);
}
Layout.fillWidth: true
implicitHeight: rowLayout.implicitHeight + Tokens.padding.medium + Math.max(0, Tokens.padding.large - input.verticalPadding) * 2
RowLayout {
id: rowLayout
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Tokens.padding.largeIncreased
anchors.rightMargin: Tokens.padding.largeIncreased
spacing: Tokens.spacing.medium
ColumnLayout {
Layout.fillWidth: true
spacing: 0
CustomText {
id: label
Layout.fillWidth: true
font: Tokens.font.body.small
elide: Text.ElideRight
}
CustomText {
Layout.fillWidth: true
visible: root.subtext
text: input.isError && root.errorText ? root.errorText : root.subtext
color: input.isError && root.errorText ? Colors.palette.m3error : Colors.palette.m3outline
font.pointSize: Tokens.font.size.small
elide: Text.ElideRight
animate: root.errorText
}
}
CustomTextField {
id: input
Layout.preferredWidth: root.smallField ? Tokens.sizes.nexus.smallTextFieldWidth : Tokens.sizes.nexus.textFieldWidth
Layout.maximumWidth: root.width / 2
Layout.alignment: Qt.AlignVCenter
verticalPadding: Tokens.padding.small
text: root.value
onTextEdited: root.valueEdited(text)
onEditingFinished: root.editingFinished(text)
}
}
}
@@ -33,5 +33,33 @@ PageBase {
onToggled: Config.dashboard.enabled = checked
}
// Behavior
SectionHeader {
text: qsTr("Behavior")
}
ToggleRow {
checked: Config.dashboard.showOnHover
first: true
settingAnchor: "dashboard-showonhover"
text: qsTr("Show on hover")
subtext: qsTr("Dashboard %1 be shown when hovering the middle-top part of the shell").arg(checked ? "will" : "will not")
onToggled: Config.dashboard.showOnHover = checked
}
SpinRow {
from: 30
settingAnchor: "dashboard-drag-threshold"
stepSize: 20
enabled: !Config.dashboard.showOnHover
subtext: qsTr("How far you need to drag before the panel opens")
text: qsTr("Drag threshold")
to: 100
value: Config.dashboard.dragThreshold
onMoved: v => Config.dashboard.dragThreshold = v
}
}
}
+2 -2
View File
@@ -12,8 +12,8 @@ Item {
required property var panels
property string queuedMode: "wallpaper"
required property ShellScreen screen
readonly property bool shouldBeActive: visibilities.settings
required property PersistentProperties visibilities
readonly property bool shouldBeActive: screenState.settings
required property ScreenState screenState
implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth