[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/unity/WebKit/WebCore/platform/qt
From: Nikolas Zimmermann <wildfox () kde ! org>
Date: 2006-08-01 13:37:03
Message-ID: 1154439423.898825.9025.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 568526 by wildfox:
Offer a correct implementation for Page::windowRect / Page::setWindowRect
(these are used only from js when creating new windows...)
M +23 -1 PageQt.cpp
--- branches/work/unity/WebKit/WebCore/platform/qt/PageQt.cpp #568525:568526
@@ -25,6 +25,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <QDebug>
+#include <QWidget>
+
#include "config.h"
#include "Page.h"
@@ -34,13 +37,32 @@
namespace WebCore {
+static QWidget *rootWindowForFrame(const Frame* frame)
+{
+ FrameView *frameView = (frame ? frame->view() : 0);
+ if (!frameView)
+ return 0;
+
+ return frameView->qwidget();
+}
+
FloatRect Page::windowRect() const
{
- return FloatRect(0, 0, 600, 400);
+ QWidget *widget = rootWindowForFrame(mainFrame());
+ if (!widget)
+ return FloatRect();
+
+ qDebug() << " Page::windowRect() -> " << (QRectF) widget->geometry();
+ return (QRectF) widget->geometry();
}
void Page::setWindowRect(const FloatRect& r)
{
+ qDebug() << " Page::setWindowRect() -> " << (QRectF) r;
+
+ QWidget *widget = rootWindowForFrame(mainFrame());
+ if (widget)
+ widget->setGeometry(QRect(qRound(r.x()), qRound(r.y()), qRound(r.width()), qRound(r.height())));
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic