Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/UserDelegate.qml
Show All 16 Lines | |||||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.8 | 21 | import QtQuick 2.8 | ||
22 | import QtGraphicalEffects 1.0 | 22 | import QtGraphicalEffects 1.0 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
26 | 26 | | |||
27 | Item { | 27 | Item { | ||
28 | id: wrapper | 28 | id: wrapper | ||
29 | 29 | | |||
30 | // If we're using software rendering, draw outlines instead of shadows | 30 | // If we're using software rendering, draw outlines instead of shadows | ||
31 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | 31 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | ||
32 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | 32 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | ||
33 | 33 | | |||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 150 | DropShadow { | |||
152 | visible: !softwareRendering | 152 | visible: !softwareRendering | ||
153 | anchors.fill: usernameDelegate | 153 | anchors.fill: usernameDelegate | ||
154 | source: usernameDelegate | 154 | source: usernameDelegate | ||
155 | horizontalOffset: 1 | 155 | horizontalOffset: 1 | ||
156 | verticalOffset: 1 | 156 | verticalOffset: 1 | ||
157 | radius: 4 | 157 | radius: 4 | ||
158 | samples: 9 | 158 | samples: 9 | ||
159 | spread: 0.35 | 159 | spread: 0.35 | ||
160 | color: "black" // matches Breeze window decoration and desktopcontainment | 160 | color: "black" | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | PlasmaComponents.Label { | 163 | PlasmaExtras.Heading { | ||
164 | id: usernameDelegate | 164 | id: usernameDelegate | ||
165 | level: 4 | ||||
165 | anchors { | 166 | anchors { | ||
166 | bottom: parent.bottom | 167 | bottom: parent.bottom | ||
167 | horizontalCenter: parent.horizontalCenter | 168 | horizontalCenter: parent.horizontalCenter | ||
168 | } | 169 | } | ||
169 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | 170 | height: implicitHeight // work around stupid bug in Plasma Components that sets the height | ||
170 | width: constrainText ? parent.width : implicitWidth | 171 | width: constrainText ? parent.width : implicitWidth | ||
171 | text: wrapper.name | 172 | text: wrapper.name | ||
172 | style: softwareRendering ? Text.Outline : undefined | 173 | style: softwareRendering ? Text.Outline : undefined | ||
Show All 18 Lines |