diff options
| -rw-r--r-- | modules/dashboard/Tabs.qml | 13 | ||||
| -rw-r--r-- | modules/dashboard/Wrapper.qml | 1 |
2 files changed, 10 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 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; } } |