From 12b07b7cdfa9de0e7f78b7168fc2cee358002167 Mon Sep 17 00:00:00 2001 From: Robin Seger Date: Sun, 15 Mar 2026 07:19:44 +0100 Subject: 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> --- modules/dashboard/Tabs.qml | 13 +++++++++---- modules/dashboard/Wrapper.qml | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'modules') 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 diff --git a/modules/dashboard/Wrapper.qml b/modules/dashboard/Wrapper.qml index 81bfcd3..0e37909 100644 --- a/modules/dashboard/Wrapper.qml +++ b/modules/dashboard/Wrapper.qml @@ -82,6 +82,7 @@ Item { running: true interval: Appearance.anim.durations.extraLarge onTriggered: { + content.active = Qt.binding(() => (root.visibilities.dashboard && Config.dashboard.enabled) || root.visible); content.visible = true; } } -- cgit v1.2.3-freya