Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/JobDelegate.qml
Show All 32 Lines | 28 | Column { | |||
---|---|---|---|---|---|
33 | 33 | | |||
34 | readonly property int layoutSpacing: units.largeSpacing / 4 | 34 | readonly property int layoutSpacing: units.largeSpacing / 4 | ||
35 | readonly property int animationDuration: units.shortDuration * 2 | 35 | readonly property int animationDuration: units.shortDuration * 2 | ||
36 | 36 | | |||
37 | readonly property string infoMessage: getData(jobsSource.data, "infoMessage", '') | 37 | readonly property string infoMessage: getData(jobsSource.data, "infoMessage", '') | ||
38 | readonly property string labelName0: getData(jobsSource.data, "labelName0", '') | 38 | readonly property string labelName0: getData(jobsSource.data, "labelName0", '') | ||
39 | readonly property string labelName1: getData(jobsSource.data, "labelName1", '') | 39 | readonly property string labelName1: getData(jobsSource.data, "labelName1", '') | ||
40 | readonly property string labelFileName0: getData(jobsSource.data, "labelFileName0", '') | 40 | readonly property string labelFileName0: getData(jobsSource.data, "labelFileName0", '') | ||
41 | readonly property string labelFileName1: getData(jobsSource.data, "labelFileName1", '') | ||||
41 | readonly property string label0: getData(jobsSource.data, "label0", '') | 42 | readonly property string label0: getData(jobsSource.data, "label0", '') | ||
42 | readonly property string label1: getData(jobsSource.data, "label1", '') | 43 | readonly property string label1: getData(jobsSource.data, "label1", '') | ||
43 | readonly property bool isSuspended: getData(jobsSource.data, "state", '') === "suspended" | 44 | readonly property bool isSuspended: getData(jobsSource.data, "state", '') === "suspended" | ||
44 | 45 | | |||
45 | property alias infoMessageVisible: infoLabel.visible | 46 | property alias infoMessageVisible: infoLabel.visible | ||
46 | 47 | | |||
47 | function getData(data, name, defaultValue) { | 48 | function getData(data, name, defaultValue) { | ||
48 | var source = model.name | 49 | var source = model.name | ||
Show All 12 Lines | |||||
61 | RowLayout { | 62 | RowLayout { | ||
62 | width: parent.width | 63 | width: parent.width | ||
63 | 64 | | |||
64 | PlasmaComponents.Label { | 65 | PlasmaComponents.Label { | ||
65 | id: summary | 66 | id: summary | ||
66 | Layout.fillWidth: true | 67 | Layout.fillWidth: true | ||
67 | elide: Text.ElideMiddle | 68 | elide: Text.ElideMiddle | ||
68 | text: { | 69 | text: { | ||
69 | var label = labelFileName0; | 70 | var label = labelFileName1 || labelFileName0; | ||
broulik: Could be simplified to
```
var label = labelFileName1 || labelFileName0;
``` | |||||
70 | var lastSlashIdx = label.lastIndexOf("/"); | 71 | var lastSlashIdx = label.lastIndexOf("/"); | ||
71 | return label.slice(lastSlashIdx + 1); | 72 | return label.slice(lastSlashIdx + 1); | ||
72 | } | 73 | } | ||
73 | textFormat: Text.PlainText | 74 | textFormat: Text.PlainText | ||
74 | } | 75 | } | ||
75 | 76 | | |||
76 | PlasmaComponents.ToolButton { | 77 | PlasmaComponents.ToolButton { | ||
77 | id: expandButton | 78 | id: expandButton | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |
Could be simplified to