diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-04-15 17:13:10 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-04-15 19:14:00 +0200 |
commit | 02ebee6d23eaea537b571a56d51876c33b942565 (patch) | |
tree | ada213abc8941c837c57f1b7b0485eb877fa050f /src/plugins/help | |
parent | ebb752230ffde4966150598e61a84df868581005 (diff) | |
download | qt-creator-02ebee6d23eaea537b571a56d51876c33b942565.tar.gz |
Tweak frame for open editors and open help pages switchers
In the GTK style the scroll bar likes to be outside of the scroll area
frame. Like with the completion widget, we put the visible frame
explicitly outside of the scroll bar.
Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/plugins/help')
-rw-r--r-- | src/plugins/help/openpagesswitcher.cpp | 15 | ||||
-rw-r--r-- | src/plugins/help/openpagesswitcher.h | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/help/openpagesswitcher.cpp b/src/plugins/help/openpagesswitcher.cpp index 7c446c3b60..9cdf4bfacf 100644 --- a/src/plugins/help/openpagesswitcher.cpp +++ b/src/plugins/help/openpagesswitcher.cpp @@ -36,6 +36,7 @@ #include <QtCore/QEvent> #include <QtGui/QKeyEvent> +#include <QtGui/QVBoxLayout> using namespace Help::Internal; @@ -43,16 +44,26 @@ const int gWidth = 300; const int gHeight = 200; OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model) - : QWidget(0, Qt::Popup) + : QFrame(0, Qt::Popup) , m_openPagesModel(model) { resize(gWidth, gHeight); m_openPagesWidget = new OpenPagesWidget(m_openPagesModel, this); + // We disable the frame on this list view and use a QFrame around it instead. + // This improves the look with QGTKStyle. +#ifndef Q_WS_MAC + setFrameStyle(m_openPagesWidget->frameStyle()); +#endif + m_openPagesWidget->setFrameStyle(QFrame::NoFrame); + m_openPagesWidget->allowContextMenu(false); m_openPagesWidget->installEventFilter(this); - m_openPagesWidget->setGeometry(0, 0, gWidth, gHeight); + + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setMargin(0); + layout->addWidget(m_openPagesWidget); connect(m_openPagesWidget, SIGNAL(closePage(QModelIndex)), this, SIGNAL(closePage(QModelIndex))); diff --git a/src/plugins/help/openpagesswitcher.h b/src/plugins/help/openpagesswitcher.h index 9cbd0e2044..e4f9bc1232 100644 --- a/src/plugins/help/openpagesswitcher.h +++ b/src/plugins/help/openpagesswitcher.h @@ -30,7 +30,7 @@ #ifndef OPENPAGESSWITCHER_H #define OPENPAGESSWITCHER_H -#include <QtGui/QWidget> +#include <QtGui/QFrame> QT_FORWARD_DECLARE_CLASS(QModelIndex) @@ -40,7 +40,7 @@ namespace Help { class OpenPagesModel; class OpenPagesWidget; -class OpenPagesSwitcher : public QWidget +class OpenPagesSwitcher : public QFrame { Q_OBJECT |