introduce persistent states (persistence to be added)

This commit is contained in:
end-4
2025-05-10 21:23:47 +02:00
parent b05049dedf
commit dc903de212
2 changed files with 15 additions and 2 deletions
@@ -0,0 +1,13 @@
import QtQuick
import Quickshell
pragma Singleton
pragma ComponentBehavior: Bound
Singleton {
property QtObject sidebar: QtObject {
property QtObject bottomGroup: QtObject {
property bool collapsed: false
}
}
}
@@ -15,7 +15,7 @@ Rectangle {
clip: true
implicitHeight: collapsed ? collapsedBottomWidgetGroupRow.implicitHeight : bottomWidgetGroupRow.implicitHeight
property int selectedTab: 0
property bool collapsed: false
property bool collapsed: PersistentStates.sidebar.bottomGroup.collapsed
property var tabs: [
{"type": "calendar", "name": "Calendar", "icon": "calendar_month", "widget": calendarWidget},
{"type": "todo", "name": "To Do", "icon": "done_outline", "widget": todoWidget}
@@ -35,7 +35,7 @@ Rectangle {
}
function setCollapsed(state) {
collapsed = state
PersistentStates.sidebar.bottomGroup.collapsed = state
if (collapsed) {
bottomWidgetGroupRow.opacity = 0
}