author | zautrix <zautrix> | 2005-04-01 13:07:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-01 13:07:01 (UTC) |
commit | 93003b1f8348f112648d3cc20acb21b062220e21 (patch) (unidiff) | |
tree | 901bebe154a15f05296158db5da3689b849e8281 /microkde | |
parent | f8e027db1d950ec27a3c47fc2a5ea2fe49ae9772 (diff) | |
download | kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.zip kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.tar.gz kdepimpi-93003b1f8348f112648d3cc20acb21b062220e21.tar.bz2 |
fixes
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 32 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 2 |
2 files changed, 33 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 ) | |||
190 | } | 190 | } |
191 | } | 191 | } |
192 | if ( s->rubberBand() ) | ||
193 | s->rubberBand()->hide(); | ||
192 | repaint(); | 194 | repaint(); |
193 | } | 195 | } |
@@ -435,5 +437,4 @@ static QSize minSizeHint( const QWidget* w ) | |||
435 | 437 | ||
436 | 438 | ||
437 | |||
438 | /*! | 439 | /*! |
439 | Constructs a horizontal splitter with the \a parent and \a | 440 | Constructs a horizontal splitter with the \a parent and \a |
@@ -443,4 +444,5 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *n | |||
443 | :QFrame(parent,name,WPaintUnclipped) | 444 | :QFrame(parent,name,WPaintUnclipped) |
444 | { | 445 | { |
446 | mRubberBand = 0; | ||
445 | mFirstHandle = 0; | 447 | mFirstHandle = 0; |
446 | #if QT_VERSION >= 232 | 448 | #if QT_VERSION >= 232 |
@@ -457,4 +459,6 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent | |||
457 | :QFrame(parent,name,WPaintUnclipped) | 459 | :QFrame(parent,name,WPaintUnclipped) |
458 | { | 460 | { |
461 | |||
462 | mRubberBand = 0; | ||
459 | mFirstHandle = 0; | 463 | mFirstHandle = 0; |
460 | #if QT_VERSION >= 232 | 464 | #if QT_VERSION >= 232 |
@@ -473,4 +477,6 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() | |||
473 | delete data; | 477 | delete data; |
474 | #endif | 478 | #endif |
479 | if ( mRubberBand ) | ||
480 | delete mRubberBand; | ||
475 | } | 481 | } |
476 | 482 | ||
@@ -643,4 +649,5 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) | |||
643 | void KDGanttMinimizeSplitter::setRubberband( int p ) | 649 | void KDGanttMinimizeSplitter::setRubberband( int p ) |
644 | { | 650 | { |
651 | #ifdef DESKTOP_VERSION | ||
645 | QPainter paint( this ); | 652 | QPainter paint( this ); |
646 | paint.setPen( gray ); | 653 | paint.setPen( gray ); |
@@ -668,4 +675,27 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) | |||
668 | } | 675 | } |
669 | opaqueOldPos = p; | 676 | opaqueOldPos = p; |
677 | #else | ||
678 | if ( !mRubberBand ) { | ||
679 | mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); | ||
680 | mRubberBand->setFrameStyle( Box | Raised ); | ||
681 | mRubberBand->setPalette( QPalette ( Qt::green.light(),Qt::green.dark() ) ); | ||
682 | } | ||
683 | QRect r = contentsRect(); | ||
684 | const int rBord = 5; //Themable???? | ||
685 | int sw = style().splitterWidth(); | ||
686 | if ( orient == Horizontal ) { | ||
687 | if ( p >= 0 ) { | ||
688 | QPoint geo = mapToGlobal (QPoint ( p + sw/2 - rBord, r.y())); | ||
689 | mRubberBand->setGeometry( geo.x(), geo.y(), 2*rBord, r.height() ); | ||
690 | } | ||
691 | } else { | ||
692 | if ( p >= 0 ) { | ||
693 | QPoint geo = mapToGlobal (QPoint ( r.x(), p + sw/2 - rBord)); | ||
694 | mRubberBand->setGeometry( geo.x(), geo.y(), r.width(), 2*rBord); | ||
695 | } | ||
696 | } | ||
697 | opaqueOldPos = p; | ||
698 | mRubberBand->show(); | ||
699 | #endif | ||
670 | } | 700 | } |
671 | 701 | ||
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 84d3d8e..585298d 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h | |||
@@ -81,4 +81,5 @@ public: | |||
81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} | 81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} |
82 | void expandPos( int id, int* min, int* max ); | 82 | void expandPos( int id, int* min, int* max ); |
83 | QFrame* rubberBand() { return mRubberBand ;} | ||
83 | public slots: | 84 | public slots: |
84 | void toggle(); | 85 | void toggle(); |
@@ -100,4 +101,5 @@ protected: | |||
100 | 101 | ||
101 | private: | 102 | private: |
103 | QFrame* mRubberBand; | ||
102 | void init(); | 104 | void init(); |
103 | void recalc( bool update = FALSE ); | 105 | void recalc( bool update = FALSE ); |