Changeset View
Changeset View
Standalone View
Standalone View
lib/qml/ResultDelegate.qml
Show All 39 Lines | 39 | (reversed && ListView.section != ListView.nextSection) | |||
---|---|---|---|---|---|
40 | || (!reversed && ListView.section != ListView.previousSection) | 40 | || (!reversed && ListView.section != ListView.previousSection) | ||
41 | ) | 41 | ) | ||
42 | 42 | | |||
43 | property int activeAction: -1 | 43 | property int activeAction: -1 | ||
44 | 44 | | |||
45 | property string typeText: sectionHasChanged ? ListView.section : "" | 45 | property string typeText: sectionHasChanged ? ListView.section : "" | ||
46 | property var additionalActions: typeof actions !== "undefined" ? actions : [] | 46 | property var additionalActions: typeof actions !== "undefined" ? actions : [] | ||
47 | 47 | | |||
48 | Accessible.role: Accessible.MenuItem | ||||
49 | Accessible.name: displayLabel.text | ||||
50 | Accessible.description: i18n("%1, in category %2", subtextLabel.text.length > 0 ? subtextLabel.text : " ", ListView.section) | ||||
davidedmundson: This ends up in a different .pot file to the translation domain of krunner which is using this… | |||||
broulik: So we end up with " , in category foo" if subtextLabel is empty? | |||||
pretty much, i can make 2 different strings at all, the oddity if if it's a null string, i18n thinks it's a single patameter and complains about wrong parameters number mart: pretty much, i can make 2 different strings at all, the oddity if if it's a null string, i18n… | |||||
48 | property bool __pressed: false | 51 | property bool __pressed: false | ||
49 | property int __pressX: -1 | 52 | property int __pressX: -1 | ||
50 | property int __pressY: -1 | 53 | property int __pressY: -1 | ||
51 | 54 | | |||
52 | onIsCurrentChanged: { | 55 | onIsCurrentChanged: { | ||
53 | if (!isCurrent) { | 56 | if (!isCurrent) { | ||
54 | activeAction = -1 | 57 | activeAction = -1 | ||
55 | } | 58 | } | ||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 232 | PlasmaComponents.ToolButton { | |||
233 | enabled: modelData.enabled || true | 236 | enabled: modelData.enabled || true | ||
234 | tooltip: { | 237 | tooltip: { | ||
235 | var text = modelData.text || "" | 238 | var text = modelData.text || "" | ||
236 | if (index === 0) { // Shift+Return will invoke first action | 239 | if (index === 0) { // Shift+Return will invoke first action | ||
237 | text = i18nc("placeholder is action e.g. run in terminal, in parenthesis is shortcut", "%1 (Shift+Return)", text) | 240 | text = i18nc("placeholder is action e.g. run in terminal, in parenthesis is shortcut", "%1 (Shift+Return)", text) | ||
238 | } | 241 | } | ||
239 | return text | 242 | return text | ||
240 | } | 243 | } | ||
244 | Accessible.role: Accessible.Button | ||||
245 | Accessible.name: modelData.text | ||||
246 | Accessible.description: "" | ||||
broulik: Not needed? | |||||
241 | checkable: checked | 247 | checkable: checked | ||
242 | checked: resultDelegate.activeAction === index | 248 | checked: resultDelegate.activeAction === index | ||
249 | focus: resultDelegate.activeAction === index | ||||
broulik: I don't understand this focus stuff at all but if it works.. | |||||
243 | 250 | | |||
244 | PlasmaCore.IconItem { | 251 | PlasmaCore.IconItem { | ||
245 | anchors.centerIn: parent | 252 | anchors.centerIn: parent | ||
246 | width: Globals.IconSize | 253 | width: Globals.IconSize | ||
247 | height: Globals.IconSize | 254 | height: Globals.IconSize | ||
248 | // ToolButton cannot cope with QIcon | 255 | // ToolButton cannot cope with QIcon | ||
249 | source: modelData.icon || "" | 256 | source: modelData.icon || "" | ||
250 | active: parent.hovered || parent.checked | 257 | active: parent.hovered || parent.checked | ||
Show All 9 Lines |
This ends up in a different .pot file to the translation domain of krunner which is using this lib, I think you need to i18nd