mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 09:12:08 -04:00
feat(Settings): Add sidebar state management on categories
This commit is contained in:
@@ -134,6 +134,8 @@ Singleton {
|
|||||||
property string launcherLastMode: "all"
|
property string launcherLastMode: "all"
|
||||||
property string appDrawerLastMode: "apps"
|
property string appDrawerLastMode: "apps"
|
||||||
property string niriOverviewLastMode: "apps"
|
property string niriOverviewLastMode: "apps"
|
||||||
|
property string settingsSidebarExpandedIds: ","
|
||||||
|
property string settingsSidebarCollapsedIds: ","
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (!isGreeterMode) {
|
if (!isGreeterMode) {
|
||||||
@@ -1104,6 +1106,12 @@ Singleton {
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setSettingsSidebarState(expandedIds, collapsedIds) {
|
||||||
|
settingsSidebarExpandedIds = expandedIds;
|
||||||
|
settingsSidebarCollapsedIds = collapsedIds;
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
function syncWallpaperForCurrentMode() {
|
function syncWallpaperForCurrentMode() {
|
||||||
if (!perModeWallpaper)
|
if (!perModeWallpaper)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -84,7 +84,10 @@ var SPEC = {
|
|||||||
|
|
||||||
launcherLastMode: { def: "all" },
|
launcherLastMode: { def: "all" },
|
||||||
appDrawerLastMode: { def: "apps" },
|
appDrawerLastMode: { def: "apps" },
|
||||||
niriOverviewLastMode: { def: "apps" }
|
niriOverviewLastMode: { def: "apps" },
|
||||||
|
|
||||||
|
settingsSidebarExpandedIds: { def: "," },
|
||||||
|
settingsSidebarCollapsedIds: { def: "," }
|
||||||
};
|
};
|
||||||
|
|
||||||
function getValidKeys() {
|
function getValidKeys() {
|
||||||
|
|||||||
@@ -370,6 +370,7 @@ Rectangle {
|
|||||||
if (_collapsedIds.indexOf(marker) < 0)
|
if (_collapsedIds.indexOf(marker) < 0)
|
||||||
_collapsedIds = _collapsedIds + id + ",";
|
_collapsedIds = _collapsedIds + id + ",";
|
||||||
}
|
}
|
||||||
|
SessionData.setSettingsSidebarState(_expandedIds, _collapsedIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _setAutoExpanded(id, value) {
|
function _setAutoExpanded(id, value) {
|
||||||
@@ -538,6 +539,11 @@ Rectangle {
|
|||||||
color: Theme.surfaceContainer
|
color: Theme.surfaceContainer
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
root._expandedIds = SessionData.settingsSidebarExpandedIds;
|
||||||
|
root._collapsedIds = SessionData.settingsSidebarCollapsedIds;
|
||||||
|
}
|
||||||
|
|
||||||
StyledTextMetrics {
|
StyledTextMetrics {
|
||||||
id: __m1
|
id: __m1
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
|
|||||||
Reference in New Issue
Block a user