forked from Shinonome/dots-hyprland
group panels more properly
This commit is contained in:
@@ -6,51 +6,22 @@
|
||||
// Adjust this to make the shell smaller or larger
|
||||
//@ pragma Env QT_SCALE_FACTOR=1
|
||||
|
||||
import qs.modules.common
|
||||
import qs.modules.ii.background
|
||||
import qs.modules.ii.bar
|
||||
import qs.modules.ii.cheatsheet
|
||||
import qs.modules.ii.dock
|
||||
import qs.modules.ii.lock
|
||||
import qs.modules.ii.mediaControls
|
||||
import qs.modules.ii.notificationPopup
|
||||
import qs.modules.ii.onScreenDisplay
|
||||
import qs.modules.ii.onScreenKeyboard
|
||||
import qs.modules.ii.overview
|
||||
import qs.modules.ii.polkit
|
||||
import qs.modules.ii.regionSelector
|
||||
import qs.modules.ii.screenCorners
|
||||
import qs.modules.ii.sessionScreen
|
||||
import qs.modules.ii.sidebarLeft
|
||||
import qs.modules.ii.sidebarRight
|
||||
import qs.modules.ii.overlay
|
||||
import qs.modules.ii.verticalBar
|
||||
import qs.modules.ii.wallpaperSelector
|
||||
|
||||
import qs.modules.waffle.actionCenter
|
||||
import qs.modules.waffle.background
|
||||
import qs.modules.waffle.bar
|
||||
import qs.modules.waffle.lock
|
||||
import qs.modules.waffle.notificationCenter
|
||||
import qs.modules.waffle.notificationPopup
|
||||
import qs.modules.waffle.onScreenDisplay
|
||||
import qs.modules.waffle.polkit
|
||||
import qs.modules.waffle.screenSnip
|
||||
import qs.modules.waffle.startMenu
|
||||
import qs.modules.waffle.sessionScreen
|
||||
import qs.modules.waffle.taskView
|
||||
import "modules/common"
|
||||
import "services"
|
||||
import "panelFamilies"
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Hyprland
|
||||
import qs.services
|
||||
|
||||
ShellRoot {
|
||||
id: root
|
||||
|
||||
// Force initialization of some singletons
|
||||
// Stuff for every panel family
|
||||
ReloadPopup {}
|
||||
|
||||
Component.onCompleted: {
|
||||
MaterialThemeLoader.reapplyTheme()
|
||||
Hyprsunset.load()
|
||||
@@ -61,62 +32,33 @@ ShellRoot {
|
||||
Updates.load()
|
||||
}
|
||||
|
||||
// Load enabled stuff
|
||||
// Well, these loaders only *allow* them to be loaded, to always load or not is defined in each component
|
||||
// The media controls for example is not loaded if it's not opened
|
||||
PanelLoader { identifier: "iiBar"; extraCondition: !Config.options.bar.vertical; component: Bar {} }
|
||||
PanelLoader { identifier: "iiBackground"; component: Background {} }
|
||||
PanelLoader { identifier: "iiCheatsheet"; component: Cheatsheet {} }
|
||||
PanelLoader { identifier: "iiDock"; extraCondition: Config.options.dock.enable; component: Dock {} }
|
||||
PanelLoader { identifier: "iiLock"; component: Lock {} }
|
||||
PanelLoader { identifier: "iiMediaControls"; component: MediaControls {} }
|
||||
PanelLoader { identifier: "iiNotificationPopup"; component: NotificationPopup {} }
|
||||
PanelLoader { identifier: "iiOnScreenDisplay"; component: OnScreenDisplay {} }
|
||||
PanelLoader { identifier: "iiOnScreenKeyboard"; component: OnScreenKeyboard {} }
|
||||
PanelLoader { identifier: "iiOverlay"; component: Overlay {} }
|
||||
PanelLoader { identifier: "iiOverview"; component: Overview {} }
|
||||
PanelLoader { identifier: "iiPolkit"; component: Polkit {} }
|
||||
PanelLoader { identifier: "iiRegionSelector"; component: RegionSelector {} }
|
||||
PanelLoader { identifier: "iiScreenCorners"; component: ScreenCorners {} }
|
||||
PanelLoader { identifier: "iiSessionScreen"; component: SessionScreen {} }
|
||||
PanelLoader { identifier: "iiSidebarLeft"; component: SidebarLeft {} }
|
||||
PanelLoader { identifier: "iiSidebarRight"; component: SidebarRight {} }
|
||||
PanelLoader { identifier: "iiVerticalBar"; extraCondition: Config.options.bar.vertical; component: VerticalBar {} }
|
||||
PanelLoader { identifier: "iiWallpaperSelector"; component: WallpaperSelector {} }
|
||||
|
||||
PanelLoader { identifier: "wActionCenter"; component: WaffleActionCenter {} }
|
||||
PanelLoader { identifier: "wBar"; component: WaffleBar {} }
|
||||
PanelLoader { identifier: "wBackground"; component: WaffleBackground {} }
|
||||
PanelLoader { identifier: "wLock"; component: WaffleLock {} }
|
||||
PanelLoader { identifier: "wNotificationCenter"; component: WaffleNotificationCenter {} }
|
||||
PanelLoader { identifier: "wNotificationPopup"; component: WaffleNotificationPopup {} }
|
||||
PanelLoader { identifier: "wOnScreenDisplay"; component: WaffleOSD {} }
|
||||
PanelLoader { identifier: "wPolkit"; component: WafflePolkit {} }
|
||||
PanelLoader { identifier: "wScreenSnip"; component: WScreenSnip {} }
|
||||
PanelLoader { identifier: "wStartMenu"; component: WaffleStartMenu {} }
|
||||
PanelLoader { identifier: "wSessionScreen"; component: WaffleSessionScreen {} }
|
||||
PanelLoader { identifier: "wTaskView"; component: WaffleTaskView {} }
|
||||
ReloadPopup {}
|
||||
|
||||
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", "iiScreenCorners", "iiSessionScreen", "iiSidebarLeft", "iiSidebarRight", "iiVerticalBar", "iiWallpaperSelector"],
|
||||
"waffle": ["wActionCenter", "wBar", "wBackground", "wLock", "wNotificationCenter", "wNotificationPopup", "wOnScreenDisplay", "wTaskView", "wPolkit", "wScreenSnip", "wSessionScreen", "wStartMenu", "iiCheatsheet", "iiOnScreenKeyboard", "iiOverlay", "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]
|
||||
}
|
||||
|
||||
component PanelFamilyLoader: LazyLoader {
|
||||
required property string identifier
|
||||
property bool extraCondition: true
|
||||
active: Config.ready && Config.options.panelFamily === identifier && extraCondition
|
||||
}
|
||||
|
||||
PanelFamilyLoader {
|
||||
identifier: "ii"
|
||||
component: IllogicalImpulseFamily {}
|
||||
}
|
||||
|
||||
PanelFamilyLoader {
|
||||
identifier: "waffle"
|
||||
component: WaffleFamily {}
|
||||
}
|
||||
|
||||
|
||||
// Shortcuts
|
||||
IpcHandler {
|
||||
target: "panelFamily"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user