diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-11-29 11:13:02 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:06 +0100 |
commit | 7018aee5e2192822fea01553348b673d22539475 (patch) | |
tree | 46a2becb006b570e06504595001a096625d13fb0 /src/webtab | |
parent | Restoring inspector, part 2 (diff) | |
download | rekonq-7018aee5e2192822fea01553348b673d22539475.tar.xz |
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...
Diffstat (limited to 'src/webtab')
-rw-r--r-- | src/webtab/webtab.cpp | 16 | ||||
-rw-r--r-- | 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<QVBoxLayout *>(layout())->insertWidget(-1, m_inspector.data()); m_inspector.data()->show(); return; } // else - qobject_cast<QVBoxLayout *>(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 <QWidget> #include <QWebInspector> +#include <QSplitter> // Forward Declarations class NotificationBar; @@ -125,6 +126,8 @@ private: KParts::ReadOnlyPart *m_part; int m_zoomFactor; + + QSplitter *m_splitter; }; #endif |