From 74febc221954a61fdd83c7bb476fc5d9e1918eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 12 Apr 2013 02:06:42 +0200 Subject: [PATCH] test locale bindings --- .../contents/ui/DialogContent.qml | 6 ++++- .../contents/ui/LocaleItem.qml | 24 +++++++++++++++++++ .../contents/ui/PlasmoidPage.qml | 1 - 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/shell/applets/testcomponentsapplet/contents/ui/LocaleItem.qml diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml index 08674fc49..9fed86d33 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/DialogContent.qml @@ -44,8 +44,12 @@ Item { id: tx text: "Test Dialog" } - PlasmaComponents.TextArea { + LocaleItem { + id: localeItem anchors { left: parent.left; right: parent.right; top: tx.bottom; } + } + PlasmaComponents.TextArea { + anchors { left: parent.left; right: parent.right; top: localeItem.bottom; } width: parent.width height: 80 } diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/LocaleItem.qml b/src/shell/applets/testcomponentsapplet/contents/ui/LocaleItem.qml new file mode 100644 index 000000000..d8d29e1e3 --- /dev/null +++ b/src/shell/applets/testcomponentsapplet/contents/ui/LocaleItem.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.locale 2.0 + + +Item { + width: childrenRect.width + height: childrenRect.height + + Locale { + id: locale + } + Column { + PlasmaComponents.Label { + text: "Locale Time Bindings" + } + PlasmaComponents.Label { + text: locale.formatLocaleTime( "11:12:13", Locale.TimeWithoutAmPm|Locale.TimeWithoutSeconds ) + } + PlasmaComponents.Label { + text: locale.formatDateTime("2013-04-12", Locale.ShortDate ,Locale.Seconds ) + } + } +} \ No newline at end of file diff --git a/src/shell/applets/testcomponentsapplet/contents/ui/PlasmoidPage.qml b/src/shell/applets/testcomponentsapplet/contents/ui/PlasmoidPage.qml index 5b621309a..39e341825 100644 --- a/src/shell/applets/testcomponentsapplet/contents/ui/PlasmoidPage.qml +++ b/src/shell/applets/testcomponentsapplet/contents/ui/PlasmoidPage.qml @@ -85,7 +85,6 @@ PlasmaComponents.Page { menuLoader.item.open(0, height); } } - } }