summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-26 11:15:27 (UTC)
committer zautrix <zautrix>2005-03-26 11:15:27 (UTC)
commitbc8929ccca1ad8cd04f61366c78254803d9c1565 (patch) (side-by-side diff)
tree9a99b7e9cefa3c32f90e494afb7e324c59cb8584
parentef825f1805452ba2cfb30cd7a41c392d3961f01e (diff)
downloadkdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.zip
kdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.tar.gz
kdepimpi-bc8929ccca1ad8cd04f61366c78254803d9c1565.tar.bz2
nf
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp8
-rw-r--r--microkde/KDGanttMinimizeSplitter.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 84edc0d..c60b566 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -75,16 +75,17 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o,
mUseOffset = true;
} else {
mSizeHint = QSize(6,6);
mUseOffset = false;
}
s = parent;
setOrientation(o);
setMouseTracking( true );
+ mMouseDown = false;
//setMaximumHeight( 5 ); // test only
}
QSize KDGanttSplitterHandle::sizeHint() const
{
return mSizeHint;
}
@@ -121,17 +122,17 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e )
_collapsed = false;
}
void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e )
{
if ( e->button() == LeftButton ) {
_activeButton = onButton( e->pos() );
mouseOffset = s->pick(e->pos());
- if ( _activeButton != 0)
+ mMouseDown = true;
repaint();
updateCursor( e->pos() );
}
}
void KDGanttSplitterHandle::updateCursor( const QPoint& p)
{
if ( onButton( p ) != 0 ) {
@@ -166,16 +167,17 @@ void KDGanttSplitterHandle::toggle()
s->moveSplitter( _origPos, id() );
_collapsed = false;
}
repaint();
}
void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
{
+ mMouseDown = false;
if ( _activeButton != 0 ) {
if ( onButton( e->pos() ) == _activeButton )
{
toggle();
}
_activeButton = 0;
updateCursor( e->pos() );
}
@@ -272,18 +274,22 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * )
// parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup());
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 {
+ 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;
if ( mUseOffset )
p.translate( 0, 1 );
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h
index 8120d14..84d3d8e 100644
--- a/microkde/KDGanttMinimizeSplitter.h
+++ b/microkde/KDGanttMinimizeSplitter.h
@@ -164,16 +164,17 @@ protected:
void paintEvent( QPaintEvent * );
void mouseMoveEvent( QMouseEvent * );
void mousePressEvent( QMouseEvent * );
void mouseReleaseEvent( QMouseEvent * );
int onButton( const QPoint& p );
void updateCursor( const QPoint& p );
private:
+ bool mMouseDown;
QSize mSizeHint;
bool mUseOffset;
Qt::Orientation orient;
bool opaq;
int myId;
KDGanttMinimizeSplitter *s;
int _activeButton;