File indexing completed on 2024-05-12 17:07:49

0001 // SPDX-FileCopyrightText: 2014-2019 Marco Martin <mart@kde.org>
0002 // SPDX-FileCopyrightText: 2015-2021 Bhushan Shah <bshah@kde.org>
0003 // SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
0004 // SPDX-License-Identifier: GPL-2.0-or-later
0005 
0006 let topFound = false
0007 let bottomFound = false
0008 
0009 for (let i in panels()) {
0010     print(panels()[i].type)
0011     if (panels()[i].type === "org.kde.phone.panel") {
0012         topFound = true;
0013     } else if (panels()[i].type === "org.kde.phone.taskpanel") {
0014         bottomFound = true;
0015     }
0016 }
0017 
0018 if (!topFound) {
0019     // keep widget list synced with the layout.js
0020     let topPanel = new Panel("org.kde.phone.panel")
0021     topPanel.addWidget("org.kde.plasma.notifications");
0022     topPanel.location = "top";
0023     topPanel.height = 1.25 * gridUnit;
0024 }
0025 if (!bottomFound) {
0026     let bottomPanel = new Panel("org.kde.phone.taskpanel")
0027     bottomPanel.location = "bottom";
0028     bottomPanel.height = 2 * gridUnit;
0029 }