forked from Shinonome/dots-hyprland
calendar: save expanded state
This commit is contained in:
@@ -10,6 +10,7 @@ import Todo from "../../services/todo.js";
|
|||||||
import { TodoWidget } from "./todolist.js";
|
import { TodoWidget } from "./todolist.js";
|
||||||
import { getCalendarLayout } from "./calendar_layout.js";
|
import { getCalendarLayout } from "./calendar_layout.js";
|
||||||
|
|
||||||
|
const AGS_CONFIG_FILE = `${App.configDir}/user_options.jsonc`;
|
||||||
let calendarJson = getCalendarLayout(undefined, true);
|
let calendarJson = getCalendarLayout(undefined, true);
|
||||||
let monthshift = 0;
|
let monthshift = 0;
|
||||||
|
|
||||||
@@ -203,6 +204,12 @@ export const ModuleCalendar = () => {
|
|||||||
className: 'margin-top-5 margin-left-5 margin-bottom-5',
|
className: 'margin-top-5 margin-left-5 margin-bottom-5',
|
||||||
onClicked: () => {
|
onClicked: () => {
|
||||||
mainStack.shown = (mainStack.shown == 'expanded') ? 'collapsed' : 'expanded';
|
mainStack.shown = (mainStack.shown == 'expanded') ? 'collapsed' : 'expanded';
|
||||||
|
Utils.execAsync(['bash', '-c', `${App.configDir}/scripts/ags/agsconfigurator.py \
|
||||||
|
--key "sidebar.calendar.expandByDefault" \
|
||||||
|
--value ${!userOptions.sidebar.calendar.expandByDefault} \
|
||||||
|
--file ${AGS_CONFIG_FILE}`
|
||||||
|
]).catch(print);
|
||||||
|
|
||||||
},
|
},
|
||||||
setup: setupCursorHover,
|
setup: setupCursorHover,
|
||||||
child: Box({
|
child: Box({
|
||||||
@@ -258,9 +265,7 @@ export const ModuleCalendar = () => {
|
|||||||
},
|
},
|
||||||
transition: 'slide_up_down',
|
transition: 'slide_up_down',
|
||||||
transitionDuration: userOptions.animations.durationLarge,
|
transitionDuration: userOptions.animations.durationLarge,
|
||||||
setup: (stack) => Utils.timeout(1, () => {
|
shown: userOptions.sidebar.calendar.expandByDefault ? 'expanded' : 'collapsed',
|
||||||
stack.shown = userOptions.sidebar.calendar.expandByDefault ? 'expanded' : 'collapsed';
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return mainStack;
|
return mainStack;
|
||||||
|
|||||||
Reference in New Issue
Block a user