diff options
| author | Robin Seger <pixelkhaos@gmail.com> | 2026-03-15 07:19:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-15 17:19:44 +1100 |
| commit | 12b07b7cdfa9de0e7f78b7168fc2cee358002167 (patch) | |
| tree | cdc94cd7024378f2f8dc06957ad5f79ee07aca11 /modules/dashboard/Tabs.qml | |
| parent | fix: performance network usage jumping around (diff) | |
| download | caelestia-shell-12b07b7cdfa9de0e7f78b7168fc2cee358002167.tar.gz caelestia-shell-12b07b7cdfa9de0e7f78b7168fc2cee358002167.tar.bz2 caelestia-shell-12b07b7cdfa9de0e7f78b7168fc2cee358002167.zip | |
dash: use currentIndex for width, restore binding (#1286)
* [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
* add binding back, ensure active tab uses bar.currentIndex
---------
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 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/dashboard/Tabs.qml b/modules/dashboard/Tabs.qml index ed4613d..6e09e76 100644 --- a/modules/dashboard/Tabs.qml +++ b/modules/dashboard/Tabs.qml @@ -52,15 +52,20 @@ Item { anchors.top: bar.bottom anchors.topMargin: 5 - implicitWidth: bar.currentItem?.implicitWidth ?? 0 + implicitWidth: { + const tab = bar.currentItem; + if (tab) + return tab.implicitWidth; + const width = (root.nonAnimWidth - bar.spacing * (bar.count - 1)) / bar.count; + return width; + } 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; + const tabWidth = tab?.implicitWidth ?? width; + return width * bar.currentIndex + (width - tabWidth) / 2; } clip: true |