mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
desktop widgets: add grid/grid size hints
This commit is contained in:
@@ -447,6 +447,21 @@ Singleton {
|
||||
property var systemMonitorDisplayPreferences: ["all"]
|
||||
property var systemMonitorVariants: []
|
||||
property var desktopWidgetPositions: ({})
|
||||
property var desktopWidgetGridSettings: ({})
|
||||
|
||||
function getDesktopWidgetGridSetting(screenKey, property, defaultValue) {
|
||||
const val = desktopWidgetGridSettings?.[screenKey]?.[property];
|
||||
return val !== undefined ? val : defaultValue;
|
||||
}
|
||||
|
||||
function setDesktopWidgetGridSetting(screenKey, property, value) {
|
||||
const allSettings = JSON.parse(JSON.stringify(desktopWidgetGridSettings || {}));
|
||||
if (!allSettings[screenKey])
|
||||
allSettings[screenKey] = {};
|
||||
allSettings[screenKey][property] = value;
|
||||
desktopWidgetGridSettings = allSettings;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function getDesktopWidgetPosition(pluginId, screenKey, property, defaultValue) {
|
||||
const pos = desktopWidgetPositions?.[pluginId]?.[screenKey]?.[property];
|
||||
|
||||
@@ -341,7 +341,8 @@ var SPEC = {
|
||||
systemMonitorHeight: { def: 480 },
|
||||
systemMonitorDisplayPreferences: { def: ["all"] },
|
||||
systemMonitorVariants: { def: [] },
|
||||
desktopWidgetPositions: { def: {} }
|
||||
desktopWidgetPositions: { def: {} },
|
||||
desktopWidgetGridSettings: { def: {} }
|
||||
};
|
||||
|
||||
function getValidKeys() {
|
||||
|
||||
Reference in New Issue
Block a user