2022-02-13 04:23:57 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
|
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
import QtQuick.Controls 2.15 as QQC2
|
|
|
|
|
|
|
|
|
|
import org.kde.kirigami 2.19 as Kirigami
|
2023-06-06 19:31:58 +00:00
|
|
|
import org.kde.kcmutils as KCM
|
2022-06-22 17:43:39 +00:00
|
|
|
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
2023-03-18 19:28:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
2022-02-13 04:23:57 +00:00
|
|
|
|
|
|
|
|
KCM.SimpleKCM {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
title: i18n("Shell")
|
|
|
|
|
|
2022-03-17 19:34:27 +00:00
|
|
|
leftPadding: 0
|
|
|
|
|
rightPadding: 0
|
|
|
|
|
topPadding: Kirigami.Units.gridUnit
|
|
|
|
|
bottomPadding: Kirigami.Units.gridUnit
|
2022-02-13 04:23:57 +00:00
|
|
|
|
2022-03-17 19:34:27 +00:00
|
|
|
ColumnLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
width: root.width
|
2022-02-13 04:23:57 +00:00
|
|
|
|
2022-03-17 19:34:27 +00:00
|
|
|
MobileForm.FormCard {
|
2022-02-13 04:23:57 +00:00
|
|
|
Layout.fillWidth: true
|
2022-03-17 19:34:27 +00:00
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
MobileForm.FormCardHeader {
|
2022-04-29 20:15:53 +00:00
|
|
|
title: i18n("General")
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-06 01:02:18 +00:00
|
|
|
MobileForm.FormButtonDelegate {
|
|
|
|
|
id: shellVibrationsButton
|
2022-04-29 20:15:53 +00:00
|
|
|
text: i18n("Shell Vibrations")
|
2022-05-06 01:02:18 +00:00
|
|
|
onClicked: kcm.push("VibrationForm.qml")
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-22 17:43:39 +00:00
|
|
|
MobileForm.FormDelegateSeparator { above: shellVibrationsButton; below: animationsSwitch }
|
2022-04-30 00:02:33 +00:00
|
|
|
|
|
|
|
|
MobileForm.FormSwitchDelegate {
|
2022-05-06 01:02:18 +00:00
|
|
|
id: animationsSwitch
|
2022-04-30 00:02:33 +00:00
|
|
|
text: i18n("Animations")
|
|
|
|
|
description: i18n("If this is off, animations will be reduced as much as possible.")
|
2023-03-18 19:28:17 +00:00
|
|
|
checked: ShellSettings.Settings.animationsEnabled
|
2022-04-30 00:02:33 +00:00
|
|
|
onCheckedChanged: {
|
2023-03-18 19:28:17 +00:00
|
|
|
if (checked != ShellSettings.Settings.animationsEnabled) {
|
|
|
|
|
ShellSettings.Settings.animationsEnabled = checked;
|
2022-04-30 00:02:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-29 20:15:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MobileForm.FormCard {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
MobileForm.FormCardHeader {
|
2022-03-17 19:34:27 +00:00
|
|
|
title: i18n("Navigation Panel")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MobileForm.FormSwitchDelegate {
|
2022-09-10 02:32:04 +00:00
|
|
|
id: gestureDelegate
|
2022-03-17 19:34:27 +00:00
|
|
|
text: i18n("Gesture-only Mode")
|
|
|
|
|
description: i18n("Whether to hide the navigation panel.")
|
2023-03-18 19:28:17 +00:00
|
|
|
checked: !ShellSettings.Settings.navigationPanelEnabled
|
2022-03-17 20:08:28 +00:00
|
|
|
onCheckedChanged: {
|
2023-03-18 19:28:17 +00:00
|
|
|
if (checked != !ShellSettings.Settings.navigationPanelEnabled) {
|
|
|
|
|
ShellSettings.Settings.navigationPanelEnabled = !checked;
|
2022-03-17 19:34:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-13 04:23:57 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-21 14:54:33 +00:00
|
|
|
MobileForm.FormCard {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
MobileForm.FormCardHeader {
|
|
|
|
|
title: i18n("Task Switcher")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MobileForm.FormSwitchDelegate {
|
|
|
|
|
text: i18n("Show Application Previews")
|
|
|
|
|
description: i18n("Turning this off may help improve performance.")
|
2023-03-18 19:28:17 +00:00
|
|
|
checked: ShellSettings.Settings.taskSwitcherPreviewsEnabled
|
2022-05-21 14:54:33 +00:00
|
|
|
onCheckedChanged: {
|
2023-03-18 19:28:17 +00:00
|
|
|
if (checked != ShellSettings.Settings.taskSwitcherPreviewsEnabled) {
|
|
|
|
|
ShellSettings.Settings.taskSwitcherPreviewsEnabled = checked;
|
2022-05-21 14:54:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-17 19:34:27 +00:00
|
|
|
MobileForm.FormCard {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
2022-05-31 03:37:00 +00:00
|
|
|
id: parentCol
|
2022-03-17 19:34:27 +00:00
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
MobileForm.FormCardHeader {
|
2022-05-30 21:53:41 +00:00
|
|
|
title: i18n("Action Drawer")
|
2022-03-17 19:34:27 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-30 21:53:41 +00:00
|
|
|
MobileForm.FormButtonDelegate {
|
|
|
|
|
id: quickSettingsButton
|
|
|
|
|
text: i18n("Quick Settings")
|
|
|
|
|
onClicked: kcm.push("QuickSettingsForm.qml")
|
2022-02-13 04:23:57 +00:00
|
|
|
}
|
2022-05-31 03:37:00 +00:00
|
|
|
|
2022-06-22 17:43:39 +00:00
|
|
|
MobileForm.FormDelegateSeparator { above: quickSettingsButton; below: topLeftActionDrawerModeDelegate }
|
2022-05-31 03:37:00 +00:00
|
|
|
|
|
|
|
|
property string pinnedString: i18nc("Pinned action drawer mode", "Pinned Mode")
|
|
|
|
|
property string expandedString: i18nc("Expanded action drawer mode", "Expanded Mode")
|
|
|
|
|
|
|
|
|
|
MobileForm.FormComboBoxDelegate {
|
|
|
|
|
id: topLeftActionDrawerModeDelegate
|
|
|
|
|
text: i18n("Top Left Drawer Mode")
|
|
|
|
|
description: i18n("Mode when opening from the top left.")
|
|
|
|
|
|
2023-03-18 19:28:17 +00:00
|
|
|
currentIndex: indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode)
|
2022-05-31 03:37:00 +00:00
|
|
|
model: ListModel {
|
|
|
|
|
// we can't use i18n with ListElement
|
|
|
|
|
Component.onCompleted: {
|
2023-03-18 19:28:17 +00:00
|
|
|
append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned});
|
|
|
|
|
append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded});
|
2022-11-13 16:55:35 +00:00
|
|
|
|
|
|
|
|
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here
|
2023-03-18 19:28:17 +00:00
|
|
|
topLeftActionDrawerModeDelegate.currentIndex = topLeftActionDrawerModeDelegate.indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode)
|
2022-05-31 03:37:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
2022-08-20 15:28:54 +00:00
|
|
|
|
2022-11-13 16:55:35 +00:00
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
2022-08-20 15:28:54 +00:00
|
|
|
Component.onCompleted: dialog.parent = root
|
2023-03-18 19:28:17 +00:00
|
|
|
onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopLeftMode = currentValue
|
2022-05-31 03:37:00 +00:00
|
|
|
}
|
|
|
|
|
|
2022-06-22 17:43:39 +00:00
|
|
|
MobileForm.FormDelegateSeparator { above: topLeftActionDrawerModeDelegate; below: topRightActionDrawerModeDelegate }
|
2022-05-31 03:37:00 +00:00
|
|
|
|
|
|
|
|
MobileForm.FormComboBoxDelegate {
|
|
|
|
|
id: topRightActionDrawerModeDelegate
|
|
|
|
|
text: i18n("Top Right Drawer Mode")
|
2022-12-23 11:57:50 +00:00
|
|
|
description: i18n("Mode when opening from the top right.")
|
2022-05-31 03:37:00 +00:00
|
|
|
|
|
|
|
|
model: ListModel {
|
|
|
|
|
// we can't use i18n with ListElement
|
|
|
|
|
Component.onCompleted: {
|
2023-03-18 19:28:17 +00:00
|
|
|
append({"name": parentCol.pinnedString, "value": ShellSettings.Settings.Pinned});
|
|
|
|
|
append({"name": parentCol.expandedString, "value": ShellSettings.Settings.Expanded});
|
2022-11-13 16:55:35 +00:00
|
|
|
|
|
|
|
|
// indexOfValue doesn't bind to model changes unfortunately, set currentIndex manually here
|
2023-03-18 19:28:17 +00:00
|
|
|
topRightActionDrawerModeDelegate.currentIndex = topRightActionDrawerModeDelegate.indexOfValue(ShellSettings.Settings.actionDrawerTopRightMode)
|
2022-05-31 03:37:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-13 16:55:35 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
|
dialog.parent = root
|
2022-05-31 03:37:00 +00:00
|
|
|
}
|
2023-03-18 19:28:17 +00:00
|
|
|
onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopRightMode = currentValue
|
2022-05-31 03:37:00 +00:00
|
|
|
}
|
2022-02-13 04:23:57 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|