resize the graphics object as soon as possible
it avoids many resizes that take cpu cycles and mess with the layout
This commit is contained in:
parent
4767f3a8d0
commit
e16c30142f
|
@ -102,7 +102,9 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
|
|||
if (graphicObject) {
|
||||
qDebug() << "using as graphic containment" << graphicObject << containment.data();
|
||||
|
||||
//graphicObject->setProperty("visible", false);
|
||||
//by resizing before adding, it will avoid some resizes in most cases
|
||||
graphicObject->setProperty("width", q->width());
|
||||
graphicObject->setProperty("height", q->height());
|
||||
graphicObject->setProperty("drawWallpaper",
|
||||
(cont->containmentType() == Plasma::Types::DesktopContainment ||
|
||||
cont->containmentType() == Plasma::Types::CustomContainment));
|
||||
|
|
|
@ -143,7 +143,11 @@ void AppletInterface::init()
|
|||
|
||||
m_qmlObject->engine()->rootContext()->setContextProperty("plasmoid", this);
|
||||
|
||||
m_qmlObject->completeInitialization();
|
||||
//initialize size, so an useless resize less
|
||||
QVariantHash initialProperties;
|
||||
initialProperties["width"] = width();
|
||||
initialProperties["height"] = height();
|
||||
m_qmlObject->completeInitialization(initialProperties);
|
||||
|
||||
qDebug() << "Graphic object created:" << applet() << applet()->property("graphicObject");
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
|
|||
m_wallpaperInterface(0)
|
||||
{
|
||||
setAcceptedMouseButtons(Qt::AllButtons);
|
||||
setFlag(QQuickItem::ItemAcceptsDrops);
|
||||
|
||||
qmlRegisterType<ContainmentInterface>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user