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:
parent
d97ba8a9c0
commit
12b07b7cdf
2 changed files with 10 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue