From 181b39ddd0b3c027341b228ab51482ce4413d3bb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 10 Mar 2016 13:54:07 +0100 Subject: add scaling unit to the theme plugin and use it instaed of the main.qml unit item --- framework/theme/themeplugin.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'framework/theme/themeplugin.cpp') diff --git a/framework/theme/themeplugin.cpp b/framework/theme/themeplugin.cpp index 919205cf..ad9d0e1b 100644 --- a/framework/theme/themeplugin.cpp +++ b/framework/theme/themeplugin.cpp @@ -18,11 +18,12 @@ #include "themeplugin.h" -#include "colorpalette.h" - #include #include +#include "colorpalette.h" +#include "unit.h" + static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine); @@ -31,10 +32,19 @@ static QObject *colorpaletteInstace(QQmlEngine *engine, QJSEngine *scriptEngine) return new ColorPalette; } +static QObject *unitInstace(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine); + Q_UNUSED(scriptEngine); + + return new Unit; +} + void ThemePlugin::registerTypes (const char *uri) { Q_ASSERT(uri == QLatin1String("org.kube.framework.theme")); qmlRegisterSingletonType(uri, 1, 0, "ColorPalette", colorpaletteInstace); + qmlRegisterSingletonType(uri, 1, 0, "Unit", unitInstace); } -- cgit v1.2.3