init waffles

This commit is contained in:
end-4
2025-11-10 20:45:38 +01:00
parent f98c422254
commit 58980959aa
18 changed files with 463 additions and 14 deletions
+35
View File
@@ -28,12 +28,18 @@ import qs.modules.ii.overlay
import qs.modules.ii.verticalBar
import qs.modules.ii.wallpaperSelector
import qs.modules.waffle.bar
import QtQuick
import QtQuick.Window
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
import qs.services
ShellRoot {
id: root
// Force initialization of some singletons
Component.onCompleted: {
MaterialThemeLoader.reapplyTheme()
@@ -67,11 +73,40 @@ ShellRoot {
PanelLoader { identifier: "iiSidebarRight"; component: SidebarRight {} }
PanelLoader { identifier: "iiVerticalBar"; extraCondition: Config.options.bar.vertical; component: VerticalBar {} }
PanelLoader { identifier: "iiWallpaperSelector"; component: WallpaperSelector {} }
PanelLoader { identifier: "wBar"; component: WaffleBar {} }
component PanelLoader: LazyLoader {
required property string identifier
property bool extraCondition: true
active: Config.ready && Config.options.enabledPanels.includes(identifier) && extraCondition
}
// Panel families
property list<string> families: ["ii", "waffle"]
property var panelFamilies: ({
"ii": ["iiBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiReloadPopup", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiVerticalBar", "iiWallpaperSelector"],
"waffle": ["wBar", "iiBackground", "iiCheatsheet", "iiDock", "iiLock", "iiMediaControls", "iiNotificationPopup", "iiOnScreenDisplay", "iiOnScreenKeyboard", "iiOverlay", "iiOverview", "iiPolkit", "iiRegionSelector", "iiReloadPopup", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiWallpaperSelector"],
})
function cyclePanelFamily() {
const currentIndex = families.indexOf(Config.options.panelFamily)
const nextIndex = (currentIndex + 1) % families.length
Config.options.panelFamily = families[nextIndex]
Config.options.enabledPanels = panelFamilies[Config.options.panelFamily]
}
IpcHandler {
target: "panelFamily"
function cycle(): void {
root.cyclePanelFamily()
}
}
GlobalShortcut {
name: "panelFamilyCycle"
description: "Cycles panel family"
onPressed: root.cyclePanelFamily()
}
}