Merge "Different themes between desktop and dialogs"
This commit is contained in:
commit
43f1ff419d
@ -435,6 +435,21 @@ void AppletQuickItem::init()
|
|||||||
engine->setUrlInterceptor(interceptor);
|
engine->setUrlInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Force QtQuickControls to use the "Plasma" style for this engine.
|
||||||
|
//this way is possible to mix QtQuickControls and plasma components in applets
|
||||||
|
//while still having the desktop style in configuration dialogs
|
||||||
|
QQmlComponent c(engine);
|
||||||
|
c.setData("import QtQuick 2.1\n\
|
||||||
|
import QtQuick.Controls 1.0\n\
|
||||||
|
import QtQuick.Controls.Private 1.0\n \
|
||||||
|
Item {\
|
||||||
|
Component.onCompleted: {\
|
||||||
|
Settings.styleName = \"Plasma\";\
|
||||||
|
}\
|
||||||
|
}", QUrl());
|
||||||
|
QObject *o = c.create();
|
||||||
|
o->deleteLater();
|
||||||
|
|
||||||
d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->package().filePath("mainscript")));
|
d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->package().filePath("mainscript")));
|
||||||
|
|
||||||
if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) {
|
if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) {
|
||||||
|
@ -196,6 +196,21 @@ View::View(Plasma::Corona *corona, QWindow *parent)
|
|||||||
qWarning() << "Invalid home screen package";
|
qWarning() << "Invalid home screen package";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Force QtQuickControls to use the "Plasma" style for this engine.
|
||||||
|
//this way is possible to mix QtQuickControls and plasma components in applets
|
||||||
|
//while still having the desktop style in configuration dialogs
|
||||||
|
QQmlComponent c(engine());
|
||||||
|
c.setData("import QtQuick 2.1\n\
|
||||||
|
import QtQuick.Controls 1.0\n\
|
||||||
|
import QtQuick.Controls.Private 1.0\n \
|
||||||
|
Item {\
|
||||||
|
Component.onCompleted: {\
|
||||||
|
Settings.styleName = \"Plasma\";\
|
||||||
|
}\
|
||||||
|
}", QUrl());
|
||||||
|
QObject *o = c.create();
|
||||||
|
o->deleteLater();
|
||||||
|
|
||||||
setResizeMode(View::SizeRootObjectToView);
|
setResizeMode(View::SizeRootObjectToView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user