mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
This reworks the implementation of the applet/containment configuration so that it is more optimized for the mobile experience and fixes lateral navigation (between categories). Changes: - Always show a list of category modules (switching from the navigation tab bar) in order to support more modules at once - Split the wallpaper and containment switching view into two modules - Add a close button at the top - Add an animation when the window opens and closes - Refactor the code so that it is clear which files are imported by the shell, and which are implementation details
77 lines
2 KiB
QML
77 lines
2 KiB
QML
// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
|
|
import org.kde.plasma.plasmoid
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.plasma.configuration
|
|
import org.kde.kitemmodels as KItemModels
|
|
|
|
Kirigami.ScrollablePage {
|
|
id: root
|
|
property alias model1: repeater1.model
|
|
property alias model2: repeater2.model
|
|
|
|
topPadding: 0
|
|
leftPadding: 0
|
|
rightPadding: 0
|
|
bottomPadding: 0
|
|
|
|
titleDelegate: RowLayout {
|
|
// Add close button
|
|
QQC2.ToolButton {
|
|
Layout.leftMargin: -Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing
|
|
icon.name: "arrow-left"
|
|
onClicked: root.Window.window.close()
|
|
}
|
|
|
|
Kirigami.Heading {
|
|
level: 1
|
|
text: root.title
|
|
}
|
|
}
|
|
|
|
signal requestOpen(var delegate)
|
|
|
|
ColumnLayout {
|
|
spacing: 0
|
|
|
|
Kirigami.InlineMessage {
|
|
Layout.alignment: Qt.AlignTop
|
|
visible: Plasmoid.immutable
|
|
text: i18n("Layout changes have been restricted by the system administrator")
|
|
showCloseButton: true
|
|
Layout.fillWidth: true
|
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
|
Layout.bottomMargin: Kirigami.Units.smallSpacing * 2 // we need this because ColumnLayout's spacing is 0
|
|
}
|
|
|
|
Repeater {
|
|
id: repeater1
|
|
|
|
delegate: QQC2.ItemDelegate {
|
|
icon.name: model.icon
|
|
text: model.name
|
|
Layout.fillWidth: true
|
|
|
|
onClicked: root.requestOpen(model)
|
|
}
|
|
}
|
|
|
|
Repeater {
|
|
id: repeater2
|
|
|
|
delegate: QQC2.ItemDelegate {
|
|
icon.name: model.icon
|
|
text: model.name
|
|
Layout.fillWidth: true
|
|
|
|
onClicked: root.requestOpen(model)
|
|
}
|
|
}
|
|
}
|
|
}
|