Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/UserDelegate.qml
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | 128 | void main() { | |||
---|---|---|---|---|---|
142 | else | 142 | else | ||
143 | gl_FragColor = colorEmpty ; | 143 | gl_FragColor = colorEmpty ; | ||
144 | 144 | | |||
145 | gl_FragColor = gl_FragColor * qt_Opacity; | 145 | gl_FragColor = gl_FragColor * qt_Opacity; | ||
146 | } | 146 | } | ||
147 | " | 147 | " | ||
148 | } | 148 | } | ||
149 | 149 | | |||
150 | DropShadow { | ||||
151 | id: usernameShadow | ||||
152 | visible: !softwareRendering | ||||
153 | anchors.fill: usernameDelegate | ||||
154 | source: usernameDelegate | ||||
155 | horizontalOffset: 0 | ||||
156 | verticalOffset: 1 | ||||
157 | radius: 12 | ||||
158 | samples: 32 | ||||
159 | spread: 0.35 | ||||
160 | color: ColorScope.backgroundColor | ||||
161 | } | ||||
162 | | ||||
150 | PlasmaComponents.Label { | 163 | PlasmaComponents.Label { | ||
151 | id: usernameDelegate | 164 | id: usernameDelegate | ||
152 | anchors { | 165 | anchors { | ||
153 | bottom: parent.bottom | 166 | bottom: parent.bottom | ||
154 | horizontalCenter: parent.horizontalCenter | 167 | horizontalCenter: parent.horizontalCenter | ||
155 | } | 168 | } | ||
156 | 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 | ||
157 | width: constrainText ? parent.width : implicitWidth | 170 | width: constrainText ? parent.width : implicitWidth | ||
158 | text: wrapper.name | 171 | text: wrapper.name | ||
159 | style: softwareRendering ? Text.Outline : undefined | 172 | style: softwareRendering ? Text.Outline : undefined | ||
160 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | 173 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | ||
161 | elide: Text.ElideRight | 174 | elide: Text.ElideRight | ||
162 | horizontalAlignment: Text.AlignHCenter | 175 | horizontalAlignment: Text.AlignHCenter | ||
163 | //make an indication that this has active focus, this only happens when reached with keyboard navigation | 176 | //make an indication that this has active focus, this only happens when reached with keyboard navigation | ||
164 | font.underline: wrapper.activeFocus | 177 | font.underline: wrapper.activeFocus | ||
165 | | ||||
166 | layer.enabled: !softwareRendering | | |||
167 | layer.effect: DropShadow { | | |||
168 | horizontalOffset: 0 | | |||
169 | verticalOffset: 1 | | |||
170 | radius: 12 | | |||
171 | samples: 32 | | |||
172 | spread: 0.35 | | |||
173 | color: ColorScope.backgroundColor | | |||
174 | } | | |||
175 | } | 178 | } | ||
176 | 179 | | |||
177 | MouseArea { | 180 | MouseArea { | ||
178 | anchors.fill: parent | 181 | anchors.fill: parent | ||
179 | hoverEnabled: true | 182 | hoverEnabled: true | ||
180 | 183 | | |||
181 | onClicked: wrapper.clicked(); | 184 | onClicked: wrapper.clicked(); | ||
182 | } | 185 | } | ||
183 | 186 | | |||
184 | Accessible.name: name | 187 | Accessible.name: name | ||
185 | Accessible.role: Accessible.Button | 188 | Accessible.role: Accessible.Button | ||
186 | function accessiblePressAction() { wrapper.clicked() } | 189 | function accessiblePressAction() { wrapper.clicked() } | ||
187 | } | 190 | } |