Changeset 53769 in webkit
- Timestamp:
- Jan 23, 2010 8:37:44 AM (14 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/ChangeLog
r53716 r53769 1 2010-01-23 Girish Ramakrishnan <girish@forwardbias.in> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Fix positioning of ComboBox popup in QGraphicsWebView. 6 7 Wrap the popup in a QGraphicsProxyWidget, so that the popup 8 transforms with the item. 9 10 https://bugs.webkit.org/show_bug.cgi?id=33887 11 12 * WebCoreSupport/QtFallbackWebPopup.cpp: 13 (WebCore::QtFallbackWebPopupCombo::hidePopup): 14 (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): 15 (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): 16 (WebCore::QtFallbackWebPopup::show): 17 * WebCoreSupport/QtFallbackWebPopup.h: 18 1 19 2010-01-22 Peter Kasting <pkasting@google.com> 2 20 -
trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
r53716 r53769 1 1 /* 2 * Copyright (C) 2010 Girish Ramakrishnan <girish@forwardbias.in> 2 3 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) 3 4 * … … 23 24 #include "HostWindow.h" 24 25 #include "PopupMenuClient.h" 26 #include "qgraphicswebview.h" 25 27 #include "QWebPageClient.h" 26 28 #include <QAbstractItemView> 27 29 #include <QApplication> 30 #include <QGraphicsProxyWidget> 31 #include <QGraphicsScene> 32 #include <QGraphicsView> 28 33 #include <QInputContext> 29 34 #include <QMouseEvent> … … 56 61 57 62 QComboBox::hidePopup(); 63 64 if (QGraphicsProxyWidget* proxy = graphicsProxyWidget()) 65 proxy->setVisible(false); 66 58 67 if (!m_ownerPopup.m_popupVisible) 59 68 return; … … 69 78 , m_popupVisible(false) 70 79 , m_combo(new QtFallbackWebPopupCombo(*this)) 80 , m_proxy(0) 71 81 { 72 82 connect(m_combo, SIGNAL(activated(int)), … … 76 86 QtFallbackWebPopup::~QtFallbackWebPopup() 77 87 { 78 delete m_combo; 88 // If we create a proxy, then the deletion of the proxy and the 89 // combo will be done by the proxy's parent (QGraphicsWebView) 90 if (!m_proxy) 91 delete m_combo; 79 92 } 80 93 … … 82 95 { 83 96 populate(); 84 m_combo->setParent(pageClient()->ownerWidget());85 97 m_combo->setCurrentIndex(currentIndex()); 98 QRect rect = geometry(); 99 if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) { 100 if (!m_proxy) { 101 m_proxy = new QGraphicsProxyWidget(webView); 102 m_proxy->setWidget(m_combo); 103 } else 104 m_proxy->setVisible(true); 105 m_proxy->setGeometry(rect); 106 } else { 107 m_combo->setParent(pageClient()->ownerWidget()); 108 m_combo->setGeometry(QRect(rect.left(), rect.top(), 109 rect.width(), m_combo->sizeHint().height())); 86 110 87 QRect rect = geometry(); 88 m_combo->setGeometry(QRect(rect.left(), rect.top(), 89 rect.width(), m_combo->sizeHint().height())); 111 } 90 112 91 113 QMouseEvent event(QEvent::MouseButtonPress, QCursor::pos(), Qt::LeftButton, -
trunk/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
r53610 r53769 24 24 #include <QComboBox> 25 25 26 class QGraphicsProxyWidget; 27 26 28 namespace WebCore { 27 29 … … 44 46 bool m_popupVisible; 45 47 QtFallbackWebPopupCombo* m_combo; 48 QGraphicsProxyWidget* m_proxy; 46 49 47 50 void populate();
Note: See TracChangeset
for help on using the changeset viewer.