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
|
|
|
|
|
|
2026-03-07 03:08:07 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2023-06-06 19:31:58 +00:00
|
|
|
import org.kde.kcmutils as KCM
|
2023-09-21 17:24:32 +00:00
|
|
|
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
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")
|
|
|
|
|
|
2023-09-21 17:24:32 +00:00
|
|
|
topPadding: 0
|
|
|
|
|
bottomPadding: 0
|
2022-03-17 19:34:27 +00:00
|
|
|
leftPadding: 0
|
|
|
|
|
rightPadding: 0
|
2023-09-21 17:24:32 +00:00
|
|
|
|
2022-03-17 19:34:27 +00:00
|
|
|
ColumnLayout {
|
2023-09-21 17:24:32 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("General")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
|
id: shellVibrationsButton
|
|
|
|
|
text: i18n("Shell Vibrations")
|
|
|
|
|
onClicked: kcm.push("VibrationForm.qml")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: shellVibrationsButton; below: animationsSwitch }
|
|
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: animationsSwitch
|
|
|
|
|
text: i18n("Animations")
|
|
|
|
|
description: i18n("If this is off, animations will be reduced as much as possible.")
|
|
|
|
|
checked: ShellSettings.Settings.animationsEnabled
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
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
|
|
|
}
|
2025-04-21 15:56:33 +00:00
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: shellVibrationsButton; below: animationsSwitch }
|
|
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: autoHidePanels
|
|
|
|
|
text: i18n("Auto Hide Panels")
|
2025-09-14 01:37:13 +00:00
|
|
|
description: i18n("Auto-hide the status and navigation panels to allow applications to always be in fullscreen.")
|
2025-04-21 15:56:33 +00:00
|
|
|
checked: ShellSettings.Settings.autoHidePanelsEnabled
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != ShellSettings.Settings.autoHidePanelsEnabled) {
|
|
|
|
|
ShellSettings.Settings.autoHidePanelsEnabled = checked;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-01 15:03:26 +00:00
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: autoHidePanels; below: doubleTapWakeup }
|
|
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: doubleTapWakeup
|
|
|
|
|
text: i18n("Double Tap to Wakeup")
|
2025-09-14 01:37:13 +00:00
|
|
|
description: i18n("When the screen is off, double tap to wakeup the device.")
|
2025-07-01 15:03:26 +00:00
|
|
|
checked: ShellSettings.KWinSettings.doubleTapWakeup
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != ShellSettings.KWinSettings.doubleTapWakeup) {
|
|
|
|
|
ShellSettings.KWinSettings.doubleTapWakeup = checked;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-29 20:15:53 +00:00
|
|
|
}
|
2023-09-21 17:24:32 +00:00
|
|
|
|
2024-06-28 02:05:42 +00:00
|
|
|
FormCard.FormHeader {
|
2024-10-17 17:23:50 +00:00
|
|
|
title: i18n("Status Bar")
|
2024-06-28 02:05:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: dateInStatusBar
|
|
|
|
|
text: i18n("Date in status bar")
|
|
|
|
|
description: i18n("If on, date will be shown next to the clock in the status bar.")
|
|
|
|
|
checked: ShellSettings.Settings.dateInStatusBar
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != ShellSettings.Settings.dateInStatusBar) {
|
|
|
|
|
ShellSettings.Settings.dateInStatusBar = checked;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-10-17 17:23:50 +00:00
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: quickSettingsButton; below: topLeftActionDrawerModeDelegate }
|
|
|
|
|
|
2025-03-19 20:09:33 +00:00
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: showBatteryPercentage
|
|
|
|
|
text: i18n("Battery Percentage")
|
|
|
|
|
description: i18n("Show battery percentage in the status bar.")
|
|
|
|
|
checked: ShellSettings.Settings.showBatteryPercentage
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != ShellSettings.Settings.showBatteryPercentage) {
|
|
|
|
|
ShellSettings.Settings.showBatteryPercentage = checked;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: quickSettingsButton; below: topLeftActionDrawerModeDelegate }
|
|
|
|
|
|
2024-10-17 17:23:50 +00:00
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: statusBarScaleFactorDelegate
|
|
|
|
|
|
|
|
|
|
text: i18n("Status Bar Size")
|
|
|
|
|
description: i18n("Size of the top panel (needs restart).")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": i18nc("Status bar height", "Tiny"), "value": 1.0},
|
|
|
|
|
{"name": i18nc("Status bar height", "Small"), "value": 1.15},
|
|
|
|
|
{"name": i18nc("Status bar height", "Normal"), "value": 1.25},
|
|
|
|
|
{"name": i18nc("Status bar height", "Large"), "value": 1.5},
|
|
|
|
|
{"name": i18nc("Status bar height", "Very Large"), "value": 2.0}
|
|
|
|
|
]
|
2024-10-17 17:23:50 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
|
currentIndex = indexOfValue(ShellSettings.Settings.statusBarScaleFactor);
|
|
|
|
|
dialog.parent = root;
|
|
|
|
|
}
|
2024-10-17 17:23:50 +00:00
|
|
|
onCurrentValueChanged: ShellSettings.Settings.statusBarScaleFactor = currentValue
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-28 02:05:42 +00:00
|
|
|
}
|
|
|
|
|
|
2023-09-21 17:24:32 +00:00
|
|
|
FormCard.FormHeader {
|
|
|
|
|
title: i18n("Action Drawer")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
|
id: quickSettings
|
|
|
|
|
|
|
|
|
|
property string pinnedString: i18nc("Pinned action drawer mode", "Pinned Mode")
|
|
|
|
|
property string expandedString: i18nc("Expanded action drawer mode", "Expanded Mode")
|
|
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
|
id: quickSettingsButton
|
|
|
|
|
text: i18n("Quick Settings")
|
|
|
|
|
onClicked: kcm.push("QuickSettingsForm.qml")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: quickSettingsButton; below: topLeftActionDrawerModeDelegate }
|
|
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: topLeftActionDrawerModeDelegate
|
|
|
|
|
text: i18n("Top Left Drawer Mode")
|
|
|
|
|
description: i18n("Mode when opening from the top left.")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": quickSettings.pinnedString, "value": ShellSettings.Settings.Pinned},
|
|
|
|
|
{"name": quickSettings.expandedString, "value": ShellSettings.Settings.Expanded}
|
|
|
|
|
]
|
2023-09-21 17:24:32 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
|
currentIndex = indexOfValue(ShellSettings.Settings.actionDrawerTopLeftMode);
|
|
|
|
|
dialog.parent = root;
|
|
|
|
|
}
|
2023-09-21 17:24:32 +00:00
|
|
|
onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopLeftMode = currentValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator { above: topLeftActionDrawerModeDelegate; below: topRightActionDrawerModeDelegate }
|
|
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: topRightActionDrawerModeDelegate
|
|
|
|
|
text: i18n("Top Right Drawer Mode")
|
|
|
|
|
description: i18n("Mode when opening from the top right.")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": quickSettings.pinnedString, "value": ShellSettings.Settings.Pinned},
|
|
|
|
|
{"name": quickSettings.expandedString, "value": ShellSettings.Settings.Expanded}
|
|
|
|
|
]
|
2023-09-21 17:24:32 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2025-04-07 00:54:53 +00:00
|
|
|
currentIndex = indexOfValue(ShellSettings.Settings.actionDrawerTopRightMode);
|
2023-09-21 17:24:32 +00:00
|
|
|
dialog.parent = root
|
|
|
|
|
}
|
|
|
|
|
onCurrentValueChanged: ShellSettings.Settings.actionDrawerTopRightMode = currentValue
|
2022-02-13 04:23:57 +00:00
|
|
|
}
|
|
|
|
|
}
|
2025-03-13 20:11:41 +00:00
|
|
|
|
|
|
|
|
FormCard.FormHeader {
|
2025-03-22 18:17:31 +00:00
|
|
|
title: i18nc("@title:group, shortcuts available from lock screen", "Lock Screen Shortcuts")
|
2025-03-13 20:11:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
|
id: quickActionButtons
|
|
|
|
|
property string noneString: i18nc("@item:inlistbox", "None")
|
|
|
|
|
property string flashlightString: i18nc("@item:inlistbox", "Flashlight")
|
|
|
|
|
property string cameraString: i18nc("@item:inlistbox", "Camera")
|
|
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: lockscreenLeftButtonDelegate
|
|
|
|
|
text: i18nc("@label:listbox", "Left button")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": quickActionButtons.noneString, "value": ShellSettings.Settings.None},
|
|
|
|
|
{"name": quickActionButtons.flashlightString, "value": ShellSettings.Settings.Flashlight}
|
|
|
|
|
// {"name": quickActionButtons.cameraString, "value": ShellSettings.Settings.Camera}
|
|
|
|
|
]
|
2025-03-13 20:11:41 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2025-04-07 00:54:53 +00:00
|
|
|
currentIndex = indexOfValue(ShellSettings.Settings.lockscreenLeftButtonAction);
|
|
|
|
|
dialog.parent = root;
|
2025-03-13 20:11:41 +00:00
|
|
|
}
|
|
|
|
|
onCurrentValueChanged: ShellSettings.Settings.lockscreenLeftButtonAction = currentValue
|
|
|
|
|
}
|
2025-03-19 20:09:33 +00:00
|
|
|
|
2025-03-13 20:11:41 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: lockscreenRightButtonDelegate; below: lockscreenLeftButtonDelegate }
|
|
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: lockscreenRightButtonDelegate
|
|
|
|
|
text: i18nc("@label:listbox", "Right button")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": quickActionButtons.noneString, "value": ShellSettings.Settings.None},
|
|
|
|
|
{"name": quickActionButtons.flashlightString, "value": ShellSettings.Settings.Flashlight}
|
|
|
|
|
// {"name": quickActionButtons.cameraString, "value": ShellSettings.Settings.Camera}
|
|
|
|
|
]
|
2025-03-13 20:11:41 +00:00
|
|
|
|
|
|
|
|
textRole: "name"
|
|
|
|
|
valueRole: "value"
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2025-04-07 00:54:53 +00:00
|
|
|
currentIndex = indexOfValue(ShellSettings.Settings.lockscreenRightButtonAction);
|
|
|
|
|
dialog.parent = root;
|
2025-03-13 20:11:41 +00:00
|
|
|
}
|
|
|
|
|
onCurrentValueChanged: ShellSettings.Settings.lockscreenRightButtonAction = currentValue
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-13 04:23:57 +00:00
|
|
|
}
|
|
|
|
|
}
|