shift-shell/shell/contents/updates/panelsfix.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
920 B
JavaScript
Raw Normal View History

// SPDX-FileCopyrightText: 2014-2019 Marco Martin <mart@kde.org>
// SPDX-FileCopyrightText: 2015-2021 Bhushan Shah <bshah@kde.org>
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
2021-01-27 13:20:15 +00:00
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") {
2021-01-28 10:05:33 +00:00
bottomFound = true;
2021-01-27 13:20:15 +00:00
}
}
if (!topFound) {
// keep widget list synced with the layout.js
2021-01-27 13:20:15 +00:00
let topPanel = new Panel("org.kde.phone.panel")
topPanel.addWidget("org.kde.plasma.notifications");
topPanel.location = "top";
topPanel.height = 1.25 * gridUnit;
2021-01-27 13:20:15 +00:00
}
if (!bottomFound) {
let bottomPanel = new Panel("org.kde.phone.taskpanel")
bottomPanel.location = "bottom";
bottomPanel.height = 2 * gridUnit;
2021-01-27 13:20:15 +00:00
}