From 7018aee5e2192822fea01553348b673d22539475 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 29 Nov 2012 11:13:02 +0100 Subject: Restoring inspector, part 3 Added a splitter to let inspector widget be resizable Following my wife hint, it seems it is better to let it be in the right part. Let's see what people has to comment about... --- src/webtab/webtab.cpp | 16 ++++++++++++---- src/webtab/webtab.h | 3 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp index 1f6789f2..2622a96a 100644 --- a/src/webtab/webtab.cpp +++ b/src/webtab/webtab.cpp @@ -73,6 +73,7 @@ WebTab::WebTab(QWidget *parent) , m_progress(0) , m_part(0) , m_zoomFactor(10) + , m_splitter(new QSplitter(this)) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -80,12 +81,20 @@ WebTab::WebTab(QWidget *parent) l->setMargin(0); l->setSpacing(0); - l->addWidget(view()); + m_splitter->addWidget(view()); view()->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + // NOTE: this line of code moves the web inspector in the usual position, + // BUT my wife prefers it on the right part. Following hint about. + // Let's hear people comments about... +// m_splitter->setOrientation(Qt::Vertical); + + l->addWidget(m_splitter); + // fix focus handling setFocusProxy(view()); + KWebWallet *wallet = page()->wallet(); if (wallet) @@ -435,17 +444,16 @@ void WebTab::toggleInspector(bool on) { m_inspector = new QWebInspector(this); m_inspector.data()->setPage(page()); + + m_splitter->addWidget(m_inspector.data()); } - qobject_cast(layout())->insertWidget(-1, m_inspector.data()); m_inspector.data()->show(); return; } // else - qobject_cast(layout())->removeWidget(m_inspector.data()); - m_inspector.data()->hide(); page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); diff --git a/src/webtab/webtab.h b/src/webtab/webtab.h index 2b0f70f3..75f975d8 100644 --- a/src/webtab/webtab.h +++ b/src/webtab/webtab.h @@ -41,6 +41,7 @@ // Qt Includes #include #include +#include // Forward Declarations class NotificationBar; @@ -125,6 +126,8 @@ private: KParts::ReadOnlyPart *m_part; int m_zoomFactor; + + QSplitter *m_splitter; }; #endif -- cgit v1.2.1