Diffstat (limited to 'microkde/KDGanttMinimizeSplitter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index fb5d4e3..72c4e60 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp @@ -51,8 +51,9 @@ #include "qstyle.h" #include "qapplication.h" //sendPostedEvents #include <qvaluelist.h> #include <qcursor.h> +#include <qframe.h> #ifndef KDGANTT_MASTER_CVS //#include "KDGanttMinimizeSplitter.moc" #endif @@ -63,8 +64,20 @@ #if QT_VERSION >= 232 static int mouseOffset; static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky +class KDRubberBand: public QFrame +{ +public: + KDRubberBand( QWidget *parent, const char * name, WFlags f ) :QFrame ( parent, name, f ) {;} + +protected: + virtual void mousePressEvent ( QMouseEvent * ) + { + close(); + }; + +}; KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, KDGanttMinimizeSplitter *parent, const char * name ) : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) @@ -188,10 +201,12 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) s->setRubberband( -1 ); s->moveSplitter( pos, id() ); } } - if ( s->rubberBand() ) - s->rubberBand()->hide(); + if ( s->rubberBand() ) { + //qDebug("hide rubberband "); + s->rubberBand()->close(); + } repaint(); } int KDGanttSplitterHandle::onButton( const QPoint& p ) @@ -680,9 +695,9 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) } opaqueOldPos = p; #else if ( !mRubberBand ) { - mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); + mRubberBand = new KDRubberBand( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); mRubberBand->setFrameStyle( Box | Raised ); //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); } |