diff --git a/README.md b/README.md index bd1b36a1..c5da607d 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ To start the phone homescreen in a window, run: QT_QPA_PLATFORM=wayland dbus-run-session kwin_wayland --xwayland "plasmashell -p org.kde.plasma.phoneshell" ``` - --- diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsTest.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsTest.qml deleted file mode 100644 index 52489493..00000000 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsTest.qml +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ - -import QtQuick 2.15 - -import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import "../../components" as Components - -// This is a test app to conveniently test the Quick Settings that are available -// on the system without having to load a full Plasma Mobile shell. -// -// Do not expect changes in this file to change the plasma UX. Do not install. -// -// This can be executed by running `qml QuickSettingsTest.qml` - -GridView { - model: MobileShell.QuickSettingsModel {} - - PlasmaComponents.Button { - id: restrictedButton - checkable: true - text: "Restricted" - } - delegate: Components.BaseItem { - required property var modelData - - implicitHeight: 150 - implicitWidth: 150 - horizontalPadding: (width - PlasmaCore.Units.gridUnit * 3) / 2 - verticalPadding: (height - PlasmaCore.Units.gridUnit * 3) / 2 - - contentItem: QuickSettingsFullDelegate { - restrictedPermissions: restrictedButton.checked - - text: modelData.text - status: modelData.status - icon: modelData.icon - enabled: modelData.enabled - settingsCommand: modelData.settingsCommand - toggleFunction: modelData.toggle - - onCloseRequested: { - actionDrawer.close(); - } - } - } -} diff --git a/tests/ActionDrawerTest.qml b/tests/ActionDrawerTest.qml new file mode 100644 index 00000000..b76d78b4 --- /dev/null +++ b/tests/ActionDrawerTest.qml @@ -0,0 +1,78 @@ +/* + * SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez + * SPDX-FileCopyrightText: 2022 Devin LIn + * + * SPDX-License-Identifier: LGPL-2.0-or-later + */ + +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +import org.kde.plasma.components 3.0 as PC3 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.notificationmanager 1.1 as Notifications + +import org.kde.notificationmanager 1.0 as NotificationManager + +// This is a test app to conveniently test the Quick Settings that are available +// on the system without having to load a full Plasma Mobile shell. +// +// Do not expect changes in this file to change the plasma UX. Do not install. +// +// This can be executed by running `qmlscene QuickSettingsTest.qml` + +ApplicationWindow { + width: 360 + height: 720 + visible: true + + Image { + source: "assets/background.jpg" + anchors.fill: parent + fillMode: Image.PreserveAspectCrop + } + + MobileShell.StatusBar { + id: statusBar + z: 1 + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + height: PlasmaCore.Units.gridUnit * 1.25 + + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup + backgroundColor: "transparent" + + showSecondRow: false + showDropShadow: true + showTime: true + disableSystemTray: true // prevent SIGABRT, since loading the system tray leads to bad... things + } + + MobileShell.ActionDrawerOpenSurface { + anchors.fill: statusBar + actionDrawer: drawer + z: 1 + } + + MobileShell.ActionDrawer { + id: drawer + z: 1 + anchors.fill: parent + + notificationSettings: NotificationManager.Settings {} + notificationModelType: MobileShell.NotificationsModelType.WatchedNotificationsModel + notificationModel: Notifications.WatchedNotificationsModel {} + } + + PC3.Label { + anchors.bottom: parent.bottom + anchors.bottomMargin: PlasmaCore.Units.largeSpacing + anchors.horizontalCenter: parent.horizontalCenter + text: "Pull down the action drawer from the top." + color: "white" + } +} diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..fe6ecbc1 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,9 @@ + + +# Tests +Run any of the example files in this folder with `qmlscene` to test different components. + +Be sure to have the project installed on the system. diff --git a/tests/assets/background.jpg b/tests/assets/background.jpg new file mode 100644 index 00000000..afa9899f Binary files /dev/null and b/tests/assets/background.jpg differ diff --git a/tests/assets/background.png.license b/tests/assets/background.png.license new file mode 100644 index 00000000..0128b00f --- /dev/null +++ b/tests/assets/background.png.license @@ -0,0 +1,2 @@ +Copyright None +SPDX-License-Identifier: CC0-1.0