Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/Clock.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.8 | 20 | import QtQuick 2.8 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
22 | 22 | import QtQuick.Controls 2.5 | |||
23 | import org.kde.plasma.core 2.0 | 23 | import org.kde.plasma.core 2.0 | ||
24 | import org.kde.plasma.components 2.0 | | |||
25 | 24 | | |||
26 | ColumnLayout { | 25 | ColumnLayout { | ||
27 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | 26 | readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software | ||
28 | 27 | | |||
29 | Label { | 28 | Label { | ||
30 | text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) | 29 | text: Qt.formatTime(timeSource.data["Local"]["DateTime"]) | ||
30 | color: ColorScope.textColor | ||||
31 | style: softwareRendering ? Text.Outline : Text.Normal | 31 | style: softwareRendering ? Text.Outline : Text.Normal | ||
32 | styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter | 32 | styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter | ||
33 | font.pointSize: 48 | 33 | font.pointSize: 48 | ||
34 | Layout.alignment: Qt.AlignHCenter | 34 | Layout.alignment: Qt.AlignHCenter | ||
35 | } | 35 | } | ||
36 | Label { | 36 | Label { | ||
37 | text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) | 37 | text: Qt.formatDate(timeSource.data["Local"]["DateTime"], Qt.DefaultLocaleLongDate) | ||
38 | color: ColorScope.textColor | ||||
38 | style: softwareRendering ? Text.Outline : Text.Normal | 39 | style: softwareRendering ? Text.Outline : Text.Normal | ||
39 | styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter | 40 | styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" //no outline, doesn't matter | ||
40 | font.pointSize: 24 | 41 | font.pointSize: 24 | ||
41 | Layout.alignment: Qt.AlignHCenter | 42 | Layout.alignment: Qt.AlignHCenter | ||
42 | } | 43 | } | ||
43 | DataSource { | 44 | DataSource { | ||
44 | id: timeSource | 45 | id: timeSource | ||
45 | engine: "time" | 46 | engine: "time" | ||
46 | connectedSources: ["Local"] | 47 | connectedSources: ["Local"] | ||
47 | interval: 1000 | 48 | interval: 1000 | ||
48 | } | 49 | } | ||
49 | } | 50 | } |