diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 3c6095af..e9ecd6fc 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -7,3 +7,4 @@ add_subdirectory(mobileshell) add_subdirectory(mobileshellstate) add_subdirectory(quicksettingsplugin) add_subdirectory(windowplugin) +add_subdirectory(shellsettingsplugin) diff --git a/components/mobileshell/CMakeLists.txt b/components/mobileshell/CMakeLists.txt index 077d0107..5360ba39 100644 --- a/components/mobileshell/CMakeLists.txt +++ b/components/mobileshell/CMakeLists.txt @@ -6,7 +6,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) set(mobileshellplugin_SRCS mobileshellplugin.cpp - mobileshellsettings.cpp shellutil.cpp components/direction.cpp notifications/notificationthumbnailer.cpp diff --git a/components/mobileshell/mobileshellplugin.cpp b/components/mobileshell/mobileshellplugin.cpp index b0320afd..d70b7233 100644 --- a/components/mobileshell/mobileshellplugin.cpp +++ b/components/mobileshell/mobileshellplugin.cpp @@ -16,7 +16,6 @@ #include "taskswitcher/displaysmodel.h" -#include "mobileshellsettings.h" #include "shellutil.h" QUrl resolvePath(std::string str) @@ -32,10 +31,6 @@ void MobileShellPlugin::registerTypes(const char *uri) return ShellUtil::instance(); }); - qmlRegisterSingletonType(uri, 1, 0, "MobileShellSettings", [](QQmlEngine *, QJSEngine *) -> QObject * { - return MobileShellSettings::self(); - }); - // components qmlRegisterType(uri, 1, 0, "Direction"); diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml index b48c997a..e5f3ea75 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml @@ -15,6 +15,8 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import "../components" as Components + Item { id: root @@ -227,7 +229,7 @@ Item { onFinished: root.opened = true; } - MobileShell.Flickable { + Components.Flickable { id: flickable anchors.fill: parent diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml index 0241d80c..78a5488e 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerOpenSurface.qml @@ -6,7 +6,7 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings /** * Component that triggers the opening and closing of an ActionDrawer when dragged on with touch or mouse. @@ -48,9 +48,9 @@ MouseArea { // if the user swiped from the top left, otherwise it's from the top right if (mouse.x < root.width / 2) { - actionDrawer.openToPinnedMode = MobileShell.MobileShellSettings.actionDrawerTopLeftMode == MobileShell.MobileShellSettings.Pinned; + actionDrawer.openToPinnedMode = ShellSettings.Settings.actionDrawerTopLeftMode == ShellSettings.Settingss.Pinned; } else { - actionDrawer.openToPinnedMode = MobileShell.MobileShellSettings.actionDrawerTopRightMode == MobileShell.MobileShellSettings.Pinned; + actionDrawer.openToPinnedMode = ShellSettings.Settings.actionDrawerTopRightMode == ShellSettings.Settings.Pinned; } startSwipe(); diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index 50716cc6..d1188832 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -11,7 +11,6 @@ import QtQuick.Window 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../components" as Components import "../widgets/notifications" as Notifications diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml index e8942932..5167d44c 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml @@ -12,8 +12,8 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.components 3.0 as PlasmaComponents import "../../components" as Components diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml index a862976b..8cbb5f70 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml @@ -11,7 +11,7 @@ import QtQuick.Layouts 1.1 import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.components 3.0 as PlasmaComponents import "../../components" as Components @@ -23,7 +23,7 @@ QuickSettingsDelegate { iconItem: icon // scale animation on press - zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 + zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 background: Item { // very simple shadow for performance diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml index 723f7040..b1203aa0 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml @@ -11,7 +11,7 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.components 3.0 as PlasmaComponents import "../../components" as Components @@ -22,7 +22,7 @@ QuickSettingsDelegate { iconItem: icon // scale animation on press - zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 + zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 background: Item { // very simple shadow for performance @@ -52,7 +52,7 @@ QuickSettingsDelegate { } } - MobileShell.HapticsEffectLoader { + Components.HapticsEffectLoader { id: haptics } diff --git a/components/mobileshell/qml/components/HapticsEffectLoader.qml b/components/mobileshell/qml/components/HapticsEffectLoader.qml index a25f5ba2..dbf1db21 100644 --- a/components/mobileshell/qml/components/HapticsEffectLoader.qml +++ b/components/mobileshell/qml/components/HapticsEffectLoader.qml @@ -3,14 +3,14 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Loader { // source: "qrc:/org/kde/plasma/private/mobileshell/qml/components/HapticsEffectWrapper.qml" property bool valid: item !== null function buttonVibrate() { - if (valid && MobileShell.MobileShellSettings.vibrationsEnabled) { + if (valid && ShellSettings.Settings.vibrationsEnabled) { // TODO we need a haptics stack for Qt 6 // item.intensity = MobileShell.MobileShellSettings.vibrationIntensity; // item.duration = MobileShell.MobileShellSettings.vibrationDuration; diff --git a/components/mobileshell/qml/components/StartupFeedback.qml b/components/mobileshell/qml/components/StartupFeedback.qml index adf64d2e..47e2a13b 100644 --- a/components/mobileshell/qml/components/StartupFeedback.qml +++ b/components/mobileshell/qml/components/StartupFeedback.qml @@ -11,7 +11,7 @@ import Qt5Compat.GraphicalEffects import org.kde.kirigami 2.13 as Kirigami import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState /** @@ -143,7 +143,7 @@ MouseArea { // use mousearea to ensure clicks don't go behind // no-animation mode transition Transition { from: "closed" - enabled: !MobileShell.MobileShellSettings.animationsEnabled + enabled: !ShellSettings.Settings.animationsEnabled SequentialAnimation { ScriptAction { script: { @@ -177,7 +177,7 @@ MouseArea { // use mousearea to ensure clicks don't go behind // full animation transition Transition { from: "closed" - enabled: MobileShell.MobileShellSettings.animationsEnabled + enabled: ShellSettings.Settings.animationsEnabled SequentialAnimation { ScriptAction { script: { diff --git a/components/mobileshell/qml/homescreen/HomeScreen.qml b/components/mobileshell/qml/homescreen/HomeScreen.qml index 8b0bfbfe..e134c50b 100644 --- a/components/mobileshell/qml/homescreen/HomeScreen.qml +++ b/components/mobileshell/qml/homescreen/HomeScreen.qml @@ -10,7 +10,7 @@ import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasmoid import org.kde.taskmanager as TaskManager -import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin @@ -60,7 +60,7 @@ Item { function evaluateMargins() { topMargin = plasmoid.availableScreenRect.y // add a specific check for the nav panel for now, since the gesture mode still technically has height - bottomMargin = MobileShell.MobileShellSettings.navigationPanelEnabled ? root.height - (plasmoid.availableScreenRect.y + plasmoid.availableScreenRect.height) : 0; + bottomMargin = ShellSettings.Settings.navigationPanelEnabled ? root.height - (plasmoid.availableScreenRect.y + plasmoid.availableScreenRect.height) : 0; leftMargin = plasmoid.availableScreenRect.x rightMargin = root.width - (plasmoid.availableScreenRect.x + plasmoid.availableScreenRect.width) } @@ -182,7 +182,7 @@ Item { opacityAnim.restart(); } function zoomOut() { - if (MobileShell.MobileShellSettings.animationsEnabled) { + if (ShellSettings.Settings.animationsEnabled) { scaleAnim.to = 0.8; scaleAnim.restart(); opacityAnim.to = 0; @@ -192,13 +192,13 @@ Item { NumberAnimation on opacity { id: opacityAnim - duration: MobileShell.MobileShellSettings.animationsEnabled ? 300 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 300 : 0 running: false } NumberAnimation on zoomScale { id: scaleAnim - duration: MobileShell.MobileShellSettings.animationsEnabled ? 600 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 600 : 0 running: false easing.type: Easing.OutExpo } diff --git a/components/mobileshell/qml/statusbar/StatusBar.qml b/components/mobileshell/qml/statusbar/StatusBar.qml index 2ab1f275..cd837c4d 100644 --- a/components/mobileshell/qml/statusbar/StatusBar.qml +++ b/components/mobileshell/qml/statusbar/StatusBar.qml @@ -15,10 +15,10 @@ import Qt5Compat.GraphicalEffects import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import "indicators" as Indicators +import "../dataproviders" as DataProviders Item { id: root @@ -217,7 +217,7 @@ Item { Item { Layout.fillWidth: true } PlasmaComponents.Label { - property var signalStrengthInfo: MobileShell.SignalStrengthInfo {} + property var signalStrengthInfo: DataProviders.SignalStrengthInfo {} visible: root.showTime text: signalStrengthInfo.label diff --git a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml index 40f67cbf..941ac572 100644 --- a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml @@ -11,7 +11,6 @@ import QtQuick.Layouts 1.4 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.workspace.components 2.0 as PW -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../../dataproviders" as DataProviders diff --git a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml index 949779d7..8ea8ac58 100644 --- a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml @@ -6,18 +6,18 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -import QtQuick 2.2 -import QtQuick.Layouts 1.4 +import QtQuick +import QtQuick.Layouts -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.core as PlasmaCore +import org.kde.bluezqt as BluezQt -import org.kde.bluezqt 1.0 as BluezQt +import "../../dataproviders" as DataProviders PlasmaCore.IconItem { id: connectionIcon - readonly property var provider: MobileShell.BluetoothInfo {} + readonly property var provider: DataProviders.BluetoothInfo {} source: provider.icon colorGroup: PlasmaCore.ColorScope.colorGroup diff --git a/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml b/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml index 2819a757..e7c7b924 100644 --- a/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/InternetIndicator.qml @@ -6,12 +6,11 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -import QtQuick 2.2 -import QtQuick.Layouts 1.4 -import org.kde.plasma.core 2.0 as PlasmaCore +import QtQuick +import QtQuick.Layouts +import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.networkmanagement 0.2 as PlasmaNM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell PlasmaCore.IconItem { id: connectionIcon diff --git a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml index 5f3064ea..226d3ec9 100644 --- a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml @@ -5,17 +5,18 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -import QtQuick 2.1 -import QtQuick.Layouts 1.1 +import QtQuick +import QtQuick.Layouts import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell + +import "../../dataproviders" as DataProviders Item { required property InternetIndicator internetIndicator - readonly property var provider: MobileShell.SignalStrengthInfo {} + readonly property var provider: DataProviders.SignalStrengthInfo {} // check if the internet indicator icon is a mobile data related one readonly property bool isInternetIndicatorMobileData: internetIndicator && internetIndicator.icon && internetIndicator.icon.startsWith('network-mobile-') diff --git a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml index 1c1e576e..1237b3e1 100644 --- a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml @@ -6,16 +6,17 @@ SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ -import QtQuick 2.2 -import QtQuick.Layouts 1.4 +import QtQuick +import QtQuick.Layouts import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.private.volume 0.1 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell + +import "../../dataproviders" as DataProviders PlasmaCore.IconItem { id: paIcon - readonly property var provider: MobileShell.AudioInfo {} + readonly property var provider: DataProviders.AudioInfo {} Layout.fillHeight: true Layout.preferredWidth: height diff --git a/components/mobileshell/qml/volumeosd/AudioApplet.qml b/components/mobileshell/qml/volumeosd/AudioApplet.qml index 693fad51..b02fe762 100644 --- a/components/mobileshell/qml/volumeosd/AudioApplet.qml +++ b/components/mobileshell/qml/volumeosd/AudioApplet.qml @@ -14,16 +14,17 @@ import Qt5Compat.GraphicalEffects import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.extras as PlasmaExtra -import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kquickcontrolsaddons as KQCAddons import org.kde.plasma.private.volume +import "../dataproviders" as DataProviders + // capture presses on the audio applet so it doesn't close the overlay ColumnLayout { spacing: 0 - required property MobileShell.AudioInfo audioInfo + required property DataProviders.AudioInfo audioInfo PulseObjectFilterModel { id: paSinkFilterModel diff --git a/components/mobileshell/qml/volumeosd/ListItemBase.qml b/components/mobileshell/qml/volumeosd/ListItemBase.qml index 9fdcdfaf..cb89daf7 100644 --- a/components/mobileshell/qml/volumeosd/ListItemBase.qml +++ b/components/mobileshell/qml/volumeosd/ListItemBase.qml @@ -10,7 +10,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 as Controls import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 -import Qt5Compat.GraphicalEffects import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.core 2.1 as PlasmaCore diff --git a/components/mobileshell/qml/volumeosd/VolumeOSD.qml b/components/mobileshell/qml/volumeosd/VolumeOSD.qml index 37492749..e56cfd9c 100644 --- a/components/mobileshell/qml/volumeosd/VolumeOSD.qml +++ b/components/mobileshell/qml/volumeosd/VolumeOSD.qml @@ -22,6 +22,8 @@ import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.kirigami as Kirigami +import "../dataproviders" as DataProviders + Window { id: window @@ -67,7 +69,7 @@ Window { } } - MobileShell.AudioInfo { + DataProviders.AudioInfo { id: audioInfo } diff --git a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml index e113550b..4dce5e26 100644 --- a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml +++ b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml @@ -14,8 +14,6 @@ import Qt5Compat.GraphicalEffects import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState // import org.kde.milou 0.1 as Milou import org.kde.kirigami 2.19 as Kirigami diff --git a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml index 056cffc5..14931927 100644 --- a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml +++ b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml @@ -11,7 +11,6 @@ import QtQuick.Controls 2.15 as QQC2 import org.kde.kirigami 2.12 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents3 diff --git a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml index bfa39ee7..0eceff68 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml @@ -15,6 +15,7 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.components 3.0 as PlasmaComponents3 @@ -143,7 +144,7 @@ Item { property var pendingNotificationWithAction - readonly property int animationDuration: MobileShell.MobileShellSettings.animationsEnabled ? PlasmaCore.Units.longDuration : 0 + readonly property int animationDuration: ShellSettings.Settings.animationsEnabled ? PlasmaCore.Units.longDuration : 0 // If a screen overflow occurs, fix height in order to maintain tool buttons in place. readonly property bool listOverflowing: contentItem.childrenRect.height + toolButtons.height + spacing >= root.height diff --git a/components/shellsettingsplugin/CMakeLists.txt b/components/shellsettingsplugin/CMakeLists.txt new file mode 100644 index 00000000..ed56f210 --- /dev/null +++ b/components/shellsettingsplugin/CMakeLists.txt @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: 2023 Devin Lin +# SPDX-License-Identifier: GPL-2.0-or-later + +add_library(shellsettingsplugin) +target_sources(shellsettingsplugin PRIVATE + mobileshellsettings.cpp + shellsettingsplugin.cpp +) + +target_link_libraries(shellsettingsplugin + Qt::Qml + Qt::DBus + Qt::Gui + Qt::Quick + KF6::WaylandClient + KF6::Service + KF6::ConfigWidgets + KF6::Package +) + +set_property(TARGET shellsettingsplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/shellsettingsplugin) +file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/shellsettingsplugin) + +install(TARGETS shellsettingsplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/shellsettingsplugin) +install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/shellsettingsplugin) + + + diff --git a/components/mobileshell/mobileshellsettings.cpp b/components/shellsettingsplugin/mobileshellsettings.cpp similarity index 100% rename from components/mobileshell/mobileshellsettings.cpp rename to components/shellsettingsplugin/mobileshellsettings.cpp diff --git a/components/mobileshell/mobileshellsettings.h b/components/shellsettingsplugin/mobileshellsettings.h similarity index 100% rename from components/mobileshell/mobileshellsettings.h rename to components/shellsettingsplugin/mobileshellsettings.h diff --git a/components/shellsettingsplugin/qmldir b/components/shellsettingsplugin/qmldir new file mode 100644 index 00000000..aaaf2d87 --- /dev/null +++ b/components/shellsettingsplugin/qmldir @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2023 Devin Lin +# SPDX-License-Identifier: GPL-2.0-or-later + +module org.kde.plasma.private.mobileshell.shellsettingsplugin + +plugin shellsettingsplugin + + + diff --git a/components/shellsettingsplugin/shellsettingsplugin.cpp b/components/shellsettingsplugin/shellsettingsplugin.cpp new file mode 100644 index 00000000..0da0d115 --- /dev/null +++ b/components/shellsettingsplugin/shellsettingsplugin.cpp @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2023 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "shellsettingsplugin.h" +#include "mobileshellsettings.h" + +#include +#include + +void ShellSettingsPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.shellsettingsplugin")); + + qmlRegisterSingletonType(uri, 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) -> QObject * { + return MobileShellSettings::self(); + }); +} diff --git a/components/shellsettingsplugin/shellsettingsplugin.h b/components/shellsettingsplugin/shellsettingsplugin.h new file mode 100644 index 00000000..4e625ba7 --- /dev/null +++ b/components/shellsettingsplugin/shellsettingsplugin.h @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2023 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#include +#include + +class ShellSettingsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri) override; +}; diff --git a/containments/homescreens/folio/package/contents/ui/FlickContainer.qml b/containments/homescreens/folio/package/contents/ui/FlickContainer.qml index 4cac37d8..3bae68b4 100644 --- a/containments/homescreens/folio/package/contents/ui/FlickContainer.qml +++ b/containments/homescreens/folio/package/contents/ui/FlickContainer.qml @@ -10,7 +10,6 @@ import QtQuick.Layouts 1.15 import org.kde.taskmanager 0.1 as TaskManager import org.kde.plasma.core 2.1 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell MobileShell.Flickable { diff --git a/containments/homescreens/folio/package/contents/ui/HomeDelegate.qml b/containments/homescreens/folio/package/contents/ui/HomeDelegate.qml index 60766ea4..e5f334cd 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeDelegate.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeDelegate.qml @@ -16,6 +16,7 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio @@ -115,8 +116,8 @@ ContainmentLayoutManager.ItemContainer { NumberAnimation on zoomScale { id: shrinkAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 - to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 + to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1 onFinished: { if (!mouseArea.pressed) { growAnim.restart(); @@ -127,7 +128,7 @@ ContainmentLayoutManager.ItemContainer { NumberAnimation on zoomScale { id: growAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 to: 1 onFinished: { if (mouseArea.launchAppRequested) { diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml index 78793b58..b8682966 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml @@ -19,8 +19,6 @@ import "appdrawer" import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio Item { diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreenContents.qml b/containments/homescreens/folio/package/contents/ui/HomeScreenContents.qml index eb994759..a2cbfe16 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreenContents.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreenContents.qml @@ -16,7 +16,6 @@ import org.kde.draganddrop 2.0 as DragDrop import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import "private" as Private diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreenPages.qml b/containments/homescreens/folio/package/contents/ui/HomeScreenPages.qml index bba94ef7..06e43270 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreenPages.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreenPages.qml @@ -20,7 +20,7 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM import org.kde.plasma.private.mobileshell 1.0 as MobileShell -Flickable { +MobileShell.Flickable { id: mainFlickable required property var homeScreenState diff --git a/containments/homescreens/folio/package/contents/ui/LauncherRepeater.qml b/containments/homescreens/folio/package/contents/ui/LauncherRepeater.qml index 64d78613..223ea813 100644 --- a/containments/homescreens/folio/package/contents/ui/LauncherRepeater.qml +++ b/containments/homescreens/folio/package/contents/ui/LauncherRepeater.qml @@ -16,7 +16,6 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.kirigami 2.14 as Kirigami diff --git a/containments/homescreens/folio/package/contents/ui/MobileAppletContainer.qml b/containments/homescreens/folio/package/contents/ui/MobileAppletContainer.qml index 8f431ad6..37972f6a 100644 --- a/containments/homescreens/folio/package/contents/ui/MobileAppletContainer.qml +++ b/containments/homescreens/folio/package/contents/ui/MobileAppletContainer.qml @@ -16,8 +16,6 @@ import org.kde.draganddrop 2.0 as DragDrop import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - import "private" as Private ContainmentLayoutManager.BasicAppletContainer { diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/AbstractAppDrawer.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/AbstractAppDrawer.qml index 5473b49c..96fb727a 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/AbstractAppDrawer.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/AbstractAppDrawer.qml @@ -15,7 +15,6 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.extras 2.0 as PlasmaExtra import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../private" diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/AppDrawerLoader.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/AppDrawerLoader.qml index 85a8ae93..109ff5e4 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/AppDrawerLoader.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/AppDrawerLoader.qml @@ -13,8 +13,6 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - Loader { id: root diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerGridDelegate.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerGridDelegate.qml index 3244d375..d147faa9 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerGridDelegate.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerGridDelegate.qml @@ -15,7 +15,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings MouseArea { id: delegate @@ -60,8 +60,8 @@ MouseArea { NumberAnimation on zoomScale { id: shrinkAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 - to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 + to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1 onFinished: { if (!delegate.pressed) { growAnim.restart(); @@ -72,7 +72,7 @@ MouseArea { NumberAnimation on zoomScale { id: growAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 to: 1 onFinished: { if (delegate.launchAppRequested) { diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerListDelegate.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerListDelegate.qml index e4a959c3..ec85b924 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerListDelegate.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/DrawerListDelegate.qml @@ -16,7 +16,6 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell MouseArea { id: delegate diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/GridViewAppDrawer.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/GridViewAppDrawer.qml index 451ea626..1c8e7400 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/GridViewAppDrawer.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/GridViewAppDrawer.qml @@ -15,7 +15,6 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.extras 2.0 as PlasmaExtra import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio diff --git a/containments/homescreens/folio/package/contents/ui/appdrawer/ListViewAppDrawer.qml b/containments/homescreens/folio/package/contents/ui/appdrawer/ListViewAppDrawer.qml index f80a9f0c..ce07ae4f 100644 --- a/containments/homescreens/folio/package/contents/ui/appdrawer/ListViewAppDrawer.qml +++ b/containments/homescreens/folio/package/contents/ui/appdrawer/ListViewAppDrawer.qml @@ -15,7 +15,6 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.extras 2.0 as PlasmaExtra import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio diff --git a/containments/homescreens/folio/package/contents/ui/private/DelegateRemoveButton.qml b/containments/homescreens/folio/package/contents/ui/private/DelegateRemoveButton.qml index 70252b11..71fdaf90 100644 --- a/containments/homescreens/folio/package/contents/ui/private/DelegateRemoveButton.qml +++ b/containments/homescreens/folio/package/contents/ui/private/DelegateRemoveButton.qml @@ -15,7 +15,6 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio PC3.RoundButton { diff --git a/containments/homescreens/folio/package/contents/ui/private/OpenDrawerButton.qml b/containments/homescreens/folio/package/contents/ui/private/OpenDrawerButton.qml index caa5f0dc..55eeb3ed 100644 --- a/containments/homescreens/folio/package/contents/ui/private/OpenDrawerButton.qml +++ b/containments/homescreens/folio/package/contents/ui/private/OpenDrawerButton.qml @@ -16,9 +16,6 @@ import org.kde.draganddrop 2.0 as DragDrop import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - - MouseArea { id: arrowUpIcon z: 9 diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml index a2ba0778..c909b371 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml @@ -13,6 +13,7 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.kirigami 2.19 as Kirigami @@ -146,8 +147,8 @@ Item { NumberAnimation on zoomScale { id: shrinkAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 - to: MobileShell.MobileShellSettings.animationsEnabled ? 0.95 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 + to: ShellSettings.Settings.animationsEnabled ? 0.95 : 1 onFinished: { if (!mouseArea.pressed) { growAnim.restart(); @@ -158,7 +159,7 @@ Item { NumberAnimation on zoomScale { id: growAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 to: 1 onFinished: { if (mouseArea.launchAppRequested) { diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml index add3e947..adc40ac0 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml @@ -13,6 +13,7 @@ import org.kde.draganddrop 2.0 as DragDrop import org.kde.kirigami 2.19 as Kirigami import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Item { id: root @@ -165,7 +166,7 @@ Item { NumberAnimation { target: favoritesGrid properties: 'openFolderProgress' - duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 200 : 0 to: 1 easing.type: Easing.InOutQuad } @@ -175,7 +176,7 @@ Item { NumberAnimation { target: folderGrid properties: 'openProgress' - duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 200 : 0 to: 1 easing.type: Easing.InOutQuad } @@ -189,7 +190,7 @@ Item { NumberAnimation { target: folderGrid properties: 'openProgress' - duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 200 : 0 to: 0 easing.type: Easing.InOutQuad } @@ -199,7 +200,7 @@ Item { NumberAnimation { target: favoritesGrid properties: 'openFolderProgress' - duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 + duration: ShellSettings.Settings.animationsEnabled ? 200 : 0 to: 0 easing.type: Easing.InOutQuad } diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 4a88abef..a80abd77 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -15,6 +15,7 @@ import org.kde.plasma.extras as PlasmaExtras import org.kde.kquickcontrolsaddons import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.private.mobile.homescreen.halcyon as Halcyon import org.kde.kirigami as Kirigami @@ -93,8 +94,8 @@ MouseArea { NumberAnimation on zoomScale { id: shrinkAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 - to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 + to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1 onFinished: { if (!delegate.pressed) { growAnim.restart(); @@ -105,7 +106,7 @@ MouseArea { NumberAnimation on zoomScale { id: growAnim running: false - duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 + duration: ShellSettings.Settings.animationsEnabled ? 80 : 1 to: 1 onFinished: { if (delegate.launchAppRequested) { diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml index 6717f559..2b148f85 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml @@ -12,7 +12,6 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.private.mobile.homescreen.halcyon 1.0 as Halcyon diff --git a/containments/panel/package/contents/ui/main.qml b/containments/panel/package/contents/ui/main.qml index ad9debfd..463d38ec 100644 --- a/containments/panel/package/contents/ui/main.qml +++ b/containments/panel/package/contents/ui/main.qml @@ -16,7 +16,6 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState diff --git a/containments/taskpanel/package/contents/ui/main.qml b/containments/taskpanel/package/contents/ui/main.qml index 196e6f3d..d8e861f6 100644 --- a/containments/taskpanel/package/contents/ui/main.qml +++ b/containments/taskpanel/package/contents/ui/main.qml @@ -16,7 +16,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState PlasmaCore.ColorScope { @@ -32,7 +32,7 @@ PlasmaCore.ColorScope { property: "visibilityMode" // 0 - VisibilityMode.NormalPanel // 2 - VisibilityMode.LetWindowsCover HACK: TODO one day we make delete the panel component instead of making it invisible in gesture-only mode - value: MobileShell.MobileShellSettings.navigationPanelEnabled ? 0 : 2 + value: ShellSettings.Settings.navigationPanelEnabled ? 0 : 2 } // we have the following scenarios: @@ -40,7 +40,7 @@ PlasmaCore.ColorScope { // - system is in landscape orientation & gesture mode is enabled (panel on bottom) // - system is in portrait orientation (panel on bottom) readonly property bool inLandscape: Screen.width > Screen.height; - readonly property bool isInLandscapeNavPanelMode: inLandscape && MobileShell.MobileShellSettings.navigationPanelEnabled + readonly property bool isInLandscapeNavPanelMode: inLandscape && ShellSettings.Settings.navigationPanelEnabled readonly property real navigationPanelHeight: PlasmaCore.Units.gridUnit * 2 @@ -141,7 +141,7 @@ PlasmaCore.ColorScope { // load appropriate system navigation component Loader { id: navigationLoader - active: MobileShell.MobileShellSettings.navigationPanelEnabled + active: ShellSettings.Settings.navigationPanelEnabled anchors.fill: parent sourceComponent: NavigationPanelComponent { opaqueBar: root.opaqueBar diff --git a/kcms/mobileshell/package/contents/ui/VibrationForm.qml b/kcms/mobileshell/package/contents/ui/VibrationForm.qml index bca76ee2..8b8597cb 100644 --- a/kcms/mobileshell/package/contents/ui/VibrationForm.qml +++ b/kcms/mobileshell/package/contents/ui/VibrationForm.qml @@ -9,8 +9,8 @@ import QtQuick.Controls 2.15 as QQC2 import org.kde.kirigami 2.19 as Kirigami import org.kde.kcm 1.3 as KCM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Kirigami.ScrollablePage { id: root @@ -34,10 +34,10 @@ Kirigami.ScrollablePage { id: shellVibrationsSwitch text: i18n("Shell Vibrations") description: i18n("Whether to have vibrations enabled in the shell.") - checked: MobileShell.MobileShellSettings.vibrationsEnabled + checked: ShellSettings.Settings.vibrationsEnabled onCheckedChanged: { - if (checked != MobileShell.MobileShellSettings.vibrationsEnabled) { - MobileShell.MobileShellSettings.vibrationsEnabled = checked; + if (checked != ShellSettings.Settings.vibrationsEnabled) { + ShellSettings.Settings.vibrationsEnabled = checked; } } } @@ -53,7 +53,7 @@ Kirigami.ScrollablePage { property string mediumIntensityString: i18nc("Medium intensity", "Medium") property string highIntensityString: i18nc("High intensity", "High") - currentIndex: indexOfValue(MobileShell.MobileShellSettings.vibrationIntensity) + currentIndex: indexOfValue(ShellSettings.Settings.vibrationIntensity) model: ListModel { // we can't use i18n with ListElement Component.onCompleted: { @@ -62,7 +62,7 @@ Kirigami.ScrollablePage { append({"name": vibrationIntensityDelegate.lowIntensityString, "value": 0.2}); // indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here - vibrationIntensityDelegate.currentIndex = vibrationIntensityDelegate.indexOfValue(MobileShell.MobileShellSettings.vibrationIntensity) + vibrationIntensityDelegate.currentIndex = vibrationIntensityDelegate.indexOfValue(ShellSettings.Settings.vibrationIntensity) } } @@ -70,7 +70,7 @@ Kirigami.ScrollablePage { valueRole: "value" Component.onCompleted: dialog.parent = root - onCurrentValueChanged: MobileShell.MobileShellSettings.vibrationIntensity = currentValue; + onCurrentValueChanged: ShellSettings.Settings.vibrationIntensity = currentValue; } MobileForm.FormDelegateSeparator { above: vibrationIntensityDelegate; below: vibrationDurationDelegate } @@ -84,7 +84,7 @@ Kirigami.ScrollablePage { property string mediumString: i18nc("Medium duration", "Medium") property string shortString: i18nc("Short duration", "Short") - currentIndex: indexOfValue(MobileShell.MobileShellSettings.vibrationDuration) + currentIndex: indexOfValue(ShellSettings.Settings.vibrationDuration) model: ListModel { // we can't use i18n with ListElement Component.onCompleted: { @@ -93,7 +93,7 @@ Kirigami.ScrollablePage { append({"name": vibrationDurationDelegate.shortString, "value": 15}); // indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here - vibrationDurationDelegate.currentIndex = vibrationDurationDelegate.indexOfValue(MobileShell.MobileShellSettings.vibrationDuration) + vibrationDurationDelegate.currentIndex = vibrationDurationDelegate.indexOfValue(ShellSettings.Settings.vibrationDuration) } } @@ -101,7 +101,7 @@ Kirigami.ScrollablePage { valueRole: "value" Component.onCompleted: dialog.parent = root - onCurrentValueChanged: MobileShell.MobileShellSettings.vibrationDuration = currentValue; + onCurrentValueChanged: ShellSettings.Settings.vibrationDuration = currentValue; } } } diff --git a/kcms/mobileshell/package/contents/ui/main.qml b/kcms/mobileshell/package/contents/ui/main.qml index 1cab289f..75b75f7f 100644 --- a/kcms/mobileshell/package/contents/ui/main.qml +++ b/kcms/mobileshell/package/contents/ui/main.qml @@ -9,8 +9,8 @@ import QtQuick.Controls 2.15 as QQC2 import org.kde.kirigami 2.19 as Kirigami import org.kde.kcm 1.3 as KCM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings KCM.SimpleKCM { id: root @@ -48,10 +48,10 @@ KCM.SimpleKCM { id: animationsSwitch text: i18n("Animations") description: i18n("If this is off, animations will be reduced as much as possible.") - checked: MobileShell.MobileShellSettings.animationsEnabled + checked: ShellSettings.Settings.animationsEnabled onCheckedChanged: { - if (checked != MobileShell.MobileShellSettings.animationsEnabled) { - MobileShell.MobileShellSettings.animationsEnabled = checked; + if (checked != ShellSettings.Settings.animationsEnabled) { + ShellSettings.Settings.animationsEnabled = checked; } } } @@ -73,10 +73,10 @@ KCM.SimpleKCM { id: gestureDelegate text: i18n("Gesture-only Mode") description: i18n("Whether to hide the navigation panel.") - checked: !MobileShell.MobileShellSettings.navigationPanelEnabled + checked: !ShellSettings.Settings.navigationPanelEnabled onCheckedChanged: { - if (checked != !MobileShell.MobileShellSettings.navigationPanelEnabled) { - MobileShell.MobileShellSettings.navigationPanelEnabled = !checked; + if (checked != !ShellSettings.Settings.navigationPanelEnabled) { + ShellSettings.Settings.navigationPanelEnabled = !checked; } } } @@ -97,10 +97,10 @@ KCM.SimpleKCM { MobileForm.FormSwitchDelegate { text: i18n("Show Application Previews") description: i18n("Turning this off may help improve performance.") - checked: MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled + checked: ShellSettings.Settings.taskSwitcherPreviewsEnabled onCheckedChanged: { - if (checked != MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled) { - MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled = checked; + if (checked != ShellSettings.Settings.taskSwitcherPreviewsEnabled) { + ShellSettings.Settings.taskSwitcherPreviewsEnabled = checked; } } } @@ -135,15 +135,15 @@ KCM.SimpleKCM { text: i18n("Top Left Drawer Mode") description: i18n("Mode when opening from the top left.") - currentIndex: indexOfValue(MobileShell.MobileShellSettings.actionDrawerTopLeftMode) + currentIndex: indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode) model: ListModel { // we can't use i18n with ListElement Component.onCompleted: { - append({"name": parentCol.pinnedString, "value": MobileShell.MobileShellSettings.Pinned}); - append({"name": parentCol.expandedString, "value": MobileShell.MobileShellSettings.Expanded}); + append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned}); + append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded}); // indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here - topLeftActionDrawerModeDelegate.currentIndex = topLeftActionDrawerModeDelegate.indexOfValue(MobileShell.MobileShellSettings.actionDrawerTopLeftMode) + topLeftActionDrawerModeDelegate.currentIndex = topLeftActionDrawerModeDelegate.indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode) } } @@ -151,7 +151,7 @@ KCM.SimpleKCM { valueRole: "value" Component.onCompleted: dialog.parent = root - onCurrentValueChanged: MobileShell.MobileShellSettings.actionDrawerTopLeftMode = currentValue + onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopLeftMode = currentValue } MobileForm.FormDelegateSeparator { above: topLeftActionDrawerModeDelegate; below: topRightActionDrawerModeDelegate } @@ -164,11 +164,11 @@ KCM.SimpleKCM { model: ListModel { // we can't use i18n with ListElement Component.onCompleted: { - append({"name": parentCol.pinnedString, "value": MobileShell.MobileShellSettings.Pinned}); - append({"name": parentCol.expandedString, "value": MobileShell.MobileShellSettings.Expanded}); + append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned}); + append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded}); // indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here - topRightActionDrawerModeDelegate.currentIndex = topRightActionDrawerModeDelegate.indexOfValue(MobileShell.MobileShellSettings.actionDrawerTopRightMode) + topRightActionDrawerModeDelegate.currentIndex = topRightActionDrawerModeDelegate.indexOfValue(ShellSettings.Settings.actionDrawerTopRightMode) } } @@ -178,7 +178,7 @@ KCM.SimpleKCM { Component.onCompleted: { dialog.parent = root } - onCurrentValueChanged: MobileShell.MobileShellSettings.actionDrawerTopRightMode = currentValue + onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopRightMode = currentValue } } }