Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/UserDelegate.qml
Show All 24 Lines | |||||
25 | Item { | 25 | Item { | ||
26 | id: wrapper | 26 | id: wrapper | ||
27 | 27 | | |||
28 | // If we're using software rendering, draw outlines instead of shadows | 28 | // If we're using software rendering, draw outlines instead of shadows | ||
29 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | 29 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | ||
30 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | 30 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | ||
31 | 31 | | |||
32 | property bool isCurrent: true | 32 | property bool isCurrent: true | ||
33 | | ||||
34 | readonly property var m: model | 33 | readonly property var m: model | ||
35 | property string name | 34 | property string name | ||
36 | property string userName | 35 | property string userName | ||
37 | property string avatarPath | 36 | property string avatarPath | ||
38 | property string iconSource | 37 | property string iconSource | ||
38 | property int nameFontSize | ||||
39 | property bool constrainText: true | 39 | property bool constrainText: true | ||
40 | signal clicked() | 40 | signal clicked() | ||
41 | 41 | | |||
42 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | 42 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | ||
43 | 43 | | |||
44 | opacity: isCurrent ? 1.0 : 0.5 | 44 | opacity: isCurrent ? 1.0 : 0.5 | ||
45 | 45 | | |||
46 | Behavior on opacity { | 46 | Behavior on opacity { | ||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 138 | void main() { | |||
154 | 154 | | |||
155 | gl_FragColor = gl_FragColor * qt_Opacity; | 155 | gl_FragColor = gl_FragColor * qt_Opacity; | ||
156 | } | 156 | } | ||
157 | " | 157 | " | ||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | PlasmaComponents.Label { | 160 | PlasmaComponents.Label { | ||
161 | id: usernameDelegate | 161 | id: usernameDelegate | ||
162 | font.pointSize: theme.defaultFont.pointSize + 2 | 162 | font.pointSize: nameFontSize | ||
163 | anchors { | 163 | anchors { | ||
164 | bottom: parent.bottom | 164 | bottom: parent.bottom | ||
165 | horizontalCenter: parent.horizontalCenter | 165 | horizontalCenter: parent.horizontalCenter | ||
166 | } | 166 | } | ||
167 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | 167 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | ||
168 | width: constrainText ? parent.width : implicitWidth | 168 | width: constrainText ? parent.width : implicitWidth | ||
169 | text: wrapper.name | 169 | text: wrapper.name | ||
170 | style: softwareRendering ? Text.Outline : Text.Normal | 170 | style: softwareRendering ? Text.Outline : Text.Normal | ||
Show All 18 Lines |