forked from Shinonome/dots-hyprland
persistent cheatsheet tabs (closes #2681)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user