From 5fb054a17c74fe4aed950e4173aa05f43f0355cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 6 Nov 2015 21:50:52 +0000 Subject: [PATCH] some changes from the upstream wip-branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove the singleton usage, this will need a bit more magic in the background. Not a huge problem since we're only using one instance anyway, and the object itself is rather light - hardcode gridUnit for now. I'd like to use TextMetrics or FontMetrics there directly, but I'm not sure we can depend on Qt 5.4 and QtQuick 2.5. Signed-off-by: Sebastian Kügler Signed-off-by: Dirk Hohndel --- qt-mobile/mobile-resources.qrc | 1 + qt-mobile/theme/Theme.qml | 4 ++-- qt-mobile/theme/Units.qml | 18 +++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/qt-mobile/mobile-resources.qrc b/qt-mobile/mobile-resources.qrc index 2241fa667..a5875bf68 100644 --- a/qt-mobile/mobile-resources.qrc +++ b/qt-mobile/mobile-resources.qrc @@ -12,6 +12,7 @@ theme/Theme.qml + theme/qmldir theme/Units.qml diff --git a/qt-mobile/theme/Theme.qml b/qt-mobile/theme/Theme.qml index 81c939505..faf96f96f 100644 --- a/qt-mobile/theme/Theme.qml +++ b/qt-mobile/theme/Theme.qml @@ -19,7 +19,7 @@ import QtQuick 2.0 -pragma Singleton +//pragma Singleton /*! \qmltype Theme @@ -30,7 +30,7 @@ pragma Singleton See \l {http://www.google.com/design/spec/style/color.html#color-ui-color-application} for details about choosing a color scheme for your application. */ -Object { +QtObject { id: theme property color textColor: Qt.rgba(0,0,0, 0.54) diff --git a/qt-mobile/theme/Units.qml b/qt-mobile/theme/Units.qml index a8b8c629b..9efec3157 100644 --- a/qt-mobile/theme/Units.qml +++ b/qt-mobile/theme/Units.qml @@ -17,13 +17,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import QtQuick 2.0 +import QtQuick 2.5 import QtQuick.Window 2.2 -pragma Singleton +//pragma Singleton -Object { +QtObject { id: units /** @@ -31,7 +31,7 @@ Object { * Given the screen has an accurate DPI settings, it corresponds to a width of * the capital letter M */ - property int gridUnit: textSpacer.height + property int gridUnit: 20 /** * units.iconSizes provides access to platform-dependent icon sizing @@ -50,7 +50,7 @@ Object { * Not devicePixelRation-adjusted:: * * desktop */ - property QtObject iconSizes: Object { + property QtObject iconSizes: QtObject { property int small: 16 * devicePixelRatio property int smallMedium: 22 * devicePixelRatio property int medium: 32 * devicePixelRatio @@ -95,8 +95,8 @@ Object { */ property int shortDuration: 150 - Text { - id: textSpacer - text: "M" - } +// property QtObject fontMetrics: FontMetrics { +// //id: textSpacer +// //text: "M" +// } }