Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 029f14b..ea3a329 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -190,4 +190,6 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) } } + if ( s->rubberBand() ) + s->rubberBand()->hide(); repaint(); } @@ -435,5 +437,4 @@ static QSize minSizeHint( const QWidget* w ) - /*! Constructs a horizontal splitter with the \a parent and \a @@ -443,4 +444,5 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n :QFrame(parent,name,WPaintUnclipped) { + mRubberBand = 0; mFirstHandle = 0; #if QT_VERSION >= 232 @@ -457,4 +459,6 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent :QFrame(parent,name,WPaintUnclipped) { + + mRubberBand = 0; mFirstHandle = 0; #if QT_VERSION >= 232 @@ -473,4 +477,6 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() delete data; #endif + if ( mRubberBand ) + delete mRubberBand; } @@ -643,4 +649,5 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) void KDGanttMinimizeSplitter::setRubberband( int p ) { +#ifdef DESKTOP_VERSION QPainter paint( this ); paint.setPen( gray ); @@ -668,4 +675,27 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) } opaqueOldPos = p; +#else + if ( !mRubberBand ) { + mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); + mRubberBand->setFrameStyle( Box | Raised ); + mRubberBand->setPalette( QPalette ( Qt::green.light(),Qt::green.dark() ) ); + } + QRect r = contentsRect(); + const int rBord = 5; //Themable???? + 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; + mRubberBand->show(); +#endif } |