mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Otherwise if we add the panels which were missing, we will end up adding panel without notifications and mediacontroller.
24 lines
704 B
JavaScript
24 lines
704 B
JavaScript
let topFound = false
|
|
let bottomFound = false
|
|
|
|
for (let i in panels()) {
|
|
print(panels()[i].type)
|
|
if (panels()[i].type === "org.kde.phone.panel") {
|
|
topFound = true;
|
|
} else if (panels()[i].type === "org.kde.phone.taskpanel") {
|
|
bottomFound = true;
|
|
}
|
|
}
|
|
|
|
if (!topFound) {
|
|
// keep widget list synced with the layout.js
|
|
let topPanel = new Panel("org.kde.phone.panel")
|
|
topPanel.addWidget("org.kde.plasma.notifications");
|
|
topPanel.addWidget("org.kde.plasma.mediacontroller");
|
|
topPanel.location = "top";
|
|
}
|
|
if (!bottomFound) {
|
|
let bottomPanel = new Panel("org.kde.phone.taskpanel")
|
|
bottomPanel.location = "bottom";
|
|
bottomPanel.height = 2 * gridUnit;
|
|
}
|