-rw-r--r-- | korganizer/komonthview.cpp | 2 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 21 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 5 |
3 files changed, 22 insertions, 6 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 7927307..8ee1363 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -769,9 +769,9 @@ int MonthViewCell::insertEvent(Event *event) | |||
769 | uint i; | 769 | uint i; |
770 | int pos = mdayCount; | 770 | int pos = mdayCount; |
771 | for ( i = mdayCount; i < count();++i ) { | 771 | for ( i = mdayCount; i < count();++i ) { |
772 | QListBoxItem* it = this->item ( i ); | 772 | QListBoxItem* it = this->item ( i ); |
773 | if ( text < it->text() ) { | 773 | if ( it && text < it->text() ) { |
774 | pos = i; | 774 | pos = i; |
775 | break; | 775 | break; |
776 | } | 776 | } |
777 | ++pos; | 777 | ++pos; |
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 @@ | |||
51 | #include "qstyle.h" | 51 | #include "qstyle.h" |
52 | #include "qapplication.h" //sendPostedEvents | 52 | #include "qapplication.h" //sendPostedEvents |
53 | #include <qvaluelist.h> | 53 | #include <qvaluelist.h> |
54 | #include <qcursor.h> | 54 | #include <qcursor.h> |
55 | #include <qframe.h> | ||
55 | #ifndef KDGANTT_MASTER_CVS | 56 | #ifndef KDGANTT_MASTER_CVS |
56 | //#include "KDGanttMinimizeSplitter.moc" | 57 | //#include "KDGanttMinimizeSplitter.moc" |
57 | #endif | 58 | #endif |
58 | 59 | ||
@@ -63,8 +64,20 @@ | |||
63 | #if QT_VERSION >= 232 | 64 | #if QT_VERSION >= 232 |
64 | static int mouseOffset; | 65 | static int mouseOffset; |
65 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky | 66 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky |
66 | 67 | ||
68 | class KDRubberBand: public QFrame | ||
69 | { | ||
70 | public: | ||
71 | KDRubberBand( QWidget *parent, const char * name, WFlags f ) :QFrame ( parent, name, f ) {;} | ||
72 | |||
73 | protected: | ||
74 | virtual void mousePressEvent ( QMouseEvent * ) | ||
75 | { | ||
76 | close(); | ||
77 | }; | ||
78 | |||
79 | }; | ||
67 | 80 | ||
68 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, | 81 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, |
69 | KDGanttMinimizeSplitter *parent, const char * name ) | 82 | KDGanttMinimizeSplitter *parent, const char * name ) |
70 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) | 83 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) |
@@ -188,10 +201,12 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) | |||
188 | s->setRubberband( -1 ); | 201 | s->setRubberband( -1 ); |
189 | s->moveSplitter( pos, id() ); | 202 | s->moveSplitter( pos, id() ); |
190 | } | 203 | } |
191 | } | 204 | } |
192 | if ( s->rubberBand() ) | 205 | if ( s->rubberBand() ) { |
193 | s->rubberBand()->hide(); | 206 | //qDebug("hide rubberband "); |
207 | s->rubberBand()->close(); | ||
208 | } | ||
194 | repaint(); | 209 | repaint(); |
195 | } | 210 | } |
196 | 211 | ||
197 | int KDGanttSplitterHandle::onButton( const QPoint& p ) | 212 | int KDGanttSplitterHandle::onButton( const QPoint& p ) |
@@ -680,9 +695,9 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) | |||
680 | } | 695 | } |
681 | opaqueOldPos = p; | 696 | opaqueOldPos = p; |
682 | #else | 697 | #else |
683 | if ( !mRubberBand ) { | 698 | if ( !mRubberBand ) { |
684 | mRubberBand = new QFrame( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); | 699 | mRubberBand = new KDRubberBand( 0, "rubber", WStyle_NoBorder | WStyle_Customize | WStyle_StaysOnTop); |
685 | mRubberBand->setFrameStyle( Box | Raised ); | 700 | mRubberBand->setFrameStyle( Box | Raised ); |
686 | //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); | 701 | //mRubberBand->setPalette( QPalette ( Qt::red.light(),Qt::red.dark() ) ); |
687 | mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); | 702 | mRubberBand->setPalette( QPalette ( colorGroup().background().light(), colorGroup().background().dark() )); |
688 | } | 703 | } |
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 585298d..3042e0a 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h | |||
@@ -42,8 +42,9 @@ | |||
42 | #ifndef QT_NO_SPLITTER___ | 42 | #ifndef QT_NO_SPLITTER___ |
43 | class QSplitterData; | 43 | class QSplitterData; |
44 | class QSplitterLayoutStruct; | 44 | class QSplitterLayoutStruct; |
45 | class KDGanttSplitterHandle; | 45 | class KDGanttSplitterHandle; |
46 | class KDRubberBand; | ||
46 | class KDGanttMinimizeSplitter : public QFrame | 47 | class KDGanttMinimizeSplitter : public QFrame |
47 | { | 48 | { |
48 | Q_OBJECT | 49 | Q_OBJECT |
49 | // Q_ENUMS( Direction ) | 50 | // Q_ENUMS( Direction ) |
@@ -79,9 +80,9 @@ public: | |||
79 | QValueList<int> sizes() const; | 80 | QValueList<int> sizes() const; |
80 | void setSizes( QValueList<int> ); | 81 | void setSizes( QValueList<int> ); |
81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} | 82 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} |
82 | void expandPos( int id, int* min, int* max ); | 83 | void expandPos( int id, int* min, int* max ); |
83 | QFrame* rubberBand() { return mRubberBand ;} | 84 | KDRubberBand* rubberBand() { return mRubberBand ;} |
84 | public slots: | 85 | public slots: |
85 | void toggle(); | 86 | void toggle(); |
86 | protected: | 87 | protected: |
87 | void childEvent( QChildEvent * ); | 88 | void childEvent( QChildEvent * ); |
@@ -99,9 +100,9 @@ protected: | |||
99 | virtual void setRubberband( int ); | 100 | virtual void setRubberband( int ); |
100 | void getRange( int id, int*, int* ); | 101 | void getRange( int id, int*, int* ); |
101 | 102 | ||
102 | private: | 103 | private: |
103 | QFrame* mRubberBand; | 104 | KDRubberBand* mRubberBand; |
104 | void init(); | 105 | void init(); |
105 | void recalc( bool update = FALSE ); | 106 | void recalc( bool update = FALSE ); |
106 | void doResize(); | 107 | void doResize(); |
107 | void storeSizes(); | 108 | void storeSizes(); |