summaryrefslogtreecommitdiffabout
path: root/microkde/KDGanttMinimizeSplitter.cpp
authorzautrix <zautrix>2005-03-26 11:15:27 (UTC)
committer zautrix <zautrix>2005-03-26 11:15:27 (UTC)
commitbc8929ccca1ad8cd04f61366c78254803d9c1565 (patch) (unidiff)
tree9a99b7e9cefa3c32f90e494afb7e324c59cb8584 /microkde/KDGanttMinimizeSplitter.cpp
parentef825f1805452ba2cfb30cd7a41c392d3961f01e (diff)
downloadkdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.zip
kdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.tar.gz
kdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.tar.bz2
nf
Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp14
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,
77 mSizeHint = QSize(6,6); 77 mSizeHint = QSize(6,6);
78 mUseOffset = false; 78 mUseOffset = false;
79 } 79 }
80 s = parent; 80 s = parent;
81 setOrientation(o); 81 setOrientation(o);
82 setMouseTracking( true ); 82 setMouseTracking( true );
83 mMouseDown = false;
83 //setMaximumHeight( 5 ); // test only 84 //setMaximumHeight( 5 ); // test only
84} 85}
85 86
86QSize KDGanttSplitterHandle::sizeHint() const 87QSize KDGanttSplitterHandle::sizeHint() const
87{ 88{
88 return mSizeHint; 89 return mSizeHint;
@@ -123,14 +124,14 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e )
123 124
124void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) 125void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e )
125{ 126{
126 if ( e->button() == LeftButton ) { 127 if ( e->button() == LeftButton ) {
127 _activeButton = onButton( e->pos() ); 128 _activeButton = onButton( e->pos() );
128 mouseOffset = s->pick(e->pos()); 129 mouseOffset = s->pick(e->pos());
129 if ( _activeButton != 0) 130 mMouseDown = true;
130 repaint(); 131 repaint();
131 updateCursor( e->pos() ); 132 updateCursor( e->pos() );
132 } 133 }
133} 134}
134 135
135void KDGanttSplitterHandle::updateCursor( const QPoint& p) 136void KDGanttSplitterHandle::updateCursor( const QPoint& p)
136{ 137{
@@ -168,12 +169,13 @@ void KDGanttSplitterHandle::toggle()
168 } 169 }
169 repaint(); 170 repaint();
170} 171}
171 172
172void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) 173void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
173{ 174{
175 mMouseDown = false;
174 if ( _activeButton != 0 ) { 176 if ( _activeButton != 0 ) {
175 if ( onButton( e->pos() ) == _activeButton ) 177 if ( onButton( e->pos() ) == _activeButton )
176 { 178 {
177 toggle(); 179 toggle();
178 } 180 }
179 _activeButton = 0; 181 _activeButton = 0;
@@ -274,14 +276,18 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * )
274 int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size 276 int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size
275 277
276 // arrow color 278 // arrow color
277 QColor col; 279 QColor col;
278 if ( _activeButton ) 280 if ( _activeButton )
279 col = colorGroup().background().dark( 250 ); 281 col = colorGroup().background().dark( 250 );
280 else 282 else {
281 col = colorGroup().background().dark( 150 ); 283 if ( mMouseDown )
284 col = Qt::white;
285 else
286 col = colorGroup().background().dark( 150 );
287 }
282 //QColor col = backgroundColor().dark( 130 ); 288 //QColor col = backgroundColor().dark( 130 );
283 p.setBrush( col ); 289 p.setBrush( col );
284 p.setPen( col ); 290 p.setPen( col );
285 291
286 QValueList<QPointArray> list = buttonRegions(); 292 QValueList<QPointArray> list = buttonRegions();
287 int index = 1; 293 int index = 1;