Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 84edc0d..c60b566 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -77,12 +77,13 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, mSizeHint = QSize(6,6); mUseOffset = false; } s = parent; setOrientation(o); setMouseTracking( true ); + mMouseDown = false; //setMaximumHeight( 5 ); // test only } QSize KDGanttSplitterHandle::sizeHint() const { return mSizeHint; @@ -123,14 +124,14 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) { if ( e->button() == LeftButton ) { _activeButton = onButton( e->pos() ); mouseOffset = s->pick(e->pos()); - if ( _activeButton != 0) - repaint(); + mMouseDown = true; + repaint(); updateCursor( e->pos() ); } } void KDGanttSplitterHandle::updateCursor( const QPoint& p) { @@ -168,12 +169,13 @@ void KDGanttSplitterHandle::toggle() } repaint(); } void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) { + mMouseDown = false; if ( _activeButton != 0 ) { if ( onButton( e->pos() ) == _activeButton ) { toggle(); } _activeButton = 0; @@ -274,14 +276,18 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size // arrow color QColor col; if ( _activeButton ) col = colorGroup().background().dark( 250 ); - else - col = colorGroup().background().dark( 150 ); + else { + if ( mMouseDown ) + col = Qt::white; + else + col = colorGroup().background().dark( 150 ); + } //QColor col = backgroundColor().dark( 130 ); p.setBrush( col ); p.setPen( col ); QValueList<QPointArray> list = buttonRegions(); int index = 1; |