Warning, /plasma/plasma-workspace/kcms/cursortheme/ui/LaunchFeedbackDialog.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2017 Eike Hein <hein@kde.org>
0003
0004 SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 import QtQuick.Layouts 1.15
0010 import org.kde.kcmutils as KCM
0011 import org.kde.kirigami 2.20 as Kirigami
0012
0013 Kirigami.OverlaySheet {
0014 id: sheet
0015
0016 title: i18nc("@title", "Launch Feedback")
0017
0018 ColumnLayout {
0019 Layout.preferredWidth: Kirigami.Units.gridUnit * 20
0020 Layout.maximumWidth: Kirigami.Units.gridUnit * 30
0021 spacing: Kirigami.Units.largeSpacing
0022
0023 QQC2.Label {
0024 Layout.fillWidth: true
0025 text: i18nc("@info:usagetip", "Configure the animations played while an application is launching.")
0026 textFormat: Text.PlainText
0027 wrapMode: Text.Wrap
0028 }
0029
0030 Kirigami.FormLayout {
0031 id: formLayout
0032
0033 readonly property bool cursorImmutable: kcm.launchFeedbackSettings.isBusyCursorImmutable || kcm.launchFeedbackSettings.isBlinkingImmutable || kcm.launchFeedbackSettings.isBouncingImmutable
0034
0035 QQC2.ButtonGroup {
0036 id: busyCursorGroup
0037 onCheckedButtonChanged: {
0038 kcm.launchFeedbackSettings.busyCursor = busyCursorStatic.checked || busyCursorBlinking.checked || busyCursorBouncing.checked;
0039 kcm.launchFeedbackSettings.blinking = busyCursorBlinking.checked;
0040 kcm.launchFeedbackSettings.bouncing = busyCursorBouncing.checked;
0041 }
0042 }
0043
0044 QQC2.RadioButton {
0045 id: busyCursorDisabled
0046
0047 Kirigami.FormData.label: i18nc("@label", "Cursor feedback:")
0048 text: i18nc("@option:radio No cursor feedback when launching apps", "None")
0049 checked: !kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing
0050 enabled: !formLayout.cursorImmutable
0051 QQC2.ButtonGroup.group: busyCursorGroup
0052 }
0053
0054 QQC2.RadioButton {
0055 id: busyCursorStatic
0056
0057 text: i18nc("@option:radio", "Static")
0058 checked: kcm.launchFeedbackSettings.busyCursor && !busyCursorBlinking.checked && !busyCursorBouncing.checked
0059 enabled: !formLayout.cursorImmutable
0060 QQC2.ButtonGroup.group: busyCursorGroup
0061 }
0062
0063 QQC2.RadioButton {
0064 id: busyCursorBlinking
0065
0066 text: i18nc("@option:radio", "Blinking")
0067 checked: kcm.launchFeedbackSettings.blinking
0068 enabled: !formLayout.cursorImmutable
0069 QQC2.ButtonGroup.group: busyCursorGroup
0070 }
0071
0072 QQC2.RadioButton {
0073 id: busyCursorBouncing
0074
0075 text: i18nc("@option:radio", "Bouncing")
0076 checked: kcm.launchFeedbackSettings.bouncing
0077 enabled: !formLayout.cursorImmutable
0078 QQC2.ButtonGroup.group: busyCursorGroup
0079
0080 KCM.SettingStateBinding {
0081 configObject: kcm.launchFeedbackSettings
0082 settingName: "bouncing"
0083 extraEnabledConditions: !formLayout.cursorImmutable
0084 }
0085 }
0086
0087 QQC2.CheckBox {
0088 id: taskManagerNotification
0089
0090 Kirigami.FormData.label: i18nc("@label", "Task Manager feedback:")
0091
0092 text: i18nc("@option:check", "Enable animation")
0093
0094 checked: kcm.launchFeedbackSettings.taskbarButton
0095 enabled: !kcm.launchFeedbackSettings.isTaskbarButtonImmutable
0096 onToggled: kcm.launchFeedbackSettings.taskbarButton = checked;
0097
0098 KCM.SettingStateBinding {
0099 configObject: kcm.launchFeedbackSettings
0100 settingName: "taskbarButton"
0101 }
0102 }
0103
0104 Item {
0105 Kirigami.FormData.isSection: true
0106 }
0107
0108 QQC2.SpinBox {
0109 id: notificationTimeout
0110 Layout.preferredWidth: notificationTimeoutMetrics.implicitWidth + leftPadding + rightPadding
0111 Kirigami.FormData.label: i18nc("@label", "Stop animations after:")
0112
0113 enabled: !kcm.launchFeedbackSettings.isCursorTimeoutImmutable || !kcm.launchFeedbackSettings.isTaskbarTimeoutImmutable
0114 from: 1
0115 to: 60
0116 stepSize: 1
0117 editable: true
0118
0119 value: kcm.launchFeedbackSettings.cursorTimeout
0120 onValueModified: {
0121 kcm.launchFeedbackSettings.cursorTimeout = value
0122 kcm.launchFeedbackSettings.taskbarTimeout = value
0123 }
0124
0125 textFromValue: function(value, locale) { return i18np("%1 second", "%1 seconds", value)}
0126 valueFromText: function(text, locale) { return parseInt(text) }
0127
0128 KCM.SettingStateBinding {
0129 configObject: kcm.launchFeedbackSettings
0130 settingName: "cursorTimeout"
0131 extraEnabledConditions: taskManagerNotification.checked
0132 }
0133
0134 TextMetrics {
0135 id: notificationTimeoutMetrics
0136 font: notificationTimeout.font
0137 text: i18np("%1 second", "%1 seconds", 60)
0138 }
0139 }
0140 }
0141 }
0142 }