mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
shellsettingsplugin: Extract out from mobileshell component
This commit is contained in:
parent
9e8838834b
commit
79e99a9cfe
53 changed files with 180 additions and 127 deletions
|
|
@ -7,3 +7,4 @@ add_subdirectory(mobileshell)
|
|||
add_subdirectory(mobileshellstate)
|
||||
add_subdirectory(quicksettingsplugin)
|
||||
add_subdirectory(windowplugin)
|
||||
add_subdirectory(shellsettingsplugin)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<MobileShellSettings>(uri, 1, 0, "MobileShellSettings", [](QQmlEngine *, QJSEngine *) -> QObject * {
|
||||
return MobileShellSettings::self();
|
||||
});
|
||||
|
||||
// components
|
||||
qmlRegisterType<Direction>(uri, 1, 0, "Direction");
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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-')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
28
components/shellsettingsplugin/CMakeLists.txt
Normal file
28
components/shellsettingsplugin/CMakeLists.txt
Normal 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)
|
||||
|
||||
|
||||
|
||||
9
components/shellsettingsplugin/qmldir
Normal file
9
components/shellsettingsplugin/qmldir
Normal 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
|
||||
|
||||
|
||||
|
||||
17
components/shellsettingsplugin/shellsettingsplugin.cpp
Normal file
17
components/shellsettingsplugin/shellsettingsplugin.cpp
Normal 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();
|
||||
});
|
||||
}
|
||||
18
components/shellsettingsplugin/shellsettingsplugin.h
Normal file
18
components/shellsettingsplugin/shellsettingsplugin.h
Normal 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;
|
||||
};
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue