Export Plasma::Theme as theme, remove proxy class
The last bits have moved out of ThemeProxy, units is used for iconSizes, which means we can finally directly use Plasma::Theme, and don't need a ThemeProxy class anymore.
This commit is contained in:
parent
0c3e49866a
commit
e81db11f05
@ -15,7 +15,6 @@ endif()
|
||||
|
||||
set(corebindings_SRCS
|
||||
corebindingsplugin.cpp
|
||||
theme.cpp
|
||||
datamodel.cpp
|
||||
datasource.cpp
|
||||
dialogshadows.cpp
|
||||
|
@ -56,7 +56,7 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
|
||||
|
||||
QQmlContext *context = engine->rootContext();
|
||||
|
||||
ThemeProxy *theme = new ThemeProxy(engine);
|
||||
Plasma::Theme *theme = new Plasma::Theme(engine);
|
||||
context->setContextProperty("theme", theme);
|
||||
|
||||
if (!engine->rootContext()->contextObject()) {
|
||||
@ -78,7 +78,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
|
||||
qmlRegisterType<Plasma::FrameSvgItem>(uri, 2, 0, "FrameSvgItem");
|
||||
|
||||
//qmlRegisterType<ThemeProxy>(uri, 2, 0, "Theme");
|
||||
qmlRegisterType<ThemeProxy>();
|
||||
qmlRegisterType<Plasma::Theme>();
|
||||
|
||||
qmlRegisterType<Plasma::DataSource>(uri, 2, 0, "DataSource");
|
||||
qmlRegisterType<Plasma::DataModel>(uri, 2, 0, "DataModel");
|
||||
|
@ -66,26 +66,6 @@ QQmlPropertyMap *ThemeProxy::iconSizes() const
|
||||
return m_iconSizes;
|
||||
}
|
||||
|
||||
int ThemeProxy::dpi(QQuickItem* item)
|
||||
{
|
||||
int _dpi = 1337;
|
||||
qDebug() << " ----- dpi() ---- ";
|
||||
if (item) {
|
||||
QScreen* screen = item->window()->screen();
|
||||
if (screen) {
|
||||
qDebug() << "screen geo: " << screen->availableGeometry();
|
||||
_dpi = screen->physicalDotsPerInch();
|
||||
qDebug() << " refreshRate : " << screen->refreshRate();
|
||||
qDebug() << " devicePixelRatio: " << screen->devicePixelRatio();
|
||||
qDebug() << " depth : " << screen->depth();
|
||||
qDebug() << " dpi X: " << screen->physicalDotsPerInchX();
|
||||
qDebug() << " dpi Y: " << screen->physicalDotsPerInchY();
|
||||
qDebug() << " ->> dpi: " << _dpi;
|
||||
}
|
||||
}
|
||||
return _dpi;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_theme.cpp"
|
||||
|
Loading…
Reference in New Issue
Block a user