summaryrefslogtreecommitdiffabout
path: root/microkde/KDGanttMinimizeSplitter.cpp
Side-by-side diff
Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index 253175e..2a30346 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -244,84 +244,80 @@ QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions()
_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down) {
int mid = width()/2 + voffset[i];
arr.setPoints( 3,
mid - sw + 4, sw-4,
mid, 0,
mid + sw - 4, sw-4 );
}
else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down ||
_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) {
int mid = width()/2 + voffset[i];
arr.setPoints( 3,
mid - sw + 4, 1-yyy,
mid, sw-3-yyy,
mid + sw -4, 1-yyy);
}
list.append( arr );
}
return list;
}
void KDGanttSplitterHandle::paintEvent( QPaintEvent * )
{
QPixmap buffer( size() );
QPainter p( &buffer );
//LR
// Draw the splitter rectangle
p.setBrush( colorGroup().background() );
p.setPen( colorGroup().foreground() );
//p.drawRect( rect() );
#ifndef DESKTOP_VERSION
if ( mMouseDown )
- buffer.fill( QColor( 242,27,255 ) );
+ buffer.fill( colorGroup().background().dark() );
else
#endif
buffer.fill( colorGroup().background() );
//buffer.fill( backgroundColor() );
// 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 )
-#ifndef DESKTOP_VERSION
- col = QColor( 178,18,188);//QColor( 242,27,255 );//Qt::white;
-#else
- col = Qt::white;
-#endif
+ 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 );
for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) {
if ( index == _activeButton ) {
/*
if ( ! _collapsed ) {
p.save();
// p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ),
// parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) );
p.translate( -1, 0 );
p.drawPolygon( *it, true );
p.restore(); } else
*/
p.drawPolygon( *it, true );
}
else {
/*
if ( ! _collapsed ) {
p.save();
p.translate( -1, 0 );
p.drawPolygon( *it, true );
@@ -659,65 +655,65 @@ void KDGanttMinimizeSplitter::setRubberband( int p )
{
#ifdef DESKTOP_VERSION
QPainter paint( this );
paint.setPen( gray );
paint.setBrush( gray );
paint.setRasterOp( XorROP );
QRect r = contentsRect();
const int rBord = 3; //Themable????
#if QT_VERSION >= 0x030000
int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this);
#else
int sw = style().splitterWidth();
#endif
if ( orient == Horizontal ) {
if ( opaqueOldPos >= 0 )
paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(),
2*rBord, r.height() );
if ( p >= 0 )
paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() );
} else {
if ( opaqueOldPos >= 0 )
paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord,
r.width(), 2*rBord );
if ( p >= 0 )
paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
}
opaqueOldPos = p;
#else
if ( !mRubberBand ) {
mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop);
mRubberBand->setFrameStyle( Box | Raised );
//mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) );
- mRubberBand->setPalette( QPalette ( QColor( 178,18,188), QColor( 242,27,255 ) ));
+ mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() ));
}
QRect r = contentsRect();
static int rBord = 0; //Themable????
if ( !rBord ) {
if (QApplication::desktop()->width() <= 320 )
rBord = 3;
else
rBord = 4;
}
int sw = style().splitterWidth();
if ( orient == Horizontal ) {
if ( p >= 0 ) {
QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y()));
mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() );
}
} else {
if ( p >= 0 ) {
QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord));
mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord);
}
}
opaqueOldPos = p;
if ( ! mRubberBand->isVisible() ) {
mRubberBand->show();
}
#endif
}
/*! \reimp */
bool KDGanttMinimizeSplitter::event( QEvent *e )
{