mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
controlcenter: fix trigger position via IPC
This commit is contained in:
954
DMSShell.qml
954
DMSShell.qml
@@ -25,515 +25,517 @@ import qs.Modules.DankBar.Popouts
|
|||||||
import qs.Modules.Plugins
|
import qs.Modules.Plugins
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
Instantiator {
|
Instantiator {
|
||||||
id: daemonPluginInstantiator
|
id: daemonPluginInstantiator
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
model: Object.keys(PluginService.pluginDaemonComponents)
|
model: Object.keys(PluginService.pluginDaemonComponents)
|
||||||
|
|
||||||
delegate: Loader {
|
delegate: Loader {
|
||||||
id: daemonLoader
|
id: daemonLoader
|
||||||
property string pluginId: modelData
|
property string pluginId: modelData
|
||||||
sourceComponent: PluginService.pluginDaemonComponents[pluginId]
|
sourceComponent: PluginService.pluginDaemonComponents[pluginId]
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
if (item) {
|
if (item) {
|
||||||
item.pluginService = PluginService
|
item.pluginService = PluginService
|
||||||
if (item.popoutService !== undefined) {
|
if (item.popoutService !== undefined) {
|
||||||
item.popoutService = PopoutService
|
item.popoutService = PopoutService
|
||||||
}
|
}
|
||||||
item.pluginId = pluginId
|
item.pluginId = pluginId
|
||||||
console.log("Daemon plugin loaded:", pluginId)
|
console.log("Daemon plugin loaded:", pluginId)
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WallpaperBackground {}
|
|
||||||
|
|
||||||
Lock {
|
|
||||||
id: lock
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: dankBarLoader
|
|
||||||
asynchronous: false
|
|
||||||
|
|
||||||
property var currentPosition: SettingsData.dankBarPosition
|
|
||||||
property bool initialized: false
|
|
||||||
|
|
||||||
sourceComponent: DankBar {
|
|
||||||
onColorPickerRequested: {
|
|
||||||
if (colorPickerModal.shouldBeVisible) {
|
|
||||||
colorPickerModal.close()
|
|
||||||
} else {
|
|
||||||
colorPickerModal.show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
initialized = true
|
|
||||||
}
|
|
||||||
|
|
||||||
onCurrentPositionChanged: {
|
|
||||||
if (!initialized) return
|
|
||||||
|
|
||||||
const component = sourceComponent
|
|
||||||
sourceComponent = null
|
|
||||||
sourceComponent = component
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: dockLoader
|
|
||||||
active: true
|
|
||||||
asynchronous: false
|
|
||||||
|
|
||||||
property var currentPosition: SettingsData.dockPosition
|
|
||||||
property bool initialized: false
|
|
||||||
|
|
||||||
sourceComponent: Dock {
|
|
||||||
contextMenu: dockContextMenuLoader.item ? dockContextMenuLoader.item : null
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoaded: {
|
|
||||||
if (item) {
|
|
||||||
dockContextMenuLoader.active = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
initialized = true
|
|
||||||
}
|
|
||||||
|
|
||||||
onCurrentPositionChanged: {
|
|
||||||
if (!initialized) return
|
|
||||||
|
|
||||||
console.log("DEBUG: Dock position changed to:", currentPosition, "- recreating dock")
|
|
||||||
const comp = sourceComponent
|
|
||||||
sourceComponent = null
|
|
||||||
sourceComponent = comp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: dankDashPopoutLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: Component {
|
|
||||||
DankDashPopout {
|
|
||||||
id: dankDashPopout
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.dankDashPopout = dankDashPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: dockContextMenuLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
DockContextMenu {
|
|
||||||
id: dockContextMenu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: notificationCenterLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
NotificationCenterPopout {
|
|
||||||
id: notificationCenter
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.notificationCenterPopout = notificationCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
model: SettingsData.getFilteredScreens("notifications")
|
|
||||||
|
|
||||||
delegate: NotificationPopupManager {
|
|
||||||
modelData: item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: controlCenterLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
property var modalRef: colorPickerModal
|
|
||||||
property LazyLoader powerModalLoaderRef: powerMenuModalLoader
|
|
||||||
|
|
||||||
ControlCenterPopout {
|
|
||||||
id: controlCenterPopout
|
|
||||||
colorPickerModal: controlCenterLoader.modalRef
|
|
||||||
powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef
|
|
||||||
|
|
||||||
onLockRequested: {
|
|
||||||
lock.activate()
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.controlCenterPopout = controlCenterPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: wifiPasswordModalLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
WifiPasswordModal {
|
|
||||||
id: wifiPasswordModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.wifiPasswordModal = wifiPasswordModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: networkInfoModalLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
NetworkInfoModal {
|
|
||||||
id: networkInfoModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.networkInfoModal = networkInfoModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: batteryPopoutLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
BatteryPopout {
|
|
||||||
id: batteryPopout
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.batteryPopout = batteryPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: vpnPopoutLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
VpnPopout {
|
|
||||||
id: vpnPopout
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.vpnPopout = vpnPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: powerMenuLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
PowerMenu {
|
|
||||||
id: powerMenu
|
|
||||||
|
|
||||||
onPowerActionRequested: (action, title, message) => {
|
|
||||||
if (SettingsData.powerActionConfirm) {
|
|
||||||
powerConfirmModalLoader.active = true
|
|
||||||
if (powerConfirmModalLoader.item) {
|
|
||||||
powerConfirmModalLoader.item.confirmButtonColor = action === "poweroff" ? Theme.error : action === "reboot" ? Theme.warning : Theme.primary
|
|
||||||
powerConfirmModalLoader.item.show(title, message, () => actionApply(action), function () {})
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
actionApply(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function actionApply(action) {
|
|
||||||
switch (action) {
|
|
||||||
case "logout":
|
|
||||||
SessionService.logout()
|
|
||||||
break
|
|
||||||
case "suspend":
|
|
||||||
SessionService.suspend()
|
|
||||||
break
|
|
||||||
case "hibernate":
|
|
||||||
SessionService.hibernate()
|
|
||||||
break
|
|
||||||
case "reboot":
|
|
||||||
SessionService.reboot()
|
|
||||||
break
|
|
||||||
case "poweroff":
|
|
||||||
SessionService.poweroff()
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
WallpaperBackground {}
|
||||||
id: powerConfirmModalLoader
|
|
||||||
|
|
||||||
active: false
|
Lock {
|
||||||
|
id: lock
|
||||||
|
}
|
||||||
|
|
||||||
ConfirmModal {
|
Loader {
|
||||||
id: powerConfirmModal
|
id: dankBarLoader
|
||||||
}
|
asynchronous: false
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
property var currentPosition: SettingsData.dankBarPosition
|
||||||
id: processListPopoutLoader
|
property bool initialized: false
|
||||||
|
|
||||||
active: false
|
sourceComponent: DankBar {
|
||||||
|
onColorPickerRequested: {
|
||||||
ProcessListPopout {
|
if (colorPickerModal.shouldBeVisible) {
|
||||||
id: processListPopout
|
colorPickerModal.close()
|
||||||
|
} else {
|
||||||
Component.onCompleted: {
|
colorPickerModal.show()
|
||||||
PopoutService.processListPopout = processListPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsModal {
|
|
||||||
id: settingsModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.settingsModal = settingsModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: appDrawerLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
AppDrawerPopout {
|
|
||||||
id: appDrawerPopout
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.appDrawerPopout = appDrawerPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SpotlightModal {
|
|
||||||
id: spotlightModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.spotlightModal = spotlightModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ClipboardHistoryModal {
|
|
||||||
id: clipboardHistoryModalPopup
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.clipboardHistoryModal = clipboardHistoryModalPopup
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationModal {
|
|
||||||
id: notificationModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.notificationModal = notificationModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankColorPickerModal {
|
|
||||||
id: colorPickerModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.colorPickerModal = colorPickerModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: processListModalLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
ProcessListModal {
|
|
||||||
id: processListModal
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.processListModal = processListModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: systemUpdateLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
SystemUpdatePopout {
|
|
||||||
id: systemUpdatePopout
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
PopoutService.systemUpdatePopout = systemUpdatePopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
|
||||||
id: notepadSlideoutVariants
|
|
||||||
model: SettingsData.getFilteredScreens("notepad")
|
|
||||||
|
|
||||||
delegate: DankSlideout {
|
|
||||||
id: notepadSlideout
|
|
||||||
modelData: item
|
|
||||||
title: I18n.tr("Notepad")
|
|
||||||
slideoutWidth: 480
|
|
||||||
expandable: true
|
|
||||||
expandedWidthValue: 960
|
|
||||||
customTransparency: SettingsData.notepadTransparencyOverride
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Notepad {
|
|
||||||
onHideRequested: {
|
|
||||||
notepadSlideout.hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (isVisible) {
|
|
||||||
hide()
|
|
||||||
} else {
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: powerMenuModalLoader
|
|
||||||
|
|
||||||
active: false
|
|
||||||
|
|
||||||
PowerMenuModal {
|
|
||||||
id: powerMenuModal
|
|
||||||
|
|
||||||
onPowerActionRequested: (action, title, message) => {
|
|
||||||
if (SettingsData.powerActionConfirm) {
|
|
||||||
powerConfirmModalLoader.active = true
|
|
||||||
if (powerConfirmModalLoader.item) {
|
|
||||||
powerConfirmModalLoader.item.confirmButtonColor = action === "poweroff" ? Theme.error : action === "reboot" ? Theme.warning : Theme.primary
|
|
||||||
powerConfirmModalLoader.item.show(title, message, () => actionApply(action), function () {})
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
actionApply(action)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function actionApply(action) {
|
|
||||||
switch (action) {
|
|
||||||
case "logout":
|
|
||||||
SessionService.logout()
|
|
||||||
break
|
|
||||||
case "suspend":
|
|
||||||
SessionService.suspend()
|
|
||||||
break
|
|
||||||
case "hibernate":
|
|
||||||
SessionService.hibernate()
|
|
||||||
break
|
|
||||||
case "reboot":
|
|
||||||
SessionService.reboot()
|
|
||||||
break
|
|
||||||
case "poweroff":
|
|
||||||
SessionService.poweroff()
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
PopoutService.powerMenuModal = powerMenuModal
|
initialized = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onCurrentPositionChanged: {
|
||||||
|
if (!initialized)
|
||||||
|
return
|
||||||
|
|
||||||
|
const component = sourceComponent
|
||||||
|
sourceComponent = null
|
||||||
|
sourceComponent = component
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
Loader {
|
||||||
id: hyprKeybindsModalLoader
|
id: dockLoader
|
||||||
|
active: true
|
||||||
|
asynchronous: false
|
||||||
|
|
||||||
active: false
|
property var currentPosition: SettingsData.dockPosition
|
||||||
|
property bool initialized: false
|
||||||
|
|
||||||
HyprKeybindsModal {
|
sourceComponent: Dock {
|
||||||
id: hyprKeybindsModal
|
contextMenu: dockContextMenuLoader.item ? dockContextMenuLoader.item : null
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
onLoaded: {
|
||||||
PopoutService.hyprKeybindsModal = hyprKeybindsModal
|
if (item) {
|
||||||
}
|
dockContextMenuLoader.active = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DMSShellIPC {
|
Component.onCompleted: {
|
||||||
powerMenuModalLoader: powerMenuModalLoader
|
initialized = true
|
||||||
processListModalLoader: processListModalLoader
|
}
|
||||||
controlCenterLoader: controlCenterLoader
|
|
||||||
dankDashPopoutLoader: dankDashPopoutLoader
|
|
||||||
notepadSlideoutVariants: notepadSlideoutVariants
|
|
||||||
hyprKeybindsModalLoader: hyprKeybindsModalLoader
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
onCurrentPositionChanged: {
|
||||||
model: SettingsData.getFilteredScreens("toast")
|
if (!initialized)
|
||||||
|
return
|
||||||
|
|
||||||
delegate: Toast {
|
console.log("DEBUG: Dock position changed to:", currentPosition, "- recreating dock")
|
||||||
modelData: item
|
const comp = sourceComponent
|
||||||
visible: ToastService.toastVisible
|
sourceComponent = null
|
||||||
}
|
sourceComponent = comp
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Variants {
|
Loader {
|
||||||
model: SettingsData.getFilteredScreens("osd")
|
id: dankDashPopoutLoader
|
||||||
|
|
||||||
delegate: VolumeOSD {
|
active: false
|
||||||
modelData: item
|
asynchronous: true
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
sourceComponent: Component {
|
||||||
model: SettingsData.getFilteredScreens("osd")
|
DankDashPopout {
|
||||||
|
id: dankDashPopout
|
||||||
|
|
||||||
delegate: MicMuteOSD {
|
Component.onCompleted: {
|
||||||
modelData: item
|
PopoutService.dankDashPopout = dankDashPopout
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Variants {
|
LazyLoader {
|
||||||
model: SettingsData.getFilteredScreens("osd")
|
id: dockContextMenuLoader
|
||||||
|
|
||||||
delegate: BrightnessOSD {
|
active: false
|
||||||
modelData: item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Variants {
|
DockContextMenu {
|
||||||
model: SettingsData.getFilteredScreens("osd")
|
id: dockContextMenu
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delegate: IdleInhibitorOSD {
|
LazyLoader {
|
||||||
modelData: item
|
id: notificationCenterLoader
|
||||||
}
|
|
||||||
}
|
active: false
|
||||||
|
|
||||||
|
NotificationCenterPopout {
|
||||||
|
id: notificationCenter
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.notificationCenterPopout = notificationCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("notifications")
|
||||||
|
|
||||||
|
delegate: NotificationPopupManager {
|
||||||
|
modelData: item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: controlCenterLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
property var modalRef: colorPickerModal
|
||||||
|
property LazyLoader powerModalLoaderRef: powerMenuModalLoader
|
||||||
|
|
||||||
|
ControlCenterPopout {
|
||||||
|
id: controlCenterPopout
|
||||||
|
colorPickerModal: controlCenterLoader.modalRef
|
||||||
|
powerMenuModalLoader: controlCenterLoader.powerModalLoaderRef
|
||||||
|
|
||||||
|
onLockRequested: {
|
||||||
|
lock.activate()
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.controlCenterPopout = controlCenterPopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: wifiPasswordModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
WifiPasswordModal {
|
||||||
|
id: wifiPasswordModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.wifiPasswordModal = wifiPasswordModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: networkInfoModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
NetworkInfoModal {
|
||||||
|
id: networkInfoModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.networkInfoModal = networkInfoModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: batteryPopoutLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
BatteryPopout {
|
||||||
|
id: batteryPopout
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.batteryPopout = batteryPopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: vpnPopoutLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
VpnPopout {
|
||||||
|
id: vpnPopout
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.vpnPopout = vpnPopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: powerMenuLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
PowerMenu {
|
||||||
|
id: powerMenu
|
||||||
|
|
||||||
|
onPowerActionRequested: (action, title, message) => {
|
||||||
|
if (SettingsData.powerActionConfirm) {
|
||||||
|
powerConfirmModalLoader.active = true
|
||||||
|
if (powerConfirmModalLoader.item) {
|
||||||
|
powerConfirmModalLoader.item.confirmButtonColor = action === "poweroff" ? Theme.error : action === "reboot" ? Theme.warning : Theme.primary
|
||||||
|
powerConfirmModalLoader.item.show(title, message, () => actionApply(action), function () {})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
actionApply(action)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function actionApply(action) {
|
||||||
|
switch (action) {
|
||||||
|
case "logout":
|
||||||
|
SessionService.logout()
|
||||||
|
break
|
||||||
|
case "suspend":
|
||||||
|
SessionService.suspend()
|
||||||
|
break
|
||||||
|
case "hibernate":
|
||||||
|
SessionService.hibernate()
|
||||||
|
break
|
||||||
|
case "reboot":
|
||||||
|
SessionService.reboot()
|
||||||
|
break
|
||||||
|
case "poweroff":
|
||||||
|
SessionService.poweroff()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: powerConfirmModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
ConfirmModal {
|
||||||
|
id: powerConfirmModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: processListPopoutLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
ProcessListPopout {
|
||||||
|
id: processListPopout
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.processListPopout = processListPopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsModal {
|
||||||
|
id: settingsModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.settingsModal = settingsModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: appDrawerLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
AppDrawerPopout {
|
||||||
|
id: appDrawerPopout
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.appDrawerPopout = appDrawerPopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SpotlightModal {
|
||||||
|
id: spotlightModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.spotlightModal = spotlightModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ClipboardHistoryModal {
|
||||||
|
id: clipboardHistoryModalPopup
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.clipboardHistoryModal = clipboardHistoryModalPopup
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotificationModal {
|
||||||
|
id: notificationModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.notificationModal = notificationModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DankColorPickerModal {
|
||||||
|
id: colorPickerModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.colorPickerModal = colorPickerModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: processListModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
ProcessListModal {
|
||||||
|
id: processListModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.processListModal = processListModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: systemUpdateLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
SystemUpdatePopout {
|
||||||
|
id: systemUpdatePopout
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.systemUpdatePopout = systemUpdatePopout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
id: notepadSlideoutVariants
|
||||||
|
model: SettingsData.getFilteredScreens("notepad")
|
||||||
|
|
||||||
|
delegate: DankSlideout {
|
||||||
|
id: notepadSlideout
|
||||||
|
modelData: item
|
||||||
|
title: I18n.tr("Notepad")
|
||||||
|
slideoutWidth: 480
|
||||||
|
expandable: true
|
||||||
|
expandedWidthValue: 960
|
||||||
|
customTransparency: SettingsData.notepadTransparencyOverride
|
||||||
|
|
||||||
|
content: Component {
|
||||||
|
Notepad {
|
||||||
|
onHideRequested: {
|
||||||
|
notepadSlideout.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
if (isVisible) {
|
||||||
|
hide()
|
||||||
|
} else {
|
||||||
|
show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: powerMenuModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
PowerMenuModal {
|
||||||
|
id: powerMenuModal
|
||||||
|
|
||||||
|
onPowerActionRequested: (action, title, message) => {
|
||||||
|
if (SettingsData.powerActionConfirm) {
|
||||||
|
powerConfirmModalLoader.active = true
|
||||||
|
if (powerConfirmModalLoader.item) {
|
||||||
|
powerConfirmModalLoader.item.confirmButtonColor = action === "poweroff" ? Theme.error : action === "reboot" ? Theme.warning : Theme.primary
|
||||||
|
powerConfirmModalLoader.item.show(title, message, () => actionApply(action), function () {})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
actionApply(action)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function actionApply(action) {
|
||||||
|
switch (action) {
|
||||||
|
case "logout":
|
||||||
|
SessionService.logout()
|
||||||
|
break
|
||||||
|
case "suspend":
|
||||||
|
SessionService.suspend()
|
||||||
|
break
|
||||||
|
case "hibernate":
|
||||||
|
SessionService.hibernate()
|
||||||
|
break
|
||||||
|
case "reboot":
|
||||||
|
SessionService.reboot()
|
||||||
|
break
|
||||||
|
case "poweroff":
|
||||||
|
SessionService.poweroff()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.powerMenuModal = powerMenuModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LazyLoader {
|
||||||
|
id: hyprKeybindsModalLoader
|
||||||
|
|
||||||
|
active: false
|
||||||
|
|
||||||
|
HyprKeybindsModal {
|
||||||
|
id: hyprKeybindsModal
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
PopoutService.hyprKeybindsModal = hyprKeybindsModal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DMSShellIPC {
|
||||||
|
powerMenuModalLoader: powerMenuModalLoader
|
||||||
|
processListModalLoader: processListModalLoader
|
||||||
|
controlCenterLoader: controlCenterLoader
|
||||||
|
dankDashPopoutLoader: dankDashPopoutLoader
|
||||||
|
notepadSlideoutVariants: notepadSlideoutVariants
|
||||||
|
hyprKeybindsModalLoader: hyprKeybindsModalLoader
|
||||||
|
dankBarLoader: dankBarLoader
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("toast")
|
||||||
|
|
||||||
|
delegate: Toast {
|
||||||
|
modelData: item
|
||||||
|
visible: ToastService.toastVisible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("osd")
|
||||||
|
|
||||||
|
delegate: VolumeOSD {
|
||||||
|
modelData: item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("osd")
|
||||||
|
|
||||||
|
delegate: MicMuteOSD {
|
||||||
|
modelData: item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("osd")
|
||||||
|
|
||||||
|
delegate: BrightnessOSD {
|
||||||
|
modelData: item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
model: SettingsData.getFilteredScreens("osd")
|
||||||
|
|
||||||
|
delegate: IdleInhibitorOSD {
|
||||||
|
modelData: item
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Item {
|
|||||||
required property var dankDashPopoutLoader
|
required property var dankDashPopoutLoader
|
||||||
required property var notepadSlideoutVariants
|
required property var notepadSlideoutVariants
|
||||||
required property var hyprKeybindsModalLoader
|
required property var hyprKeybindsModalLoader
|
||||||
|
required property var dankBarLoader
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
function open() {
|
function open() {
|
||||||
@@ -76,9 +77,8 @@ Item {
|
|||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
function open(): string {
|
function open(): string {
|
||||||
root.controlCenterLoader.active = true
|
if (root.dankBarLoader.item) {
|
||||||
if (root.controlCenterLoader.item) {
|
root.dankBarLoader.item.triggerControlCenterOnFocusedScreen()
|
||||||
root.controlCenterLoader.item.open()
|
|
||||||
return "CONTROL_CENTER_OPEN_SUCCESS"
|
return "CONTROL_CENTER_OPEN_SUCCESS"
|
||||||
}
|
}
|
||||||
return "CONTROL_CENTER_OPEN_FAILED"
|
return "CONTROL_CENTER_OPEN_FAILED"
|
||||||
@@ -93,9 +93,8 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggle(): string {
|
function toggle(): string {
|
||||||
root.controlCenterLoader.active = true
|
if (root.dankBarLoader.item) {
|
||||||
if (root.controlCenterLoader.item) {
|
root.dankBarLoader.item.triggerControlCenterOnFocusedScreen()
|
||||||
root.controlCenterLoader.item.toggle()
|
|
||||||
return "CONTROL_CENTER_TOGGLE_SUCCESS"
|
return "CONTROL_CENTER_TOGGLE_SUCCESS"
|
||||||
}
|
}
|
||||||
return "CONTROL_CENTER_TOGGLE_FAILED"
|
return "CONTROL_CENTER_TOGGLE_FAILED"
|
||||||
|
|||||||
@@ -73,21 +73,21 @@ DankPopout {
|
|||||||
onShouldBeVisibleChanged: {
|
onShouldBeVisibleChanged: {
|
||||||
if (shouldBeVisible) {
|
if (shouldBeVisible) {
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (NetworkService.activeService) {
|
if (NetworkService.activeService) {
|
||||||
NetworkService.activeService.autoRefreshEnabled = NetworkService.wifiEnabled
|
NetworkService.activeService.autoRefreshEnabled = NetworkService.wifiEnabled
|
||||||
}
|
}
|
||||||
if (UserInfoService)
|
if (UserInfoService)
|
||||||
UserInfoService.getUptime()
|
UserInfoService.getUptime()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (NetworkService.activeService) {
|
if (NetworkService.activeService) {
|
||||||
NetworkService.activeService.autoRefreshEnabled = false
|
NetworkService.activeService.autoRefreshEnabled = false
|
||||||
}
|
}
|
||||||
if (BluetoothService.adapter && BluetoothService.adapter.discovering)
|
if (BluetoothService.adapter && BluetoothService.adapter.discovering)
|
||||||
BluetoothService.adapter.discovering = false
|
BluetoothService.adapter.discovering = false
|
||||||
editMode = false
|
editMode = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,8 +108,7 @@ DankPopout {
|
|||||||
return Qt.rgba(surface.r, surface.g, surface.b, transparency)
|
return Qt.rgba(surface.r, surface.g, surface.b, transparency)
|
||||||
}
|
}
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
Theme.outline.b, 0.08)
|
|
||||||
border.width: 0
|
border.width: 0
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
@@ -156,19 +155,19 @@ DankPopout {
|
|||||||
bluetoothCodecSelector: bluetoothCodecSelector
|
bluetoothCodecSelector: bluetoothCodecSelector
|
||||||
colorPickerModal: root.colorPickerModal
|
colorPickerModal: root.colorPickerModal
|
||||||
onExpandClicked: (widgetData, globalIndex) => {
|
onExpandClicked: (widgetData, globalIndex) => {
|
||||||
root.expandedWidgetIndex = globalIndex
|
root.expandedWidgetIndex = globalIndex
|
||||||
root.expandedWidgetData = widgetData
|
root.expandedWidgetData = widgetData
|
||||||
if (widgetData.id === "diskUsage") {
|
if (widgetData.id === "diskUsage") {
|
||||||
root.toggleSection("diskUsage_" + (widgetData.instanceId || "default"))
|
root.toggleSection("diskUsage_" + (widgetData.instanceId || "default"))
|
||||||
} else if (widgetData.id === "brightnessSlider") {
|
} else if (widgetData.id === "brightnessSlider") {
|
||||||
root.toggleSection("brightnessSlider_" + (widgetData.instanceId || "default"))
|
root.toggleSection("brightnessSlider_" + (widgetData.instanceId || "default"))
|
||||||
} else {
|
} else {
|
||||||
root.toggleSection(widgetData.id)
|
root.toggleSection(widgetData.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onRemoveWidget: (index) => widgetModel.removeWidget(index)
|
onRemoveWidget: index => widgetModel.removeWidget(index)
|
||||||
onMoveWidget: (fromIndex, toIndex) => widgetModel.moveWidget(fromIndex, toIndex)
|
onMoveWidget: (fromIndex, toIndex) => widgetModel.moveWidget(fromIndex, toIndex)
|
||||||
onToggleWidgetSize: (index) => widgetModel.toggleWidgetSize(index)
|
onToggleWidgetSize: index => widgetModel.toggleWidgetSize(index)
|
||||||
onCollapseRequested: root.collapseAll()
|
onCollapseRequested: root.collapseAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,12 +176,13 @@ DankPopout {
|
|||||||
visible: editMode
|
visible: editMode
|
||||||
popoutContent: controlContent
|
popoutContent: controlContent
|
||||||
availableWidgets: {
|
availableWidgets: {
|
||||||
if (!editMode) return []
|
if (!editMode)
|
||||||
|
return []
|
||||||
const existingIds = (SettingsData.controlCenterWidgets || []).map(w => w.id)
|
const existingIds = (SettingsData.controlCenterWidgets || []).map(w => w.id)
|
||||||
const allWidgets = widgetModel.baseWidgetDefinitions.concat(widgetModel.getPluginWidgets())
|
const allWidgets = widgetModel.baseWidgetDefinitions.concat(widgetModel.getPluginWidgets())
|
||||||
return allWidgets.filter(w => w.allowMultiple || !existingIds.includes(w.id))
|
return allWidgets.filter(w => w.allowMultiple || !existingIds.includes(w.id))
|
||||||
}
|
}
|
||||||
onAddWidget: (widgetId) => widgetModel.addWidget(widgetId)
|
onAddWidget: widgetId => widgetModel.addWidget(widgetId)
|
||||||
onResetToDefault: () => widgetModel.resetToDefault()
|
onResetToDefault: () => widgetModel.resetToDefault()
|
||||||
onClearAll: () => widgetModel.clearAll()
|
onClearAll: () => widgetModel.clearAll()
|
||||||
}
|
}
|
||||||
@@ -205,10 +205,10 @@ DankPopout {
|
|||||||
id: bluetoothDetailComponent
|
id: bluetoothDetailComponent
|
||||||
BluetoothDetail {
|
BluetoothDetail {
|
||||||
id: bluetoothDetail
|
id: bluetoothDetail
|
||||||
onShowCodecSelector: function(device) {
|
onShowCodecSelector: function (device) {
|
||||||
if (contentLoader.item && contentLoader.item.bluetoothCodecSelector) {
|
if (contentLoader.item && contentLoader.item.bluetoothCodecSelector) {
|
||||||
contentLoader.item.bluetoothCodecSelector.show(device)
|
contentLoader.item.bluetoothCodecSelector.show(device)
|
||||||
contentLoader.item.bluetoothCodecSelector.codecSelected.connect(function(deviceAddress, codecName) {
|
contentLoader.item.bluetoothCodecSelector.codecSelected.connect(function (deviceAddress, codecName) {
|
||||||
bluetoothDetail.updateDeviceCodecDisplay(deviceAddress, codecName)
|
bluetoothDetail.updateDeviceCodecDisplay(deviceAddress, codecName)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -233,4 +233,4 @@ DankPopout {
|
|||||||
|
|
||||||
property var colorPickerModal: null
|
property var colorPickerModal: null
|
||||||
property var powerMenuModalLoader: null
|
property var powerMenuModalLoader: null
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user