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 | ||||
41 | property int fontSize: config.fontSize | ||||
40 | signal clicked() | 42 | signal clicked() | ||
41 | 43 | | |||
42 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | 44 | property real faceSize: Math.min(width, height - usernameDelegate.height - units.smallSpacing) | ||
43 | 45 | | |||
44 | opacity: isCurrent ? 1.0 : 0.5 | 46 | opacity: isCurrent ? 1.0 : 0.5 | ||
45 | 47 | | |||
46 | Behavior on opacity { | 48 | Behavior on opacity { | ||
47 | OpacityAnimator { | 49 | OpacityAnimator { | ||
▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 140 | void main() { | |||
154 | 156 | | |||
155 | gl_FragColor = gl_FragColor * qt_Opacity; | 157 | gl_FragColor = gl_FragColor * qt_Opacity; | ||
156 | } | 158 | } | ||
157 | " | 159 | " | ||
158 | } | 160 | } | ||
159 | 161 | | |||
160 | PlasmaComponents.Label { | 162 | PlasmaComponents.Label { | ||
161 | id: usernameDelegate | 163 | id: usernameDelegate | ||
162 | font.pointSize: theme.defaultFont.pointSize + 2 | 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 |