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>
This commit is contained in:
Robin Seger 2026-03-15 07:19:44 +01:00 committed by GitHub
parent d97ba8a9c0
commit 12b07b7cdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -52,15 +52,20 @@ Item {
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.topMargin: 5 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 implicitHeight: 3
x: { x: {
const tab = bar.currentItem; const tab = bar.currentItem;
if (!tab)
return 0;
const width = (root.nonAnimWidth - bar.spacing * (bar.count - 1)) / bar.count; 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 clip: true

View file

@ -82,6 +82,7 @@ Item {
running: true running: true
interval: Appearance.anim.durations.extraLarge interval: Appearance.anim.durations.extraLarge
onTriggered: { onTriggered: {
content.active = Qt.binding(() => (root.visibilities.dashboard && Config.dashboard.enabled) || root.visible);
content.visible = true; content.visible = true;
} }
} }