1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

config refacotr: separate settings.json, session.json, appusage.json

This commit is contained in:
bbedward
2025-08-06 11:47:24 -04:00
parent defc50eec6
commit 18aa557ef1
45 changed files with 639 additions and 529 deletions

View File

@@ -62,11 +62,11 @@ PanelWindow {
AppLauncher {
id: appLauncher
viewMode: Prefs.appLauncherViewMode
viewMode: SettingsData.appLauncherViewMode
gridColumns: 4
onAppLaunched: appDrawerPopout.hide()
onViewModeSelected: function(mode) {
Prefs.setAppLauncherViewMode(mode);
SettingsData.setAppLauncherViewMode(mode);
}
}
@@ -514,7 +514,7 @@ PanelWindow {
return "push_pin";
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || "";
return Prefs.isPinnedApp(appId) ? "keep_off" : "push_pin";
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin";
}
size: Theme.iconSize - 2
color: Theme.surfaceText
@@ -528,7 +528,7 @@ PanelWindow {
return "Pin to Dock";
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || "";
return Prefs.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock";
return SessionData.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock";
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
@@ -549,10 +549,10 @@ PanelWindow {
return ;
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || "";
if (Prefs.isPinnedApp(appId))
Prefs.removePinnedApp(appId);
if (SessionData.isPinnedApp(appId))
SessionData.removePinnedApp(appId);
else
Prefs.addPinnedApp(appId);
SessionData.addPinnedApp(appId);
contextMenu.close();
}
}

View File

@@ -29,7 +29,7 @@ Item {
property var categoryIcons: categories.map((category) => {
return AppSearchService.getCategoryIcon(category);
})
property var appUsageRanking: Prefs.appUsageRanking
property var appUsageRanking: AppUsageHistoryData.appUsageRanking
property alias model: filteredModel
property var _watchApplications: AppSearchService.applications
@@ -144,7 +144,7 @@ Item {
appData.desktopEntry.execute();
appLaunched(appData);
Prefs.addAppUsage(appData.desktopEntry);
AppUsageHistoryData.addAppUsage(appData.desktopEntry);
}
function setCategory(category) {