Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/ItemListDelegate.qml
Show All 29 Lines | 27 | Item { | |||
---|---|---|---|---|---|
30 | height: isSeparator ? separatorHeight : itemHeight | 30 | height: isSeparator ? separatorHeight : itemHeight | ||
31 | width: ListView.view.width | 31 | width: ListView.view.width | ||
32 | 32 | | |||
33 | enabled: !isSeparator | 33 | enabled: !isSeparator | ||
34 | 34 | | |||
35 | signal actionTriggered(string actionId, variant actionArgument) | 35 | signal actionTriggered(string actionId, variant actionArgument) | ||
36 | signal aboutToShowActionMenu(variant actionMenu) | 36 | signal aboutToShowActionMenu(variant actionMenu) | ||
37 | 37 | | |||
38 | readonly property real fullTextWidth: Math.ceil(icon.width + label.implicitWidth + arrow.width + row.anchors.leftMargin + row.anchors.rightMargin + row.actualSpacing) | ||||
38 | property bool isSeparator: (model.isSeparator == true) | 39 | property bool isSeparator: (model.isSeparator == true) | ||
39 | property bool hasChildren: (model.hasChildren == true) | 40 | property bool hasChildren: (model.hasChildren == true) | ||
40 | property bool hasActionList: ((model.favoriteId != null) | 41 | property bool hasActionList: ((model.favoriteId != null) | ||
41 | || (("hasActionList" in model) && (model.hasActionList == true))) | 42 | || (("hasActionList" in model) && (model.hasActionList == true))) | ||
42 | property QtObject childDialog: null | 43 | property QtObject childDialog: null | ||
43 | property Item menu: actionMenu | 44 | property Item menu: actionMenu | ||
44 | 45 | | |||
45 | Accessible.role: isSeparator ? Accessible.Separator: Accessible.MenuItem | 46 | Accessible.role: isSeparator ? Accessible.Separator: Accessible.MenuItem | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 170 | Timer { | |||
172 | interval: 50 | 173 | interval: 50 | ||
173 | repeat: false | 174 | repeat: false | ||
174 | 175 | | |||
175 | onTriggered: parent.updateCurrentItem() | 176 | onTriggered: parent.updateCurrentItem() | ||
176 | } | 177 | } | ||
177 | } | 178 | } | ||
178 | 179 | | |||
179 | Row { | 180 | Row { | ||
181 | id: row | ||||
182 | | ||||
180 | anchors.left: parent.left | 183 | anchors.left: parent.left | ||
181 | anchors.leftMargin: highlightItemSvg.margins.left | 184 | anchors.leftMargin: highlightItemSvg.margins.left | ||
182 | anchors.right: parent.right | 185 | anchors.right: parent.right | ||
183 | anchors.rightMargin: highlightItemSvg.margins.right | 186 | anchors.rightMargin: highlightItemSvg.margins.right | ||
184 | 187 | | |||
185 | height: parent.height | 188 | height: parent.height | ||
186 | 189 | | |||
187 | spacing: units.smallSpacing * 2 | 190 | spacing: units.smallSpacing * 2 | ||
191 | readonly property real actualSpacing: ((icon.visible ? 1 : 0) * spacing) + ((arrow.visible ? 1 : 0) * spacing) | ||||
188 | 192 | | |||
189 | LayoutMirroring.enabled: (Qt.application.layoutDirection == Qt.RightToLeft) | 193 | LayoutMirroring.enabled: (Qt.application.layoutDirection == Qt.RightToLeft) | ||
190 | 194 | | |||
191 | PlasmaCore.IconItem { | 195 | PlasmaCore.IconItem { | ||
192 | id: icon | 196 | id: icon | ||
193 | 197 | | |||
194 | anchors.verticalCenter: parent.verticalCenter | 198 | anchors.verticalCenter: parent.verticalCenter | ||
195 | 199 | | |||
Show All 10 Lines | |||||
206 | 210 | | |||
207 | PlasmaComponents.Label { | 211 | PlasmaComponents.Label { | ||
208 | id: label | 212 | id: label | ||
209 | 213 | | |||
210 | enabled: !isParent || (isParent && hasChildren) | 214 | enabled: !isParent || (isParent && hasChildren) | ||
211 | 215 | | |||
212 | anchors.verticalCenter: parent.verticalCenter | 216 | anchors.verticalCenter: parent.verticalCenter | ||
213 | 217 | | |||
214 | width: (parent.width - icon.width - arrow.width | 218 | width: parent.width - icon.width - arrow.width - parent.actualSpacing | ||
215 | - ((icon.visible ? 1 : 0) * parent.spacing) - ((arrow.visible ? 1 : 0) * parent.spacing)) | | |||
216 | 219 | | |||
217 | verticalAlignment: Text.AlignVCenter | 220 | verticalAlignment: Text.AlignVCenter | ||
218 | 221 | | |||
219 | textFormat: Text.PlainText | 222 | textFormat: Text.PlainText | ||
220 | wrapMode: Text.NoWrap | 223 | wrapMode: Text.NoWrap | ||
221 | elide: Text.ElideRight | 224 | elide: Text.ElideRight | ||
222 | 225 | | |||
223 | text: model.display | 226 | text: model.display | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |