diff options
| author | Robin Seger <pixelkhaos@gmail.com> | 2026-03-10 15:22:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-11 01:22:23 +1100 |
| commit | 3e0360401bbbb0f640958998f6625495e5b3fdff (patch) | |
| tree | 8c240477df130a95211b64649b40e7ba25972454 /modules/dashboard/Tabs.qml | |
| parent | systemusage: improve GPU detection for AMD RX series GPU (#1246) (diff) | |
| download | caelestia-shell-3e0360401bbbb0f640958998f6625495e5b3fdff.tar.gz caelestia-shell-3e0360401bbbb0f640958998f6625495e5b3fdff.tar.bz2 caelestia-shell-3e0360401bbbb0f640958998f6625495e5b3fdff.zip | |
dashboard: dynamic dashboard tabs + fix performance settings updating (#1253)
* [CI] chore: update flake
* Dashboard perf settings save, visibility on none enabled
* Dashboard heigh stutter fixed, persist current tab
* restore binding
* wrapper async=false
* ScriptModel, centralized tabs/panes, individual toggle
* fixes, missed mediaUpdateInterval, passing values
---------
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'modules/dashboard/Tabs.qml')
| -rw-r--r-- | modules/dashboard/Tabs.qml | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/modules/dashboard/Tabs.qml b/modules/dashboard/Tabs.qml index 1d50d26..ed4613d 100644 --- a/modules/dashboard/Tabs.qml +++ b/modules/dashboard/Tabs.qml @@ -14,6 +14,8 @@ Item { required property real nonAnimWidth required property PersistentProperties state + required property var tabs + readonly property alias count: bar.count implicitHeight: bar.implicitHeight + indicator.implicitHeight + indicator.anchors.topMargin + separator.implicitHeight @@ -30,30 +32,18 @@ Item { onCurrentIndexChanged: root.state.currentTab = currentIndex - Tab { - iconName: "dashboard" - text: qsTr("Dashboard") - } - - Tab { - iconName: "queue_music" - text: qsTr("Media") - } + Repeater { + model: ScriptModel { + values: root.tabs + } - Tab { - iconName: "speed" - text: qsTr("Performance") - } + delegate: Tab { + required property var modelData - Tab { - iconName: "cloud" - text: qsTr("Weather") + iconName: modelData.iconName + text: modelData.text + } } - - // Tab { - // iconName: "workspaces" - // text: qsTr("Workspaces") - // } } Item { @@ -62,11 +52,13 @@ Item { anchors.top: bar.bottom anchors.topMargin: 5 - implicitWidth: bar.currentItem.implicitWidth + implicitWidth: bar.currentItem?.implicitWidth ?? 0 implicitHeight: 3 x: { const tab = bar.currentItem; + if (!tab) + return 0; const width = (root.nonAnimWidth - bar.spacing * (bar.count - 1)) / bar.count; return width * tab.TabBar.index + (width - tab.implicitWidth) / 2; } |