Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/Clock.qml
Show All 25 Lines | |||||
26 | 26 | | |||
27 | Item { | 27 | Item { | ||
28 | // If we're using software rendering, draw outlines instead of shadows | 28 | // If we're using software rendering, draw outlines instead of shadows | ||
29 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | 29 | // See https://bugs.kde.org/show_bug.cgi?id=398317 | ||
30 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | 30 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | ||
31 | 31 | | |||
32 | width: clock.implicitWidth | 32 | width: clock.implicitWidth | ||
33 | height: clock.implicitHeight | 33 | height: clock.implicitHeight | ||
34 | 34 | | |||
35 | DropShadow { | ||||
36 | id: clockShadow | ||||
37 | visible: !softwareRendering | ||||
38 | anchors.fill: clock | ||||
39 | source: clock | ||||
40 | horizontalOffset: 1 | ||||
41 | verticalOffset: 1 | ||||
42 | radius: 6 | ||||
43 | samples: 14 | ||||
44 | spread: 0.30 | ||||
ngraham: If we're emulating the shadows in D16968, shouldn't this be 0.35? | |||||
rooty: Yes, but doesn't it look too jagged when it's 0.35?
0.35:
{F6639986}
0.25:
{F6639988} | |||||
45 | color: "black" // new Breeze shadow color | ||||
46 | } | ||||
47 | | ||||
35 | ColumnLayout { | 48 | ColumnLayout { | ||
"New" isn't going to be accurate for very long. :) We should also explain in the comment why we're hardcoding a color since this reflects a reversion of that change (continuity with Breeze shadow color, black looks better than gray, not even necessary to use a theme color since the text color is always white, etc) ngraham: "New" isn't going to be accurate for very long. :)
We should also explain in the comment why… | |||||
36 | id: clock | 49 | id: clock | ||
37 | Label { | 50 | Label { | ||
38 | text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) | 51 | text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) | ||
39 | style: softwareRendering ? Text.Outline : undefined | 52 | style: softwareRendering ? Text.Outline : undefined | ||
40 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | 53 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | ||
41 | font.pointSize: 48 | 54 | font.pointSize: 48 | ||
42 | Layout.alignment: Qt.AlignHCenter | 55 | Layout.alignment: Qt.AlignHCenter | ||
43 | } | 56 | } | ||
44 | Label { | 57 | Label { | ||
45 | text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) | 58 | text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) | ||
46 | style: softwareRendering ? Text.Outline : undefined | 59 | style: softwareRendering ? Text.Outline : undefined | ||
47 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | 60 | styleColor: softwareRendering ? ColorScope.backgroundColor : undefined | ||
48 | font.pointSize: 24 | 61 | font.pointSize: 24 | ||
49 | Layout.alignment: Qt.AlignHCenter | 62 | Layout.alignment: Qt.AlignHCenter | ||
50 | } | 63 | } | ||
51 | DataSource { | 64 | DataSource { | ||
52 | id: timeSource | 65 | id: timeSource | ||
53 | engine: "time" | 66 | engine: "time" | ||
54 | connectedSources: ["Local"] | 67 | connectedSources: ["Local"] | ||
55 | interval: 1000 | 68 | interval: 1000 | ||
56 | } | 69 | } | ||
57 | } | 70 | } | ||
58 | | ||||
59 | layer.enabled: !softwareRendering | | |||
60 | layer.effect: DropShadow { | | |||
61 | horizontalOffset: 0 | | |||
62 | verticalOffset: 2 | | |||
63 | radius: 14 | | |||
64 | samples: 32 | | |||
65 | spread: 0.3 | | |||
66 | color: ColorScope.backgroundColor | | |||
67 | } | | |||
68 | } | 71 | } |
If we're emulating the shadows in D16968, shouldn't this be 0.35?