From 68552f81dd72a4a554f3b8fefe485569d39fe851 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 12 Feb 2014 15:33:56 +0100 Subject: [PATCH] take into account margins when propagating size hints --- src/declarativeimports/core/dialog.cpp | 8 ++++---- src/shell/panelconfigview.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/declarativeimports/core/dialog.cpp b/src/declarativeimports/core/dialog.cpp index 81b4672f1..d88b9700e 100644 --- a/src/declarativeimports/core/dialog.cpp +++ b/src/declarativeimports/core/dialog.cpp @@ -652,7 +652,7 @@ QScreen* DialogProxy::screenForItem(QQuickItem* item) const void DialogProxy::updateMinimumWidth() { if (m_mainItemLayout) { - setMinimumWidth(m_mainItemLayout.data()->property("minimumWidth").toInt()); + setMinimumWidth(m_mainItemLayout.data()->property("minimumWidth").toInt() + m_frameSvgItem->margins()->left() + m_frameSvgItem->margins()->right()); } else { setMinimumWidth(-1); } @@ -661,7 +661,7 @@ void DialogProxy::updateMinimumWidth() void DialogProxy::updateMinimumHeight() { if (m_mainItemLayout) { - setMinimumHeight(m_mainItemLayout.data()->property("minimumHeight").toInt()); + setMinimumHeight(m_mainItemLayout.data()->property("minimumHeight").toInt() + m_frameSvgItem->margins()->top() + m_frameSvgItem->margins()->bottom()); } else { setMinimumHeight(-1); } @@ -670,7 +670,7 @@ void DialogProxy::updateMinimumHeight() void DialogProxy::updateMaximumWidth() { if (m_mainItemLayout) { - const int hint = m_mainItemLayout.data()->property("maximumWidth").toInt(); + const int hint = m_mainItemLayout.data()->property("maximumWidth").toInt() + m_frameSvgItem->margins()->left() + m_frameSvgItem->margins()->right(); if (hint > 0) { setMaximumWidth(hint); } else { @@ -684,7 +684,7 @@ void DialogProxy::updateMaximumWidth() void DialogProxy::updateMaximumHeight() { if (m_mainItemLayout) { - const int hint = m_mainItemLayout.data()->property("maximumHeight").toInt(); + const int hint = m_mainItemLayout.data()->property("maximumHeight").toInt() + m_frameSvgItem->margins()->top() + m_frameSvgItem->margins()->bottom(); if (hint > 0) { setMaximumWidth(hint); } else { diff --git a/src/shell/panelconfigview.cpp b/src/shell/panelconfigview.cpp index 45026180f..5830745e0 100644 --- a/src/shell/panelconfigview.cpp +++ b/src/shell/panelconfigview.cpp @@ -107,7 +107,7 @@ void PanelConfigView::syncGeometry() void PanelConfigView::focusOutEvent(QFocusEvent *ev) { Q_UNUSED(ev) - close(); + //close(); } #include "moc_panelconfigview.cpp"