summaryrefslogtreecommitdiffabout
path: root/microkde/KDGanttMinimizeSplitter.cpp
Unidiff
Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index ea3a329..d675517 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -669,42 +669,50 @@ void KDGanttMinimizeSplitter::setRubberband( int p )
669 } else { 669 } else {
670 if ( opaqueOldPos >= 0 ) 670 if ( opaqueOldPos >= 0 )
671 paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, 671 paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord,
672 r.width(), 2*rBord ); 672 r.width(), 2*rBord );
673 if ( p >= 0 ) 673 if ( p >= 0 )
674 paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); 674 paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );
675 } 675 }
676 opaqueOldPos = p; 676 opaqueOldPos = p;
677#else 677#else
678 if ( !mRubberBand ) { 678 if ( !mRubberBand ) {
679 mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); 679 mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop);
680 mRubberBand->setFrameStyle( Box | Raised ); 680 mRubberBand->setFrameStyle( Box | Raised );
681 mRubberBand->setPalette( QPalette ( Qt::green.light(),Qt::green.dark() ) ); 681 mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) );
682 } 682 }
683 QRect r = contentsRect(); 683 QRect r = contentsRect();
684 const int rBord = 5; //Themable???? 684 static int rBord = 0; //Themable????
685 if ( !rBord ) {
686 if (QApplication::desktop()->width() <= 320 )
687 rBord = 4;
688 else
689 rBord = 5;
690 }
685 int sw = style().splitterWidth(); 691 int sw = style().splitterWidth();
686 if ( orient == Horizontal ) { 692 if ( orient == Horizontal ) {
687 if ( p >= 0 ) { 693 if ( p >= 0 ) {
688 QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y())); 694 QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y()));
689 mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() ); 695 mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() );
690 } 696 }
691 } else { 697 } else {
692 if ( p >= 0 ) { 698 if ( p >= 0 ) {
693 QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord)); 699 QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord));
694 mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord); 700 mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord);
695 } 701 }
696 } 702 }
697 opaqueOldPos = p; 703 opaqueOldPos = p;
698 mRubberBand->show(); 704 if ( ! mRubberBand->isVisible() ) {
705 mRubberBand->show();
706 }
699#endif 707#endif
700} 708}
701 709
702 710
703/*! \reimp */ 711/*! \reimp */
704bool KDGanttMinimizeSplitter::event( QEvent *e ) 712bool KDGanttMinimizeSplitter::event( QEvent *e )
705{ 713{
706 if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { 714 if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) {
707 recalc( isVisible() ); 715 recalc( isVisible() );
708 if ( e->type() == QEvent::Show ) 716 if ( e->type() == QEvent::Show )
709 data->firstShow = FALSE; 717 data->firstShow = FALSE;
710 } 718 }