Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/lockscreen/LockScreenUi.qml
Show All 24 Lines | |||||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | 25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
26 | import org.kde.plasma.components 2.0 as PlasmaComponents | 26 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
27 | 27 | | |||
28 | import org.kde.plasma.private.sessions 2.0 | 28 | import org.kde.plasma.private.sessions 2.0 | ||
29 | import "../components" | 29 | import "../components" | ||
30 | 30 | | |||
31 | PlasmaCore.ColorScope { | 31 | PlasmaCore.ColorScope { | ||
32 | 32 | | |||
33 | id: lockScreenUi | ||||
33 | // If we're using software rendering, draw outlines instead of shadows | 34 | // If we're using software rendering, draw outlines instead of shadows | ||
34 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | 35 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | ||
35 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | 36 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | ||
37 | readonly property bool lightBackground: Math.max(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b) > 0.5 | ||||
broulik: Would it make more sense to use `hsvValue` or `hslLightness`? | |||||
Maybe, I just copy pasted this from the wallpaper fader: https://github.com/KDE/plasma-workspace/blob/master/lookandfeel/contents/components/WallpaperFader.qml#L39 An similar check can be found in the logout screen as well: https://github.com/KDE/plasma-workspace/blob/master/lookandfeel/contents/logout/Logout.qml#L104 filipf: Maybe, I just copy pasted this from the wallpaper fader: https://github.com/KDE/plasma… | |||||
36 | 38 | | |||
37 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | 39 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | ||
38 | 40 | | |||
39 | Connections { | 41 | Connections { | ||
40 | target: authenticator | 42 | target: authenticator | ||
41 | onFailed: { | 43 | onFailed: { | ||
42 | root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed"); | 44 | root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed"); | ||
43 | } | 45 | } | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 170 | DropShadow { | |||
170 | anchors.fill: clock | 172 | anchors.fill: clock | ||
171 | source: clock | 173 | source: clock | ||
172 | visible: !softwareRendering | 174 | visible: !softwareRendering | ||
173 | horizontalOffset: 1 | 175 | horizontalOffset: 1 | ||
174 | verticalOffset: 1 | 176 | verticalOffset: 1 | ||
175 | radius: 6 | 177 | radius: 6 | ||
176 | samples: 14 | 178 | samples: 14 | ||
177 | spread: 0.3 | 179 | spread: 0.3 | ||
178 | color: "black" // matches Breeze window decoration and desktopcontainment | 180 | color: lockScreenUi.lightBackground ? PlasmaCore.ColorScope.backgroundColor : "black" // black matches Breeze window decoration and desktopcontainment | ||
179 | Behavior on opacity { | 181 | Behavior on opacity { | ||
180 | OpacityAnimator { | 182 | OpacityAnimator { | ||
181 | duration: 1000 | 183 | duration: 1000 | ||
182 | easing.type: Easing.InOutQuad | 184 | easing.type: Easing.InOutQuad | ||
183 | } | 185 | } | ||
184 | } | 186 | } | ||
185 | } | 187 | } | ||
186 | 188 | | |||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |
Would it make more sense to use hsvValue or hslLightness?