diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-03-24 23:06:43 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-03-24 23:06:43 (GMT) |
commit | d20510dd91e01b15e2346c0cb12e352080b6a093 (patch) | |
tree | 83554f5c96f69df6fe6d9d5c2a9f529a3b1316d8 /src/gui/widgets | |
parent | f727f993c3c4e3f548b06d57b3ee0da4f3914bae (diff) | |
parent | 8218a16815d883823d3411be9896332b997f3e91 (diff) | |
download | Qt-d20510dd91e01b15e2346c0cb12e352080b6a093.zip Qt-d20510dd91e01b15e2346c0cb12e352080b6a093.tar.gz Qt-d20510dd91e01b15e2346c0cb12e352080b6a093.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Conflicts:
src/plugins/bearer/corewlan/qcorewlanengine.mm
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmainwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qsplitter.cpp | 32 | ||||
-rw-r--r-- | src/gui/widgets/qsplitter.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbarlayout.cpp | 4 |
4 files changed, 38 insertions, 1 deletions
diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index d2eda80..44483ea 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1374,7 +1374,9 @@ bool QMainWindow::event(QEvent *event) #endif // QT_NO_STATUSTIP case QEvent::StyleChange: +#ifndef QT_NO_DOCKWIDGET d->layout->layoutState.dockAreaLayout.styleChangedEvent(); +#endif if (!d->explicitIconSize) setIconSize(QSize()); break; diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp index 597b28b..88b7517 100644 --- a/src/gui/widgets/qsplitter.cpp +++ b/src/gui/widgets/qsplitter.cpp @@ -227,6 +227,33 @@ QSize QSplitterHandle::sizeHint() const /*! \reimp */ +void QSplitterHandle::resizeEvent(QResizeEvent *event) +{ + Q_D(const QSplitterHandle); + + // When splitters are only 1 pixel large we increase the + // actual grab area to five pixels + + // Note that QSplitter uses contentsRect for layouting + // and ensures that handles are drawn on top of widgets + // We simply use the contents margins for draggin and only + // paint the mask area + bool useTinyMode = (d->s->handleWidth() == 1); + setAttribute(Qt::WA_MouseNoMask, useTinyMode); + if (useTinyMode) { + if (orientation() == Qt::Horizontal) + setContentsMargins(2, 0, 2, 0); + else + setContentsMargins(0, 2, 0, 2); + setMask(QRegion(contentsRect())); + } + + QWidget::resizeEvent(event); +} + +/*! + \reimp +*/ bool QSplitterHandle::event(QEvent *event) { Q_D(QSplitterHandle); @@ -301,7 +328,7 @@ void QSplitterHandle::paintEvent(QPaintEvent *) Q_D(QSplitterHandle); QPainter p(this); QStyleOption opt(0); - opt.rect = rect(); + opt.rect = contentsRect(); opt.palette = palette(); if (orientation() == Qt::Horizontal) opt.state = QStyle::State_Horizontal; @@ -1662,6 +1689,9 @@ void QSplitter::setSizes(const QList<int> &list) By default, this property contains a value that depends on the user's platform and style preferences. + + If you set handleWidth to 1, the actual grab area will grow to overlap a + few pixels of it's respective widgets. */ int QSplitter::handleWidth() const diff --git a/src/gui/widgets/qsplitter.h b/src/gui/widgets/qsplitter.h index a793f24..c3b304d 100644 --- a/src/gui/widgets/qsplitter.h +++ b/src/gui/widgets/qsplitter.h @@ -172,6 +172,7 @@ protected: void mouseMoveEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); + void resizeEvent(QResizeEvent *); bool event(QEvent *); void moveSplitter(int p); diff --git a/src/gui/widgets/qtoolbarlayout.cpp b/src/gui/widgets/qtoolbarlayout.cpp index 4eb252a..f87510f 100644 --- a/src/gui/widgets/qtoolbarlayout.cpp +++ b/src/gui/widgets/qtoolbarlayout.cpp @@ -654,7 +654,11 @@ void QToolBarLayout::setExpanded(bool exp) if (!tb) return; if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) { +#ifdef QT_NO_DOCKWIDGET + animating = false; +#else animating = !tb->isWindow() && win->isAnimated(); +#endif QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); if (expanded) { tb->raise(); |