layout-templates: Move default panel configuration to layout template package

This commit is contained in:
Devin Lin 2024-06-26 00:57:56 +00:00
parent 5c53f9b6d2
commit b4f7ca1139
5 changed files with 43 additions and 11 deletions

View file

@ -116,6 +116,7 @@ add_subdirectory(kded)
add_subdirectory(kwin)
add_subdirectory(envmanager)
add_subdirectory(initialstart)
add_subdirectory(layout-templates)
find_program(PlasmaOpenSettings plasma-open-settings)
set_package_properties(PlasmaOpenSettings PROPERTIES

View file

@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2024 Devin Lin <devin@kde.org>
# SPDX-License-Identifier: GPL-2.0-or-later
plasma_install_package(org.kde.plasma.mobile.defaultMobileLayout org.kde.plasma.mobile.defaultMobileLayout layout-templates layout-template)

View file

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: 2024 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
const panel = new Panel("org.kde.plasma.mobile.panel");
panel.location = "top";
panel.addWidget("org.kde.plasma.notifications");
panel.height = 1.25 * gridUnit; // HACK: supposed to be gridUnit + smallSpacing, but it doesn't seem to give the correct number
const bottomPanel = new Panel("org.kde.plasma.mobile.taskpanel")
bottomPanel.location = "bottom";
bottomPanel.height = 2 * gridUnit;

View file

@ -0,0 +1,23 @@
{
"KPackageStructure": "Plasma/LayoutTemplate",
"KPlugin": {
"Authors": [
{
"Email": "devin@kde.org",
"Name": "Devin Lin"
}
],
"Category": "",
"Description": "Default panel layout for mobile, including status bar and navigation panel",
"EnabledByDefault": true,
"Id": "org.kde.plasma.mobile.defaultMobileLayout",
"License": "LGPLv2+",
"Name": "Default Mobile Layout",
"Website": "https://www.kde.org/plasma-desktop"
},
"X-Plasma-ContainmentCategories": [
"panel"
],
"X-Plasma-Shell": "plasmashell"
}

View file

@ -5,23 +5,17 @@
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
// Load panel layout
loadTemplate("org.kde.plasma.mobile.defaultMobileLayout")
// Set wallpaper plugin
var desktopsArray = desktopsForActivity(currentActivity());
for (var j = 0; j < desktopsArray.length; j++) {
desktopsArray[j].wallpaperPlugin = "org.kde.image";
if (j == 0) {
// add meta shortcut
// Add meta shortcut
desktopsArray[0].currentConfigGroup = ["Shortcuts"]
desktopsArray[0].writeConfig("global", "Meta+F1")
}
}
// keep this list in sync with shell/contents/updates/panelsfix.js
var panel = new Panel("org.kde.plasma.mobile.panel");
panel.location = "top";
panel.addWidget("org.kde.plasma.notifications");
panel.height = 1.25 * gridUnit; // HACK: supposed to be gridUnit + smallSpacing, but it doesn't seem to give the correct number
var bottomPanel = new Panel("org.kde.plasma.mobile.taskpanel")
bottomPanel.location = "bottom";
bottomPanel.height = 2 * gridUnit;