Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/UserDelegate.qml
Show All 31 Lines | 25 | Item { | |||
---|---|---|---|---|---|
32 | property bool isCurrent: true | 32 | property bool isCurrent: true | ||
33 | 33 | | |||
34 | readonly property var m: model | 34 | readonly property var m: model | ||
35 | property string name | 35 | property string name | ||
36 | property string userName | 36 | property string userName | ||
37 | property string avatarPath | 37 | property string avatarPath | ||
38 | property string iconSource | 38 | property string iconSource | ||
39 | property bool constrainText: true | 39 | property bool constrainText: true | ||
40 | property alias nameFontSize: usernameDelegate.font.pointSize | ||||
40 | signal clicked() | 41 | signal clicked() | ||
41 | 42 | | |||
42 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | 43 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | ||
43 | 44 | | |||
44 | opacity: isCurrent ? 1.0 : 0.5 | 45 | opacity: isCurrent ? 1.0 : 0.5 | ||
45 | 46 | | |||
46 | Behavior on opacity { | 47 | Behavior on opacity { | ||
47 | OpacityAnimator { | 48 | OpacityAnimator { | ||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 139 | void main() { | |||
154 | 155 | | |||
155 | gl_FragColor = gl_FragColor * qt_Opacity; | 156 | gl_FragColor = gl_FragColor * qt_Opacity; | ||
156 | } | 157 | } | ||
157 | " | 158 | " | ||
158 | } | 159 | } | ||
159 | 160 | | |||
160 | PlasmaComponents.Label { | 161 | PlasmaComponents.Label { | ||
161 | id: usernameDelegate | 162 | id: usernameDelegate | ||
162 | font.pointSize: theme.defaultFont.pointSize + 2 | 163 | property int fontSize: config.fontSize | ||
164 | font.pointSize: Math.max(fontSize + 2,theme.defaultFont.pointSize + 2) | ||||
163 | anchors { | 165 | anchors { | ||
164 | bottom: parent.bottom | 166 | bottom: parent.bottom | ||
165 | horizontalCenter: parent.horizontalCenter | 167 | horizontalCenter: parent.horizontalCenter | ||
166 | } | 168 | } | ||
167 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | 169 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | ||
168 | width: constrainText ? parent.width : implicitWidth | 170 | width: constrainText ? parent.width : implicitWidth | ||
169 | text: wrapper.name | 171 | text: wrapper.name | ||
170 | style: softwareRendering ? Text.Outline : Text.Normal | 172 | style: softwareRendering ? Text.Outline : Text.Normal | ||
Show All 18 Lines |