shellsettingsplugin: Extract out from mobileshell component

This commit is contained in:
Devin Lin 2023-03-18 12:28:17 -07:00
parent 9e8838834b
commit 79e99a9cfe
53 changed files with 180 additions and 127 deletions

View file

@ -7,3 +7,4 @@ add_subdirectory(mobileshell)
add_subdirectory(mobileshellstate) add_subdirectory(mobileshellstate)
add_subdirectory(quicksettingsplugin) add_subdirectory(quicksettingsplugin)
add_subdirectory(windowplugin) add_subdirectory(windowplugin)
add_subdirectory(shellsettingsplugin)

View file

@ -6,7 +6,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
set(mobileshellplugin_SRCS set(mobileshellplugin_SRCS
mobileshellplugin.cpp mobileshellplugin.cpp
mobileshellsettings.cpp
shellutil.cpp shellutil.cpp
components/direction.cpp components/direction.cpp
notifications/notificationthumbnailer.cpp notifications/notificationthumbnailer.cpp

View file

@ -16,7 +16,6 @@
#include "taskswitcher/displaysmodel.h" #include "taskswitcher/displaysmodel.h"
#include "mobileshellsettings.h"
#include "shellutil.h" #include "shellutil.h"
QUrl resolvePath(std::string str) QUrl resolvePath(std::string str)
@ -32,10 +31,6 @@ void MobileShellPlugin::registerTypes(const char *uri)
return ShellUtil::instance(); return ShellUtil::instance();
}); });
qmlRegisterSingletonType<MobileShellSettings>(uri, 1, 0, "MobileShellSettings", [](QQmlEngine *, QJSEngine *) -> QObject * {
return MobileShellSettings::self();
});
// components // components
qmlRegisterType<Direction>(uri, 1, 0, "Direction"); qmlRegisterType<Direction>(uri, 1, 0, "Direction");

View file

