From 490b7b65edbd06da0818c0ac765ca6ebd219dce3 Mon Sep 17 00:00:00 2001 From: Vitaliy Slobodin Date: Sun, 11 Sep 2016 12:35:18 +0300 Subject: 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 Reviewed-by: Allan Sandfeld Jensen --- Source/WebKit/qt/WidgetSupport/QtFallbackWebPopup.cpp | 3 +++ 1 file changed, 3 insertions(+) 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(); } -- cgit v1.2.1