2022-05-06 01:02:18 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
|
|
|
|
|
* SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2023-09-21 17:24:32 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls as QQC2
|
2022-05-06 01:02:18 +00:00
|
|
|
|
2023-09-21 17:24:32 +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 as FormCard
|
2023-03-18 19:28:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
2022-05-06 01:02:18 +00:00
|
|
|
|
2023-09-21 17:24:32 +00:00
|
|
|
FormCard.FormCardPage {
|
2022-05-06 01:02:18 +00:00
|
|
|
id: root
|
2023-09-21 17:24:32 +00:00
|
|
|
|
2022-05-06 01:02:18 +00:00
|
|
|
title: i18n("Shell Vibrations")
|
2023-09-21 17:24:32 +00:00
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
|
Layout.topMargin: Kirigami.Units.gridUnit
|
|
|
|
|
|
|
|
|
|
FormCard.FormSwitchDelegate {
|
|
|
|
|
id: shellVibrationsSwitch
|
|
|
|
|
text: i18n("Shell Vibrations")
|
|
|
|
|
description: i18n("Whether to have vibrations enabled in the shell.")
|
|
|
|
|
checked: ShellSettings.Settings.vibrationsEnabled
|
|
|
|
|
onCheckedChanged: {
|
|
|
|
|
if (checked != ShellSettings.Settings.vibrationsEnabled) {
|
|
|
|
|
ShellSettings.Settings.vibrationsEnabled = checked;
|
2022-05-06 01:02:18 +00:00
|
|
|
}
|
2023-09-21 17:24:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-15 07:13:05 +00:00
|
|
|
FormCard.FormDelegateSeparator { above: shellVibrationsSwitch; below: vibrationDurationDelegate }
|
2023-09-21 17:24:32 +00:00
|
|
|
|
|
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
|
id: vibrationDurationDelegate
|
|
|
|
|
text: i18n("Vibration Duration")
|
|
|
|
|
description: i18n("How long shell vibrations should be.")
|
|
|
|
|
|
2025-04-07 00:54:53 +00:00
|
|
|
model: [
|
|
|
|
|
{"name": i18nc("Long duration", "Long"), "value": 100},
|
|
|
|
|
{"name": i18nc("Medium duration", "Medium"), "value": 50},
|
|
|
|
|
{"name": i18nc("Short duration", "Short"), "value": 10}
|
|
|
|
|
]
|
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.vibrationDuration);
|
|
|
|
|
dialog.parent = root;
|
|
|
|
|
}
|
2023-09-21 17:24:32 +00:00
|
|
|
onCurrentValueChanged: ShellSettings.Settings.vibrationDuration = currentValue;
|
2022-05-06 01:02:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-09-21 17:24:32 +00:00
|
|
|
|
|
|
|
|
FormCard.FormSectionText {
|
|
|
|
|
text: i18n("Keyboard vibrations are controlled separately in the keyboard settings module.")
|
|
|
|
|
}
|
2022-05-06 01:02:18 +00:00
|
|
|
}
|