mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-15 07:35:20 -04:00
settings: add DankSpinner, re-org some settings
This commit is contained in:
@@ -98,7 +98,7 @@ FocusScope {
|
||||
visible: active
|
||||
focus: active
|
||||
|
||||
sourceComponent: CompositorTab {}
|
||||
sourceComponent: WorkspacesTab {}
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && item)
|
||||
@@ -106,6 +106,44 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: compositorLayoutLoader
|
||||
anchors.fill: parent
|
||||
active: root.currentIndex === 37
|
||||
visible: active
|
||||
focus: active
|
||||
|
||||
sourceComponent: CompositorLayoutTab {}
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && item)
|
||||
Qt.callLater(() => item.forceActiveFocus());
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: windowRulesLoader
|
||||
|
||||
property bool loadedOnce: false
|
||||
|
||||
anchors.fill: parent
|
||||
active: root.currentIndex === 38 || loadedOnce
|
||||
visible: root.currentIndex === 38 && status === Loader.Ready
|
||||
focus: visible
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: WindowRulesTab {
|
||||
pageActive: root.currentIndex === 38
|
||||
}
|
||||
|
||||
onLoaded: loadedOnce = true
|
||||
}
|
||||
|
||||
DankSpinner {
|
||||
anchors.centerIn: parent
|
||||
visible: root.currentIndex === 38 && windowRulesLoader.status === Loader.Loading
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: dankBarAppearanceLoader
|
||||
anchors.fill: parent
|
||||
@@ -388,7 +426,7 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Loader {
|
||||
id: defaultAppsLoader
|
||||
anchors.fill: parent
|
||||
active: root.currentIndex === 34
|
||||
@@ -474,12 +512,9 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
DankSpinner {
|
||||
anchors.centerIn: parent
|
||||
visible: root.currentIndex === 22 && widgetsLoader.status === Loader.Loading
|
||||
text: I18n.tr("Loading...", "loading indicator")
|
||||
color: Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
||||
@@ -102,6 +102,13 @@ Rectangle {
|
||||
"icon": "volume_up",
|
||||
"tabIndex": 15,
|
||||
"soundsOnly": true
|
||||
},
|
||||
{
|
||||
"id": "compositor_layout",
|
||||
"text": CompositorService.isNiri ? "niri" : (CompositorService.isHyprland ? "Hyprland" : "MangoWC"),
|
||||
"icon": "crop_square",
|
||||
"tabIndex": 37,
|
||||
"layoutCapable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -128,6 +135,12 @@ Rectangle {
|
||||
"icon": "widgets",
|
||||
"tabIndex": 22
|
||||
},
|
||||
{
|
||||
"id": "workspaces",
|
||||
"text": I18n.tr("Workspaces"),
|
||||
"icon": "view_module",
|
||||
"tabIndex": 4
|
||||
},
|
||||
{
|
||||
"id": "frame",
|
||||
"text": I18n.tr("Frame"),
|
||||
@@ -188,12 +201,6 @@ Rectangle {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "compositor",
|
||||
"text": I18n.tr("Compositor"),
|
||||
"icon": "layers",
|
||||
"tabIndex": 4
|
||||
},
|
||||
{
|
||||
"id": "keybinds",
|
||||
"text": I18n.tr("Keyboard Shortcuts"),
|
||||
@@ -259,6 +266,13 @@ Rectangle {
|
||||
"icon": "line_start",
|
||||
"tabIndex": 36,
|
||||
"autostartOnly": true
|
||||
},
|
||||
{
|
||||
"id": "window_rules",
|
||||
"text": I18n.tr("Window Rules"),
|
||||
"icon": "select_window",
|
||||
"tabIndex": 38,
|
||||
"windowRulesCapable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -372,6 +386,8 @@ Rectangle {
|
||||
return false;
|
||||
if (item.windowRulesCapable && !CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isMango)
|
||||
return false;
|
||||
if (item.layoutCapable && !CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isMango)
|
||||
return false;
|
||||
if (item.niriOnly && !CompositorService.isNiri)
|
||||
return false;
|
||||
if (item.clipboardOnly && (!DMSService.isConnected || DMSService.apiVersion < 23))
|
||||
@@ -544,8 +560,8 @@ Rectangle {
|
||||
return -1;
|
||||
|
||||
var normalized = name.toLowerCase().replace(/[_\-\s]/g, "");
|
||||
if (normalized === "workspaces")
|
||||
normalized = "compositor";
|
||||
if (normalized === "compositor")
|
||||
normalized = "workspaces";
|
||||
|
||||
for (var i = 0; i < categoryStructure.length; i++) {
|
||||
var cat = categoryStructure[i];
|
||||
|
||||
Reference in New Issue
Block a user