-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 14 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 1 |
2 files changed, 11 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 @@ -79,8 +79,9 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, } s = parent; setOrientation(o); setMouseTracking( true ); + mMouseDown = false; //setMaximumHeight( 5 ); // test only } QSize KDGanttSplitterHandle::sizeHint() const @@ -125,10 +126,10 @@ 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() ); } } @@ -170,8 +171,9 @@ void KDGanttSplitterHandle::toggle() } void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) { + mMouseDown = false; if ( _activeButton != 0 ) { if ( onButton( e->pos() ) == _activeButton ) { toggle(); @@ -276,10 +278,14 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) // 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 ); diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 8120d14..84d3d8e 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h @@ -168,8 +168,9 @@ protected: int onButton( const QPoint& p ); void updateCursor( const QPoint& p ); private: + bool mMouseDown; QSize mSizeHint; bool mUseOffset; Qt::Orientation orient; bool opaq; |