summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy Slobodin <vitaliy.slobodin@gmail.com>2016-09-11 12:35:18 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2016-09-19 21:16:20 +0000
commit490b7b65edbd06da0818c0ac765ca6ebd219dce3 (patch)
tree8744115c71712b9b13ce35d27236a04883ba78e2
parent7be993442fac143ef7b13515b70f0ebacaca2935 (diff)
downloadqtwebkit-490b7b65edbd06da0818c0ac765ca6ebd219dce3.tar.gz
Adjust the size of native popups
When WebKit renders a native control without appearance (-webkit-appearance: none;) for the menu list, it uses the width of the element for the popup size. We need to manually adjust the width of the popup to the longest name. Change-Id: I5883095ab0199c3360ed3fe45d2e2dace416cc4a Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp b/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
index 61ddacaa8..e6c83197e 100644
--- a/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
+++ b/Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp
@@ -71,6 +71,9 @@ void QtFallbackWebPopup::show(const QWebSelectData& data)
m_combo->setGeometry(QRect(rect.left(), rect.top(), rect.width(), m_combo->sizeHint().height()));
}
+ // adjust the size of combo box to the longest name
+ m_combo->adjustSize();
+
m_combo->showPopupAtCursorPosition();
}