diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/platform/qt/PopupMenuQt.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/platform/qt/PopupMenuQt.cpp')
-rw-r--r-- | WebCore/platform/qt/PopupMenuQt.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/WebCore/platform/qt/PopupMenuQt.cpp b/WebCore/platform/qt/PopupMenuQt.cpp index add4d84..76728fa 100644 --- a/WebCore/platform/qt/PopupMenuQt.cpp +++ b/WebCore/platform/qt/PopupMenuQt.cpp @@ -1,7 +1,7 @@ /* * This file is part of the popup menu implementation for <select> elements in WebCore. * - * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * Copyright (C) 2006 Apple Computer, Inc. * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com * Coypright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> @@ -28,6 +28,7 @@ #include "Frame.h" #include "FrameView.h" +#include "HostWindow.h" #include "PopupMenuClient.h" #include "NotImplemented.h" #include "QWebPopup.h" @@ -70,7 +71,7 @@ void PopupMenu::populate(const IntRect& r) m_popup->insertItem(i, QString::fromLatin1("---")); } else { - //RenderStyle* style = client()->itemStyle(i); + //PopupMenuStyle style = client()->itemStyle(i); m_popup->insertItem(i, client()->itemText(i)); #if 0 item = new QListWidgetItem(client()->itemText(i)); @@ -89,13 +90,14 @@ void PopupMenu::populate(const IntRect& r) void PopupMenu::show(const IntRect& r, FrameView* v, int index) { + QWidget* window = v->hostWindow()->platformWindow(); populate(r); QRect rect = r; rect.moveTopLeft(v->contentsToWindow(r.topLeft())); - QRect global(v->containingWindow()->mapToGlobal(QPoint(rect.x(), rect.y())), - QSize(rect.width(), m_popup->sizeHint().height())); + rect.setHeight(m_popup->sizeHint().height()); - m_popup->setGeometry(global); + m_popup->setParent(window); + m_popup->setGeometry(rect); m_popup->setCurrentIndex(index); m_popup->exec(); } |