Changeset View
Changeset View
Standalone View
Standalone View
src/controls/BasicListItem.qml
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | 78 | if (listItem.icon.hasOwnProperty("source")) | |||
---|---|---|---|---|---|
79 | return listItem.icon.source; | 79 | return listItem.icon.source; | ||
80 | } | 80 | } | ||
81 | return listItem.icon; | 81 | return listItem.icon; | ||
82 | } | 82 | } | ||
83 | property int size: Units.iconSizes.smallMedium | 83 | property int size: Units.iconSizes.smallMedium | ||
84 | Layout.minimumHeight: size | 84 | Layout.minimumHeight: size | ||
85 | Layout.maximumHeight: size | 85 | Layout.maximumHeight: size | ||
86 | Layout.minimumWidth: size | 86 | Layout.minimumWidth: size | ||
87 | selected: layout.indicateActiveFocus && (listItem.highlighted || listItem.checked || listItem.pressed) | 87 | selected: layout.indicateActiveFocus && (listItem.highlighted || listItem.checked || (listItem.pressed && listItem.supportsMouseEvents)) | ||
88 | color: listItem.icon && listItem.icon.color && listItem.icon.color.a > 0 ? listItem.icon.color : (selected ? Theme.highlightedTextColor : Theme.textColor) | 88 | color: listItem.icon && listItem.icon.color && listItem.icon.color.a > 0 ? listItem.icon.color : (selected ? Theme.highlightedTextColor : Theme.textColor) | ||
89 | opacity: 1 | ||||
89 | } | 90 | } | ||
90 | QQC2.Label { | 91 | QQC2.Label { | ||
91 | id: labelItem | 92 | id: labelItem | ||
92 | text: listItem.text | 93 | text: listItem.text | ||
93 | Layout.fillWidth: true | 94 | Layout.fillWidth: true | ||
94 | color: layout.indicateActiveFocus && (listItem.highlighted || listItem.checked || listItem.pressed) ? listItem.activeTextColor : listItem.textColor | 95 | color: layout.indicateActiveFocus && (listItem.highlighted || listItem.checked || (listItem.pressed && listItem.supportsMouseEvents)) ? listItem.activeTextColor : listItem.textColor | ||
95 | elide: Text.ElideRight | 96 | elide: Text.ElideRight | ||
96 | font: listItem.font | 97 | font: listItem.font | ||
98 | opacity: 1 | ||||
97 | } | 99 | } | ||
98 | } | 100 | } | ||
99 | } | 101 | } |