summaryrefslogtreecommitdiffabout
path: root/microkde
authorzautrix <zautrix>2005-04-21 12:32:52 (UTC)
committer zautrix <zautrix>2005-04-21 12:32:52 (UTC)
commit0a13a3490ec3bf4735e3435f80f58fa7d50b4448 (patch) (side-by-side diff)
treec7f28c49b52e479f47da0dce9f0bfe9189ecdca4 /microkde
parent4d96d7b681ce99d76746a843c289b75f5e7dba64 (diff)
downloadkdepimpi-0a13a3490ec3bf4735e3435f80f58fa7d50b4448.zip
kdepimpi-0a13a3490ec3bf4735e3435f80f58fa7d50b4448.tar.gz
kdepimpi-0a13a3490ec3bf4735e3435f80f58fa7d50b4448.tar.bz2
rubberband fix
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp21
-rw-r--r--microkde/KDGanttMinimizeSplitter.h5
2 files changed, 21 insertions, 5 deletions
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index fb5d4e3..72c4e60 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -52,6 +52,7 @@
#include "qapplication.h" //sendPostedEvents
#include <qvaluelist.h>
#include <qcursor.h>
+#include <qframe.h>
#ifndef KDGANTT_MASTER_CVS
//#include "KDGanttMinimizeSplitter.moc"
#endif
@@ -64,6 +65,18 @@
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 )
@@ -189,8 +202,10 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e )
s->moveSplitter( pos, id() );
}
}
- if ( s->rubberBand() )
- s->rubberBand()->hide();
+ if ( s->rubberBand() ) {
+ //qDebug("hide rubberband ");
+ s->rubberBand()->close();
+ }
repaint();
}
@@ -681,7 +696,7 @@ 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() ));
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h
index 585298d..3042e0a 100644
--- a/microkde/KDGanttMinimizeSplitter.h
+++ b/microkde/KDGanttMinimizeSplitter.h
@@ -43,6 +43,7 @@
class QSplitterData;
class QSplitterLayoutStruct;
class KDGanttSplitterHandle;
+class KDRubberBand;
class KDGanttMinimizeSplitter : public QFrame
{
Q_OBJECT
@@ -80,7 +81,7 @@ public:
void setSizes( QValueList<int> );
KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;}
void expandPos( int id, int* min, int* max );
- QFrame* rubberBand() { return mRubberBand ;}
+ KDRubberBand* rubberBand() { return mRubberBand ;}
public slots:
void toggle();
protected:
@@ -100,7 +101,7 @@ protected:
void getRange( int id, int*, int* );
private:
- QFrame* mRubberBand;
+ KDRubberBand* mRubberBand;
void init();
void recalc( bool update = FALSE );
void doResize();