Different themes between desktop and dialogs
different themes between QtControl themes in applets and in config dialogs: this allows QtQuickControls to be freely usable in applets without worrying how they will integrate Change-Id: I696bdcbd78eb2e4df708367ac0d70d13c5d6cf12
This commit is contained in:
parent
2c8dd8982d
commit
340a4680bf
@ -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