Merge branch 'quick-settings'

This commit is contained in:
ItsLemmy
2025-10-10 07:42:40 -04:00
51 changed files with 1980 additions and 430 deletions
+75
View File
@@ -0,0 +1,75 @@
pragma Singleton
import QtQuick
import Quickshell
import qs.Commons
import qs.Modules.ControlCenter.Widgets
Singleton {
id: root
// Widget registry object mapping widget names to components
property var widgets: ({
"Bluetooth": bluetoothComponent,
"Notifications": notificationsComponent,
"KeepAwake": keepAwakeComponent,
"NightLight": nightLightComponent,
"PowerProfile": powerProfileComponent,
"ScreenRecorder": screenRecorderComponent,
"WiFi": wiFiComponent,
"WallpaperSelector": wallpaperSelectorComponent
})
property var widgetMetadata: ({})
// Component definitions - these are loaded once at startup
property Component bluetoothComponent: Component {
Bluetooth {}
}
property Component notificationsComponent: Component {
Notifications {}
}
property Component keepAwakeComponent: Component {
KeepAwake {}
}
property Component nightLightComponent: Component {
NightLight {}
}
property Component powerProfileComponent: Component {
PowerProfile {}
}
property Component screenRecorderComponent: Component {
ScreenRecorder {}
}
property Component wiFiComponent: Component {
WiFi {}
}
property Component wallpaperSelectorComponent: Component {
WallpaperSelector {}
}
function init() {
Logger.log("ControlCenterWidgetRegistry", "Service started")
}
// ------------------------------
// Helper function to get widget component by name
function getWidget(id) {
return widgets[id] || null
}
// Helper function to check if widget exists
function hasWidget(id) {
return id in widgets
}
// Get list of available widget id
function getAvailableWidgets() {
return Object.keys(widgets)
}
// Helper function to check if widget has user settings
function widgetHasUserSettings(id) {
return (widgetMetadata[id] !== undefined) && (widgetMetadata[id].allowUserSettings === true)
}
}
+6
View File
@@ -71,6 +71,12 @@ Singleton {
setProfile(PowerProfile.Balanced)
}
function isDefault() {
if (!available)
return true
return (profile === PowerProfile.Balanced)
}
Connections {
target: powerProfiles
function onProfileChanged() {