Changeset View
Changeset View
Standalone View
Standalone View
kcms/launch/package/contents/ui/main.qml
Show All 25 Lines | |||||
26 | SimpleKCM { | 26 | SimpleKCM { | ||
27 | id: root | 27 | id: root | ||
28 | 28 | | |||
29 | ConfigModule.quickHelp: i18n("Launch Feedback") | 29 | ConfigModule.quickHelp: i18n("Launch Feedback") | ||
30 | 30 | | |||
31 | Kirigami.FormLayout { | 31 | Kirigami.FormLayout { | ||
32 | id: formLayout | 32 | id: formLayout | ||
33 | 33 | | |||
34 | readonly property bool cursorImmutable: kcm.launchFeedbackSettings.isImmutable("busyCursor") || kcm.launchFeedbackSettings.isImmutable("blinking") || kcm.launchFeedbackSettings.isImmutable("bouncing") | ||||
35 | | ||||
34 | function setCursorSettings(feedback) { | 36 | function setCursorSettings(feedback) { | ||
35 | kcm.launchFeedbackSettings.busyCursor = feedback !== Private.KCM.None | 37 | kcm.launchFeedbackSettings.busyCursor = feedback !== Private.KCM.None | ||
36 | kcm.launchFeedbackSettings.blinking = feedback === Private.KCM.Blinking | 38 | kcm.launchFeedbackSettings.blinking = feedback === Private.KCM.Blinking | ||
37 | kcm.launchFeedbackSettings.bouncing = feedback === Private.KCM.Bouncing | 39 | kcm.launchFeedbackSettings.bouncing = feedback === Private.KCM.Bouncing | ||
38 | } | 40 | } | ||
39 | 41 | | |||
40 | QtControls.RadioButton { | 42 | QtControls.RadioButton { | ||
41 | id: busyCursorDisabled | 43 | id: busyCursorDisabled | ||
42 | 44 | | |||
45 | enabled: !formLayout.cursorImmutable | ||||
broulik: Imho this is confusing.
The property should be `readonly property bool cursorImmutable: kcm. | |||||
Thanks for pointing this. Reworked the property to make enabled assignement like the other. crossi: Thanks for pointing this.
Reworked the property to make enabled assignement like the other. | |||||
43 | Kirigami.FormData.label: i18n("Cursor:") | 46 | Kirigami.FormData.label: i18n("Cursor:") | ||
44 | text: i18n("No Feedback") | 47 | text: i18n("No Feedback") | ||
45 | checked: !kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | 48 | checked: !kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | ||
46 | onToggled: formLayout.setCursorSettings(Private.KCM.None) | 49 | onToggled: formLayout.setCursorSettings(Private.KCM.None) | ||
47 | } | 50 | } | ||
48 | 51 | | |||
49 | QtControls.RadioButton { | 52 | QtControls.RadioButton { | ||
50 | id: busyCursorStatic | 53 | id: busyCursorStatic | ||
51 | 54 | | |||
55 | enabled: !formLayout.cursorImmutable | ||||
52 | text: i18n("Static") | 56 | text: i18n("Static") | ||
53 | checked: kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | 57 | checked: kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | ||
54 | onToggled: formLayout.setCursorSettings(Private.KCM.Static) | 58 | onToggled: formLayout.setCursorSettings(Private.KCM.Static) | ||
55 | } | 59 | } | ||
56 | 60 | | |||
57 | QtControls.RadioButton { | 61 | QtControls.RadioButton { | ||
58 | id: busyCursorBlinking | 62 | id: busyCursorBlinking | ||
59 | 63 | | |||
64 | enabled: !formLayout.cursorImmutable | ||||
60 | text: i18n("Blinking") | 65 | text: i18n("Blinking") | ||
61 | checked: kcm.launchFeedbackSettings.busyCursor && kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | 66 | checked: kcm.launchFeedbackSettings.busyCursor && kcm.launchFeedbackSettings.blinking && !kcm.launchFeedbackSettings.bouncing | ||
62 | onToggled: formLayout.setCursorSettings(Private.KCM.Blinking) | 67 | onToggled: formLayout.setCursorSettings(Private.KCM.Blinking) | ||
63 | } | 68 | } | ||
64 | 69 | | |||
65 | QtControls.RadioButton { | 70 | QtControls.RadioButton { | ||
66 | id: busyCursorBouncing | 71 | id: busyCursorBouncing | ||
67 | 72 | | |||
73 | enabled: !formLayout.cursorImmutable | ||||
68 | text: i18n("Bouncing") | 74 | text: i18n("Bouncing") | ||
69 | checked: kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && kcm.launchFeedbackSettings.bouncing | 75 | checked: kcm.launchFeedbackSettings.busyCursor && !kcm.launchFeedbackSettings.blinking && kcm.launchFeedbackSettings.bouncing | ||
70 | onToggled: formLayout.setCursorSettings(Private.KCM.Bouncing) | 76 | onToggled: formLayout.setCursorSettings(Private.KCM.Bouncing) | ||
71 | } | 77 | } | ||
72 | 78 | | |||
73 | QtControls.CheckBox { | 79 | QtControls.CheckBox { | ||
74 | id: taskManagerNotification | 80 | id: taskManagerNotification | ||
75 | 81 | | |||
82 | enabled: !kcm.launchFeedbackSettings.isImmutable("taskbarButton") | ||||
76 | Kirigami.FormData.label: i18n("Task Manager:") | 83 | Kirigami.FormData.label: i18n("Task Manager:") | ||
77 | 84 | | |||
78 | text: i18n("Enable animation") | 85 | text: i18n("Enable animation") | ||
79 | 86 | | |||
80 | checked: kcm.launchFeedbackSettings.taskbarButton | 87 | checked: kcm.launchFeedbackSettings.taskbarButton | ||
81 | onToggled: kcm.launchFeedbackSettings.taskbarButton = checked | 88 | onToggled: kcm.launchFeedbackSettings.taskbarButton = checked | ||
82 | } | 89 | } | ||
83 | 90 | | |||
84 | QtControls.SpinBox { | 91 | QtControls.SpinBox { | ||
85 | id: notificationTimeout | 92 | id: notificationTimeout | ||
86 | 93 | | |||
87 | Kirigami.FormData.label: i18n("Stop animation after:") | 94 | Kirigami.FormData.label: i18n("Stop animation after:") | ||
88 | 95 | | |||
89 | stepSize: 1 | 96 | stepSize: 1 | ||
90 | editable: true | 97 | editable: true | ||
91 | 98 | | |||
92 | enabled: taskManagerNotification.checked | 99 | enabled: taskManagerNotification.checked && !kcm.launchFeedbackSettings.isImmutable("cursorTimeout") | ||
93 | 100 | | |||
94 | value: kcm.launchFeedbackSettings.cursorTimeout | 101 | value: kcm.launchFeedbackSettings.cursorTimeout | ||
95 | onValueModified: { | 102 | onValueModified: { | ||
96 | kcm.launchFeedbackSettings.cursorTimeout = value | 103 | kcm.launchFeedbackSettings.cursorTimeout = value | ||
97 | kcm.launchFeedbackSettings.taskbarTimeout = value | 104 | kcm.launchFeedbackSettings.taskbarTimeout = value | ||
98 | } | 105 | } | ||
99 | 106 | | |||
100 | textFromValue: function(value, locale) { return i18np("%1 sec", "%1 secs", value)} | 107 | textFromValue: function(value, locale) { return i18np("%1 sec", "%1 secs", value)} | ||
101 | valueFromText: function(text, locale) { return parseInt(text) } | 108 | valueFromText: function(text, locale) { return parseInt(text) } | ||
102 | } | 109 | } | ||
103 | } | 110 | } | ||
104 | } | 111 | } |
Imho this is confusing.
The property should be readonly property bool cursorImmutable: kcm.setings.immutable && .. and then this would be enabled: !immutable