summaryrefslogtreecommitdiff
path: root/modules/dashboard/Tabs.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 11:43:09 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-26 11:43:09 +0800
commitdaf92f36e1b1eee63b1b6a4c3b36a47c34809ac3 (patch)
tree6a99416823df50363157f0b32f39266d158e7720 /modules/dashboard/Tabs.qml
parentdashboard: better media panel (diff)
downloadcaelestia-shell-daf92f36e1b1eee63b1b6a4c3b36a47c34809ac3.tar.gz
caelestia-shell-daf92f36e1b1eee63b1b6a4c3b36a47c34809ac3.tar.bz2
caelestia-shell-daf92f36e1b1eee63b1b6a4c3b36a47c34809ac3.zip
dashboard: fix tab indicator animation
Diffstat (limited to 'modules/dashboard/Tabs.qml')
-rw-r--r--modules/dashboard/Tabs.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/dashboard/Tabs.qml b/modules/dashboard/Tabs.qml
index f50639c..d33940a 100644
--- a/modules/dashboard/Tabs.qml
+++ b/modules/dashboard/Tabs.qml
@@ -8,9 +8,10 @@ import QtQuick.Controls
Item {
id: root
+ required property real nonAnimWidth
property alias currentIndex: bar.currentIndex
- implicitHeight: bar.height + indicator.height + indicator.anchors.topMargin + separator.height
+ implicitHeight: bar.implicitHeight + indicator.implicitHeight + indicator.anchors.topMargin + separator.implicitHeight
TabBar {
id: bar
@@ -53,7 +54,8 @@ Item {
x: {
const tab = bar.currentItem;
- return tab.x + (tab.width - tab.implicitWidth) / 2;
+ const width = (root.nonAnimWidth - DashboardConfig.sizes.tabIndicatorSpacing * (bar.count - 1) * 2) / bar.count
+ return width * tab.TabBar.index + (width - tab.implicitWidth) / 2;
}
clip: true