Switched to qmlformat.

This commit is contained in:
ItsLemmy
2025-11-16 17:07:03 -05:00
parent 32905224b9
commit 3ff5b7639f
223 changed files with 9970 additions and 9658 deletions
+12 -13
View File
@@ -1,7 +1,7 @@
import QtQuick
import Quickshell
import qs.Services.UI
import qs.Commons
import qs.Services.UI
Item {
id: root
@@ -25,7 +25,7 @@ Item {
visible: loader.item ? ((loader.item.opacity > 0.0) || (loader.item.hasOwnProperty("hideMode") && loader.item.hideMode === "transparent")) : false
function getImplicitSize(item, prop) {
return (item && item.visible) ? Math.round(item[prop]) : 0
return (item && item.visible) ? Math.round(item[prop]) : 0;
}
Loader {
@@ -36,42 +36,41 @@ Item {
onLoaded: {
if (!item)
return
Logger.d("BarWidgetLoader", "Loading widget", widgetId, "on screen:", widgetScreen.name)
return;
Logger.d("BarWidgetLoader", "Loading widget", widgetId, "on screen:", widgetScreen.name);
// Apply properties to loaded widget
for (var prop in widgetProps) {
if (item.hasOwnProperty(prop)) {
item[prop] = widgetProps[prop]
item[prop] = widgetProps[prop];
}
}
// Set screen property
if (item.hasOwnProperty("screen")) {
item.screen = widgetScreen
item.screen = widgetScreen;
}
// Set scaling property
if (item.hasOwnProperty("scaling")) {
item.scaling = Qt.binding(function () {
return root.scaling
})
return root.scaling;
});
}
// Register this widget instance with BarService
BarService.registerWidget(widgetScreen.name, section, widgetId, sectionIndex, item)
BarService.registerWidget(widgetScreen.name, section, widgetId, sectionIndex, item);
// Call custom onLoaded if it exists
if (item.hasOwnProperty("onLoaded")) {
item.onLoaded()
item.onLoaded();
}
}
Component.onDestruction: {
// Unregister when destroyed
if (widgetScreen && section) {
BarService.unregisterWidget(widgetScreen.name, section, widgetId, sectionIndex)
BarService.unregisterWidget(widgetScreen.name, section, widgetId, sectionIndex);
}
}
}
@@ -79,7 +78,7 @@ Item {
// Error handling
Component.onCompleted: {
if (!BarWidgetRegistry.hasWidget(widgetId)) {
Logger.w("BarWidgetLoader", "Widget not found in registry:", widgetId)
Logger.w("BarWidgetLoader", "Widget not found in registry:", widgetId);
}
}
}