@ -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.nanoshell 2.0 as NanoShell
import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "../components" as Components
Item { Item {
id: root id: root
@ -227,7 +229,7 @@ Item {
onFinished: root.opened = true; onFinished: root.opened = true;
} }
MobileShell.Flickable { Components.Flickable {
id: flickable id: flickable
anchors.fill: parent anchors.fill: parent

View file

@ -6,7 +6,7 @@
import QtQuick 2.15 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. * 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 the user swiped from the top left, otherwise it's from the top right
if (mouse.x < root.width / 2) { if (mouse.x < root.width / 2) {
actionDrawer.openToPinnedMode = MobileShell.MobileShellSettings.actionDrawerTopLeftMode == MobileShell.MobileShellSettings.Pinned; actionDrawer.openToPinnedMode = ShellSettings.Settings.actionDrawerTopLeftMode == ShellSettings.Settingss.Pinned;
} else { } else {
actionDrawer.openToPinnedMode = MobileShell.MobileShellSettings.actionDrawerTopRightMode == MobileShell.MobileShellSettings.Pinned; actionDrawer.openToPinnedMode = ShellSettings.Settings.actionDrawerTopRightMode == ShellSettings.Settings.Pinned;
} }
startSwipe(); startSwipe();

View file

@ -11,7 +11,6 @@ import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "../components" as Components import "../components" as Components
import "../widgets/notifications" as Notifications import "../widgets/notifications" as Notifications

View file

@ -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.core 2.0 as PlasmaCore
import org.kde.plasma.private.nanoshell 2.0 as NanoShell 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 as MobileShell
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.private.mobileshell.state as MobileShellState
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import "../../components" as Components import "../../components" as Components

View file

@ -11,7 +11,7 @@ import QtQuick.Layouts 1.1
import org.kde.kirigami 2.12 as Kirigami import org.kde.kirigami 2.12 as Kirigami
import org.kde.plasma.core 2.0 as PlasmaCore 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 org.kde.plasma.components 3.0 as PlasmaComponents
import "../../components" as Components import "../../components" as Components
@ -23,7 +23,7 @@ QuickSettingsDelegate {
iconItem: icon iconItem: icon
// scale animation on press // scale animation on press
zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
background: Item { background: Item {
// very simple shadow for performance // very simple shadow for performance

View file

@ -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.core 2.0 as PlasmaCore
import org.kde.plasma.private.nanoshell 2.0 as NanoShell 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 org.kde.plasma.components 3.0 as PlasmaComponents
import "../../components" as Components import "../../components" as Components
@ -22,7 +22,7 @@ QuickSettingsDelegate {
iconItem: icon iconItem: icon
// scale animation on press // scale animation on press
zoomScale: (MobileShell.MobileShellSettings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
background: Item { background: Item {
// very simple shadow for performance // very simple shadow for performance
@ -52,7 +52,7 @@ QuickSettingsDelegate {
} }
} }
MobileShell.HapticsEffectLoader { Components.HapticsEffectLoader {
id: haptics id: haptics
} }

View file

@ -3,14 +3,14 @@
import QtQuick 2.15 import QtQuick 2.15
import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
Loader { Loader {
// source: "qrc:/org/kde/plasma/private/mobileshell/qml/components/HapticsEffectWrapper.qml" // source: "qrc:/org/kde/plasma/private/mobileshell/qml/components/HapticsEffectWrapper.qml"
property bool valid: item !== null property bool valid: item !== null
function buttonVibrate() { function buttonVibrate() {
if (valid && MobileShell.MobileShellSettings.vibrationsEnabled) { if (valid && ShellSettings.Settings.vibrationsEnabled) {
// TODO we need a haptics stack for Qt 6 // TODO we need a haptics stack for Qt 6
// item.intensity = MobileShell.MobileShellSettings.vibrationIntensity; // item.intensity = MobileShell.MobileShellSettings.vibrationIntensity;
// item.duration = MobileShell.MobileShellSettings.vibrationDuration; // item.duration = MobileShell.MobileShellSettings.vibrationDuration;

View file

@ -11,7 +11,7 @@ import Qt5Compat.GraphicalEffects
import org.kde.kirigami 2.13 as Kirigami import org.kde.kirigami 2.13 as Kirigami
import org.kde.plasma.private.nanoshell 2.0 as NanoShell 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 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 // no-animation mode transition
Transition { Transition {
from: "closed" from: "closed"
enabled: !MobileShell.MobileShellSettings.animationsEnabled enabled: !ShellSettings.Settings.animationsEnabled
SequentialAnimation { SequentialAnimation {
ScriptAction { ScriptAction {
script: { script: {
@ -177,7 +177,7 @@ MouseArea { // use mousearea to ensure clicks don't go behind
// full animation transition // full animation transition
Transition { Transition {
from: "closed" from: "closed"
enabled: MobileShell.MobileShellSettings.animationsEnabled enabled: ShellSettings.Settings.animationsEnabled
SequentialAnimation { SequentialAnimation {
ScriptAction { ScriptAction {
script: { script: {

View file

@ -10,7 +10,7 @@ import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.plasmoid import org.kde.plasma.plasmoid
import org.kde.taskmanager as TaskManager 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.state as MobileShellState
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
@ -60,7 +60,7 @@ Item {
function evaluateMargins() { function evaluateMargins() {
topMargin = plasmoid.availableScreenRect.y topMargin = plasmoid.availableScreenRect.y
// add a specific check for the nav panel for now, since the gesture mode still technically has height // 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 leftMargin = plasmoid.availableScreenRect.x
rightMargin = root.width - (plasmoid.availableScreenRect.x + plasmoid.availableScreenRect.width) rightMargin = root.width - (plasmoid.availableScreenRect.x + plasmoid.availableScreenRect.width)
} }
@ -182,7 +182,7 @@ Item {
opacityAnim.restart(); opacityAnim.restart();
} }
function zoomOut() { function zoomOut() {
if (MobileShell.MobileShellSettings.animationsEnabled) { if (ShellSettings.Settings.animationsEnabled) {
scaleAnim.to = 0.8; scaleAnim.to = 0.8;
scaleAnim.restart(); scaleAnim.restart();
opacityAnim.to = 0; opacityAnim.to = 0;
@ -192,13 +192,13 @@ Item {
NumberAnimation on opacity { NumberAnimation on opacity {
id: opacityAnim id: opacityAnim
duration: MobileShell.MobileShellSettings.animationsEnabled ? 300 : 0 duration: ShellSettings.Settings.animationsEnabled ? 300 : 0
running: false running: false
} }
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: scaleAnim id: scaleAnim
duration: MobileShell.MobileShellSettings.animationsEnabled ? 600 : 0 duration: ShellSettings.Settings.animationsEnabled ? 600 : 0
running: false running: false
easing.type: Easing.OutExpo easing.type: Easing.OutExpo
} }

View file

@ -15,10 +15,10 @@ import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.plasma5support 2.0 as P5Support
import org.kde.plasma.components 3.0 as PlasmaComponents 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 org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
import "indicators" as Indicators import "indicators" as Indicators
import "../dataproviders" as DataProviders
Item { Item {
id: root id: root
@ -217,7 +217,7 @@ Item {
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
PlasmaComponents.Label { PlasmaComponents.Label {
property var signalStrengthInfo: MobileShell.SignalStrengthInfo {} property var signalStrengthInfo: DataProviders.SignalStrengthInfo {}
visible: root.showTime visible: root.showTime
text: signalStrengthInfo.label text: signalStrengthInfo.label

View file

@ -11,7 +11,6 @@ import QtQuick.Layouts 1.4
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.workspace.components 2.0 as PW import org.kde.plasma.workspace.components 2.0 as PW
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "../../dataproviders" as DataProviders import "../../dataproviders" as DataProviders

View file

@ -6,18 +6,18 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/ */
import QtQuick 2.2 import QtQuick
import QtQuick.Layouts 1.4 import QtQuick.Layouts
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.bluezqt as BluezQt
import org.kde.bluezqt 1.0 as BluezQt import "../../dataproviders" as DataProviders
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: connectionIcon id: connectionIcon
readonly property var provider: MobileShell.BluetoothInfo {} readonly property var provider: DataProviders.BluetoothInfo {}
source: provider.icon source: provider.icon
colorGroup: PlasmaCore.ColorScope.colorGroup colorGroup: PlasmaCore.ColorScope.colorGroup

View file

@ -6,12 +6,11 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/ */
import QtQuick 2.2 import QtQuick
import QtQuick.Layouts 1.4 import QtQuick.Layouts
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: connectionIcon id: connectionIcon

View file

@ -5,17 +5,18 @@
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
*/ */
import QtQuick 2.1 import QtQuick
import QtQuick.Layouts 1.1 import QtQuick.Layouts
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "../../dataproviders" as DataProviders
Item { Item {
required property InternetIndicator internetIndicator 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 // check if the internet indicator icon is a mobile data related one
readonly property bool isInternetIndicatorMobileData: internetIndicator && internetIndicator.icon && internetIndicator.icon.startsWith('network-mobile-') readonly property bool isInternetIndicatorMobileData: internetIndicator && internetIndicator.icon && internetIndicator.icon.startsWith('network-mobile-')

View file

@ -6,16 +6,17 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/ */
import QtQuick 2.2 import QtQuick
import QtQuick.Layouts 1.4 import QtQuick.Layouts
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.private.volume 0.1 import org.kde.plasma.private.volume 0.1
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "../../dataproviders" as DataProviders
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: paIcon id: paIcon
readonly property var provider: MobileShell.AudioInfo {} readonly property var provider: DataProviders.AudioInfo {}
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: height Layout.preferredWidth: height

View file

@ -14,16 +14,17 @@ import Qt5Compat.GraphicalEffects
import org.kde.plasma.core as PlasmaCore import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.extras as PlasmaExtra import org.kde.plasma.extras as PlasmaExtra
import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.kquickcontrolsaddons as KQCAddons import org.kde.kquickcontrolsaddons as KQCAddons
import org.kde.plasma.private.volume import org.kde.plasma.private.volume
import "../dataproviders" as DataProviders
// capture presses on the audio applet so it doesn't close the overlay // capture presses on the audio applet so it doesn't close the overlay
ColumnLayout { ColumnLayout {
spacing: 0 spacing: 0
required property MobileShell.AudioInfo audioInfo required property DataProviders.AudioInfo audioInfo
PulseObjectFilterModel { PulseObjectFilterModel {
id: paSinkFilterModel id: paSinkFilterModel

View file

@ -10,7 +10,6 @@ import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import Qt5Compat.GraphicalEffects
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.core 2.1 as PlasmaCore import org.kde.plasma.core 2.1 as PlasmaCore

View file

@ -22,6 +22,8 @@ import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import "../dataproviders" as DataProviders
Window { Window {
id: window id: window
@ -67,7 +69,7 @@ Window {
} }
} }
MobileShell.AudioInfo { DataProviders.AudioInfo {
id: audioInfo id: audioInfo
} }

View file

@ -14,8 +14,6 @@ import Qt5Compat.GraphicalEffects
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras 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.milou 0.1 as Milou
import org.kde.kirigami 2.19 as Kirigami import org.kde.kirigami 2.19 as Kirigami

View file

@ -11,7 +11,6 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.12 as Kirigami 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.private.mobileshell.state 1.0 as MobileShellState
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.components 3.0 as PlasmaComponents3

View file

@ -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.core 2.0 as PlasmaCore
import org.kde.plasma.plasma5support 2.0 as P5Support 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 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.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.components 3.0 as PlasmaComponents3
@ -143,7 +144,7 @@ Item {
property var pendingNotificationWithAction 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. // 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 readonly property bool listOverflowing: contentItem.childrenRect.height + toolButtons.height + spacing >= root.height

View file

@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
# 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)

View file

@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
# SPDX-License-Identifier: GPL-2.0-or-later
module org.kde.plasma.private.mobileshell.shellsettingsplugin
plugin shellsettingsplugin

View file

@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "shellsettingsplugin.h"
#include "mobileshellsettings.h"
#include <QQmlContext>
#include <QQuickItem>
void ShellSettingsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.shellsettingsplugin"));
qmlRegisterSingletonType<MobileShellSettings>(uri, 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) -> QObject * {
return MobileShellSettings::self();
});
}

View file

@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QUrl>
#include <QQmlEngine>
#include <QQmlExtensionPlugin>
class ShellSettingsPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
};

View file

@ -10,7 +10,6 @@ import QtQuick.Layouts 1.15
import org.kde.taskmanager 0.1 as TaskManager import org.kde.taskmanager 0.1 as TaskManager
import org.kde.plasma.core 2.1 as PlasmaCore import org.kde.plasma.core 2.1 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents 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 1.0 as MobileShell
MobileShell.Flickable { MobileShell.Flickable {

View file

@ -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.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell 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.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.private.mobile.homescreen.folio 1.0 as Folio
@ -115,8 +116,8 @@ ContainmentLayoutManager.ItemContainer {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: shrinkAnim id: shrinkAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1
onFinished: { onFinished: {
if (!mouseArea.pressed) { if (!mouseArea.pressed) {
growAnim.restart(); growAnim.restart();
@ -127,7 +128,7 @@ ContainmentLayoutManager.ItemContainer {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: growAnim id: growAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: 1 to: 1
onFinished: { onFinished: {
if (mouseArea.launchAppRequested) { if (mouseArea.launchAppRequested) {

View file

@ -19,8 +19,6 @@ import "appdrawer"
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager 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 import org.kde.private.mobile.homescreen.folio 1.0 as Folio
Item { Item {

View file

@ -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.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 org.kde.private.mobile.homescreen.folio 1.0 as Folio
import "private" as Private import "private" as Private

View file

@ -20,7 +20,7 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM
import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell
Flickable { MobileShell.Flickable {
id: mainFlickable id: mainFlickable
required property var homeScreenState required property var homeScreenState

View file

@ -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.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell 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.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.private.mobile.homescreen.folio 1.0 as Folio
import org.kde.kirigami 2.14 as Kirigami import org.kde.kirigami 2.14 as Kirigami

View file

@ -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.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import "private" as Private import "private" as Private
ContainmentLayoutManager.BasicAppletContainer { ContainmentLayoutManager.BasicAppletContainer {

View file

@ -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.plasma.extras 2.0 as PlasmaExtra
import org.kde.kirigami 2.10 as Kirigami 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 1.0 as MobileShell
import "../private" import "../private"

View file

@ -13,8 +13,6 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
Loader { Loader {
id: root id: root

View file

@ -15,7 +15,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager 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 { MouseArea {
id: delegate id: delegate
@ -60,8 +60,8 @@ MouseArea {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: shrinkAnim id: shrinkAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1
onFinished: { onFinished: {
if (!delegate.pressed) { if (!delegate.pressed) {
growAnim.restart(); growAnim.restart();
@ -72,7 +72,7 @@ MouseArea {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: growAnim id: growAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: 1 to: 1
onFinished: { onFinished: {
if (delegate.launchAppRequested) { if (delegate.launchAppRequested) {

View file

@ -16,7 +16,6 @@ import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
MouseArea { MouseArea {
id: delegate id: delegate

View file

@ -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.plasma.extras 2.0 as PlasmaExtra
import org.kde.kirigami 2.10 as Kirigami 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 1.0 as MobileShell
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.private.mobile.homescreen.folio 1.0 as Folio

View file

@ -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.plasma.extras 2.0 as PlasmaExtra
import org.kde.kirigami 2.10 as Kirigami 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 1.0 as MobileShell
import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.private.mobile.homescreen.folio 1.0 as Folio

View file

@ -15,7 +15,6 @@ import org.kde.plasma.components 3.0 as PC3
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager 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 org.kde.private.mobile.homescreen.folio 1.0 as Folio
PC3.RoundButton { PC3.RoundButton {

View file

@ -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.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
MouseArea { MouseArea {
id: arrowUpIcon id: arrowUpIcon
z: 9 z: 9

View file

@ -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.containmentlayoutmanager 1.0 as ContainmentLayoutManager
import org.kde.plasma.private.mobileshell 1.0 as MobileShell 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.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.kirigami 2.19 as Kirigami import org.kde.kirigami 2.19 as Kirigami
@ -146,8 +147,8 @@ Item {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: shrinkAnim id: shrinkAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: MobileShell.MobileShellSettings.animationsEnabled ? 0.95 : 1 to: ShellSettings.Settings.animationsEnabled ? 0.95 : 1
onFinished: { onFinished: {
if (!mouseArea.pressed) { if (!mouseArea.pressed) {
growAnim.restart(); growAnim.restart();
@ -158,7 +159,7 @@ Item {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: growAnim id: growAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: 1 to: 1
onFinished: { onFinished: {
if (mouseArea.launchAppRequested) { if (mouseArea.launchAppRequested) {

View file

@ -13,6 +13,7 @@ import org.kde.draganddrop 2.0 as DragDrop
import org.kde.kirigami 2.19 as Kirigami import org.kde.kirigami 2.19 as Kirigami
import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
Item { Item {
id: root id: root
@ -165,7 +166,7 @@ Item {
NumberAnimation { NumberAnimation {
target: favoritesGrid target: favoritesGrid
properties: 'openFolderProgress' properties: 'openFolderProgress'
duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 duration: ShellSettings.Settings.animationsEnabled ? 200 : 0
to: 1 to: 1
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
@ -175,7 +176,7 @@ Item {
NumberAnimation { NumberAnimation {
target: folderGrid target: folderGrid
properties: 'openProgress' properties: 'openProgress'
duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 duration: ShellSettings.Settings.animationsEnabled ? 200 : 0
to: 1 to: 1
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
@ -189,7 +190,7 @@ Item {
NumberAnimation { NumberAnimation {
target: folderGrid target: folderGrid
properties: 'openProgress' properties: 'openProgress'
duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 duration: ShellSettings.Settings.animationsEnabled ? 200 : 0
to: 0 to: 0
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
@ -199,7 +200,7 @@ Item {
NumberAnimation { NumberAnimation {
target: favoritesGrid target: favoritesGrid
properties: 'openFolderProgress' properties: 'openFolderProgress'
duration: MobileShell.MobileShellSettings.animationsEnabled ? 200 : 0 duration: ShellSettings.Settings.animationsEnabled ? 200 : 0
to: 0 to: 0
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }

View file

@ -15,6 +15,7 @@ import org.kde.plasma.extras as PlasmaExtras
import org.kde.kquickcontrolsaddons import org.kde.kquickcontrolsaddons
import org.kde.plasma.private.mobileshell as MobileShell 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.private.mobile.homescreen.halcyon as Halcyon
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
@ -93,8 +94,8 @@ MouseArea {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: shrinkAnim id: shrinkAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: MobileShell.MobileShellSettings.animationsEnabled ? 0.8 : 1 to: ShellSettings.Settings.animationsEnabled ? 0.8 : 1
onFinished: { onFinished: {
if (!delegate.pressed) { if (!delegate.pressed) {
growAnim.restart(); growAnim.restart();
@ -105,7 +106,7 @@ MouseArea {
NumberAnimation on zoomScale { NumberAnimation on zoomScale {
id: growAnim id: growAnim
running: false running: false
duration: MobileShell.MobileShellSettings.animationsEnabled ? 80 : 1 duration: ShellSettings.Settings.animationsEnabled ? 80 : 1
to: 1 to: 1
onFinished: { onFinished: {
if (delegate.launchAppRequested) { if (delegate.launchAppRequested) {

View file

@ -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.plasma.extras 2.0 as PlasmaExtras
import org.kde.kirigami 2.10 as Kirigami 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 1.0 as MobileShell
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
import org.kde.private.mobile.homescreen.halcyon 1.0 as Halcyon import org.kde.private.mobile.homescreen.halcyon 1.0 as Halcyon

View file

@ -16,7 +16,6 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents 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 1.0 as MobileShell
import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState

View file

@ -16,7 +16,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.nanoshell 2.0 as NanoShell 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 import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState
PlasmaCore.ColorScope { PlasmaCore.ColorScope {
@ -32,7 +32,7 @@ PlasmaCore.ColorScope {
property: "visibilityMode" property: "visibilityMode"
// 0 - VisibilityMode.NormalPanel // 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 // 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: // 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 landscape orientation & gesture mode is enabled (panel on bottom)
// - system is in portrait orientation (panel on bottom) // - system is in portrait orientation (panel on bottom)
readonly property bool inLandscape: Screen.width > Screen.height; 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 readonly property real navigationPanelHeight: PlasmaCore.Units.gridUnit * 2
@ -141,7 +141,7 @@ PlasmaCore.ColorScope {
// load appropriate system navigation component // load appropriate system navigation component
Loader { Loader {
id: navigationLoader id: navigationLoader
active: MobileShell.MobileShellSettings.navigationPanelEnabled active: ShellSettings.Settings.navigationPanelEnabled
anchors.fill: parent anchors.fill: parent
sourceComponent: NavigationPanelComponent { sourceComponent: NavigationPanelComponent {
opaqueBar: root.opaqueBar opaqueBar: root.opaqueBar

View file

@ -9,8 +9,8 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.19 as Kirigami import org.kde.kirigami 2.19 as Kirigami
import org.kde.kcm 1.3 as KCM 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.kirigamiaddons.labs.mobileform 0.1 as MobileForm
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
Kirigami.ScrollablePage { Kirigami.ScrollablePage {
id: root id: root
@ -34,10 +34,10 @@ Kirigami.ScrollablePage {
id: shellVibrationsSwitch id: shellVibrationsSwitch
text: i18n("Shell Vibrations") text: i18n("Shell Vibrations")
description: i18n("Whether to have vibrations enabled in the shell.") description: i18n("Whether to have vibrations enabled in the shell.")
checked: MobileShell.MobileShellSettings.vibrationsEnabled checked: ShellSettings.Settings.vibrationsEnabled
onCheckedChanged: { onCheckedChanged: {
if (checked != MobileShell.MobileShellSettings.vibrationsEnabled) { if (checked != ShellSettings.Settings.vibrationsEnabled) {
MobileShell.MobileShellSettings.vibrationsEnabled = checked; ShellSettings.Settings.vibrationsEnabled = checked;
} }
} }
} }
@ -53,7 +53,7 @@ Kirigami.ScrollablePage {
property string mediumIntensityString: i18nc("Medium intensity", "Medium") property string mediumIntensityString: i18nc("Medium intensity", "Medium")
property string highIntensityString: i18nc("High intensity", "High") property string highIntensityString: i18nc("High intensity", "High")
currentIndex: indexOfValue(MobileShell.MobileShellSettings.vibrationIntensity) currentIndex: indexOfValue(ShellSettings.Settings.vibrationIntensity)
model: ListModel { model: ListModel {
// we can't use i18n with ListElement // we can't use i18n with ListElement
Component.onCompleted: { Component.onCompleted: {
@ -62,7 +62,7 @@ Kirigami.ScrollablePage {
append({"name": vibrationIntensityDelegate.lowIntensityString, "value": 0.2}); append({"name": vibrationIntensityDelegate.lowIntensityString, "value": 0.2});
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here // 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" valueRole: "value"
Component.onCompleted: dialog.parent = root Component.onCompleted: dialog.parent = root
onCurrentValueChanged: MobileShell.MobileShellSettings.vibrationIntensity = currentValue; onCurrentValueChanged: ShellSettings.Settings.vibrationIntensity = currentValue;
} }
MobileForm.FormDelegateSeparator { above: vibrationIntensityDelegate; below: vibrationDurationDelegate } MobileForm.FormDelegateSeparator { above: vibrationIntensityDelegate; below: vibrationDurationDelegate }
@ -84,7 +84,7 @@ Kirigami.ScrollablePage {
property string mediumString: i18nc("Medium duration", "Medium") property string mediumString: i18nc("Medium duration", "Medium")
property string shortString: i18nc("Short duration", "Short") property string shortString: i18nc("Short duration", "Short")
currentIndex: indexOfValue(MobileShell.MobileShellSettings.vibrationDuration) currentIndex: indexOfValue(ShellSettings.Settings.vibrationDuration)
model: ListModel { model: ListModel {
// we can't use i18n with ListElement // we can't use i18n with ListElement
Component.onCompleted: { Component.onCompleted: {
@ -93,7 +93,7 @@ Kirigami.ScrollablePage {
append({"name": vibrationDurationDelegate.shortString, "value": 15}); append({"name": vibrationDurationDelegate.shortString, "value": 15});
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here // 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" valueRole: "value"
Component.onCompleted: dialog.parent = root Component.onCompleted: dialog.parent = root
onCurrentValueChanged: MobileShell.MobileShellSettings.vibrationDuration = currentValue; onCurrentValueChanged: ShellSettings.Settings.vibrationDuration = currentValue;
} }
} }
} }

View file

@ -9,8 +9,8 @@ import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.19 as Kirigami import org.kde.kirigami 2.19 as Kirigami
import org.kde.kcm 1.3 as KCM 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.kirigamiaddons.labs.mobileform 0.1 as MobileForm
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
KCM.SimpleKCM { KCM.SimpleKCM {
id: root id: root
@ -48,10 +48,10 @@ KCM.SimpleKCM {
id: animationsSwitch id: animationsSwitch
text: i18n("Animations") text: i18n("Animations")
description: i18n("If this is off, animations will be reduced as much as possible.") description: i18n("If this is off, animations will be reduced as much as possible.")
checked: MobileShell.MobileShellSettings.animationsEnabled checked: ShellSettings.Settings.animationsEnabled
onCheckedChanged: { onCheckedChanged: {
if (checked != MobileShell.MobileShellSettings.animationsEnabled) { if (checked != ShellSettings.Settings.animationsEnabled) {
MobileShell.MobileShellSettings.animationsEnabled = checked; ShellSettings.Settings.animationsEnabled = checked;
} }
} }
} }
@ -73,10 +73,10 @@ KCM.SimpleKCM {
id: gestureDelegate id: gestureDelegate
text: i18n("Gesture-only Mode") text: i18n("Gesture-only Mode")
description: i18n("Whether to hide the navigation panel.") description: i18n("Whether to hide the navigation panel.")
checked: !MobileShell.MobileShellSettings.navigationPanelEnabled checked: !ShellSettings.Settings.navigationPanelEnabled
onCheckedChanged: { onCheckedChanged: {
if (checked != !MobileShell.MobileShellSettings.navigationPanelEnabled) { if (checked != !ShellSettings.Settings.navigationPanelEnabled) {
MobileShell.MobileShellSettings.navigationPanelEnabled = !checked; ShellSettings.Settings.navigationPanelEnabled = !checked;
} }
} }
} }
@ -97,10 +97,10 @@ KCM.SimpleKCM {
MobileForm.FormSwitchDelegate { MobileForm.FormSwitchDelegate {
text: i18n("Show Application Previews") text: i18n("Show Application Previews")
description: i18n("Turning this off may help improve performance.") description: i18n("Turning this off may help improve performance.")
checked: MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled checked: ShellSettings.Settings.taskSwitcherPreviewsEnabled
onCheckedChanged: { onCheckedChanged: {
if (checked != MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled) { if (checked != ShellSettings.Settings.taskSwitcherPreviewsEnabled) {
MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled = checked; ShellSettings.Settings.taskSwitcherPreviewsEnabled = checked;
} }
} }
} }
@ -135,15 +135,15 @@ KCM.SimpleKCM {
text: i18n("Top Left Drawer Mode") text: i18n("Top Left Drawer Mode")
description: i18n("Mode when opening from the top left.") description: i18n("Mode when opening from the top left.")
currentIndex: indexOfValue(MobileShell.MobileShellSettings.actionDrawerTopLeftMode) currentIndex: indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode)
model: ListModel { model: ListModel {
// we can't use i18n with ListElement // we can't use i18n with ListElement
Component.onCompleted: { Component.onCompleted: {
append({"name": parentCol.pinnedString, "value": MobileShell.MobileShellSettings.Pinned}); append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned});
append({"name": parentCol.expandedString, "value": MobileShell.MobileShellSettings.Expanded}); append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded});
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here // 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" valueRole: "value"
Component.onCompleted: dialog.parent = root Component.onCompleted: dialog.parent = root
onCurrentValueChanged: MobileShell.MobileShellSettings.actionDrawerTopLeftMode = currentValue onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopLeftMode = currentValue
} }
MobileForm.FormDelegateSeparator { above: topLeftActionDrawerModeDelegate; below: topRightActionDrawerModeDelegate } MobileForm.FormDelegateSeparator { above: topLeftActionDrawerModeDelegate; below: topRightActionDrawerModeDelegate }
@ -164,11 +164,11 @@ KCM.SimpleKCM {
model: ListModel { model: ListModel {
// we can't use i18n with ListElement // we can't use i18n with ListElement
Component.onCompleted: { Component.onCompleted: {
append({"name": parentCol.pinnedString, "value": MobileShell.MobileShellSettings.Pinned}); append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned});
append({"name": parentCol.expandedString, "value": MobileShell.MobileShellSettings.Expanded}); append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded});
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here // 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: { Component.onCompleted: {
dialog.parent = root dialog.parent = root
} }
onCurrentValueChanged: MobileShell.MobileShellSettings.actionDrawerTopRightMode = currentValue onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopRightMode = currentValue
} }
} }
} }