forked from Shinonome/dots-hyprland
introduce persistent states (persistence to be added)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user