on xenial help sign in
merge
commit7b1ff455e840b7a4f40e91c5aa491da0b8b73715 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 23 Mar 2017, 11:32 (10 years ago) parent013e5b1d1867f5
2 files changed+5−12
tests/mocks/Unity/Application/MirSurfaceItem.cpp+5−9 tests/mocks/Unity/Application/resources/MirSurfaceItem.qml−3
tests/mocks/Unity/Application/MirSurfaceItem.cpp+5−9
@@ -190,16 +190,12 @@ void MirSurfaceItem::createQmlContentItem()
190190 m_qmlItem->setParentItem(this);
191191
192192 if (m_fillMode == FillMode::Stretch && width() != 0 && height() != 0) {
193− m_qmlItem->setWidth(width());
194− m_qmlItem->setHeight(height());
193+ m_qmlItem->setSize(QSize(this->width(), this->height()));
195194 } else {
196− m_qmlItem->setWidth(m_surfaceWidth);
197− m_qmlItem->setHeight(m_surfaceHeight);
195+ m_qmlItem->setSize(m_qmlSurface->size());
198196 }
199−
200− qDebug() << "set size to" << m_surfaceWidth;
201− setImplicitWidth(m_qmlItem->implicitWidth());
202− setImplicitHeight(m_qmlItem->implicitHeight());
197+ setImplicitWidth(m_qmlItem->width());
198+ setImplicitHeight(m_qmlItem->height());
203199
204200 {
205201 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");
@@ -315,12 +311,12 @@ void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
315311 connect(m_qmlSurface, &MirSurface::liveChanged, this, &MirSurfaceItem::liveChanged);
316312 connect(m_qmlSurface, &MirSurface::stateChanged, this, &MirSurfaceItem::surfaceStateChanged);
317313 connect(m_qmlSurface, &MirSurface::sizeChanged, this, [this] () {
314+ setImplicitSize(m_qmlSurface->width(), m_qmlSurface->height());
318315 if (m_fillMode == FillMode::Stretch) {
319316 m_qmlItem->setSize(QSize(this->width(), this->height()));
320317 } else {
321318 m_qmlItem->setSize(m_qmlSurface->size());
322319 }
323− setImplicitSize(m_qmlSurface->width(), m_qmlSurface->height());
324320 });
325321 m_surfaceWidth = surface->size().width();
326322 m_surfaceHeight = surface->size().height();
tests/mocks/Unity/Application/resources/MirSurfaceItem.qml−3
@@ -20,9 +20,6 @@ Rectangle {
2020 id: root
2121 color: "pink"
2222
23− implicitWidth: width
24− implicitHeight: height
25−
2623 property alias screenshotSource: screenshotImage.source
2724 property int orientationAngle
2825