Bar vs Dock: Dock are loaded only once the bar is fully loaded. This ensure the vertical bar use the full screen height if the dock is exclusive.

This commit is contained in:
ItsLemmy
2025-09-28 16:39:23 -04:00
parent 5da474007e
commit 072d80e2f3
3 changed files with 40 additions and 6 deletions
+21 -4
View File
@@ -9,6 +9,13 @@ Singleton {
property bool hasAudioVisualizer: false
property bool isVisible: true
property var readyBars: ({})
// Registry to store actual widget instances
// Key format: "screenName|section|widgetId|index"
property var widgetInstances: ({})
signal barReadyChanged(string screenName)
// Simple timer that run once when the widget structure has changed
// and determine if any MediaMini widget has the visualizer on
@@ -28,14 +35,24 @@ Singleton {
}
}
// Registry to store actual widget instances
// Key format: "screenName|section|widgetId|index"
property var widgetInstances: ({})
Component.onCompleted: {
Logger.log("BarService", "Service started")
}
// Function for the Bar to call when it's ready
function registerBar(screenName) {
if (!readyBars[screenName]) {
readyBars[screenName] = true
console.log("ShellStateService: Bar on screen '" + screenName + "' is ready.")
barReadyChanged(screenName)
}
}
// Function for the Dock to check if the bar is ready
function isBarReady(screenName) {
return readyBars[screenName] || false
}
// Register a widget instance
function registerWidget(screenName, section, widgetId, index, instance) {
const key = [screenName, section, widgetId, index].join("|")