diff --git a/dots/.config/quickshell/ii/modules/common/Persistent.qml b/dots/.config/quickshell/ii/modules/common/Persistent.qml index 478cadd10..247884028 100644 --- a/dots/.config/quickshell/ii/modules/common/Persistent.qml +++ b/dots/.config/quickshell/ii/modules/common/Persistent.qml @@ -63,6 +63,10 @@ Singleton { property real temperature: 0.5 } + property JsonObject cheatsheet: JsonObject { + property int tabIndex: 0 + } + property JsonObject sidebar: JsonObject { property JsonObject bottomGroup: JsonObject { property bool collapsed: false diff --git a/dots/.config/quickshell/ii/modules/ii/cheatsheet/Cheatsheet.qml b/dots/.config/quickshell/ii/modules/ii/cheatsheet/Cheatsheet.qml index d133fa654..f7fb68f68 100644 --- a/dots/.config/quickshell/ii/modules/ii/cheatsheet/Cheatsheet.qml +++ b/dots/.config/quickshell/ii/modules/ii/cheatsheet/Cheatsheet.qml @@ -4,6 +4,7 @@ import qs.modules.common.widgets import QtQuick import QtQuick.Controls import QtQuick.Layouts +import Qt.labs.synchronizer import Qt5Compat.GraphicalEffects import Quickshell.Io import Quickshell @@ -135,7 +136,10 @@ Scope { // Scope ToolbarTabBar { id: tabBar tabButtonList: root.tabButtonList - currentIndex: swipeView.currentIndex + + Synchronizer on currentIndex { + property alias source: swipeView.currentIndex + } } } @@ -144,8 +148,11 @@ Scope { // Scope Layout.topMargin: 5 Layout.fillWidth: true Layout.fillHeight: true - currentIndex: tabBar.currentIndex spacing: 10 + currentIndex: Persistent.states.cheatsheet.tabIndex + onCurrentIndexChanged: { + Persistent.states.cheatsheet.tabIndex = currentIndex; + } implicitWidth: Math.max.apply(null, contentChildren.map(child => child.implicitWidth || 0)) implicitHeight: Math.max.apply(null, contentChildren.map(child => child.implicitHeight || 0))