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/openpagesswitcher.cpp | |
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/openpagesswitcher.cpp')
-rw-r--r-- | src/plugins/help/openpagesswitcher.cpp | 15 |
1 files changed, 13 insertions, 2 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))); |