-rw-r--r-- | korganizer/komonthview.cpp | 12 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4aeb20c..8d06040 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -81,8 +81,9 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) | |||
81 | { | 81 | { |
82 | #ifndef DESKTOP_VERSION | 82 | #ifndef DESKTOP_VERSION |
83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 83 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
84 | #endif | 84 | #endif |
85 | mBlockDeselect = false; | ||
85 | mWT = new KNOWhatsThis(this); | 86 | mWT = new KNOWhatsThis(this); |
86 | resetOnFocusIn = true; | 87 | resetOnFocusIn = true; |
87 | setVScrollBarMode(QScrollView::AlwaysOff); | 88 | setVScrollBarMode(QScrollView::AlwaysOff); |
88 | setHScrollBarMode(QScrollView::AlwaysOff); | 89 | setHScrollBarMode(QScrollView::AlwaysOff); |
@@ -134,16 +135,20 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) | |||
134 | } | 135 | } |
135 | } | 136 | } |
136 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) | 137 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) |
137 | { | 138 | { |
139 | if ( ! mBlockDeselect ) { | ||
138 | int i = currentItem (); | 140 | int i = currentItem (); |
139 | if ( i >= 0 ) { | 141 | if ( i >= 0 ) { |
140 | setSelected ( i, false ); | 142 | setSelected ( i, false ); |
141 | } | 143 | } |
142 | QListBox::focusOutEvent ( e ); | 144 | QListBox::focusOutEvent ( e ); |
145 | } | ||
143 | setVScrollBarMode(QScrollView::AlwaysOff); | 146 | setVScrollBarMode(QScrollView::AlwaysOff); |
144 | setHScrollBarMode(QScrollView::AlwaysOff); | 147 | setHScrollBarMode(QScrollView::AlwaysOff); |
145 | emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); | 148 | if ( ! mBlockDeselect ) |
149 | emit highlightIncidence( 0, (MonthViewCell*)this, 0 ); | ||
150 | mBlockDeselect = false; | ||
146 | } | 151 | } |
147 | 152 | ||
148 | QString KNoScrollListBox::getWhatsThisText(QPoint p) | 153 | QString KNoScrollListBox::getWhatsThisText(QPoint p) |
149 | { | 154 | { |
@@ -1109,11 +1114,10 @@ void MonthViewCell::contextMenu( QListBoxItem *item ) | |||
1109 | //qApp->processEvents(); | 1114 | //qApp->processEvents(); |
1110 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 1115 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
1111 | Incidence *incidence = eventItem->incidence(); | 1116 | Incidence *incidence = eventItem->incidence(); |
1112 | if ( incidence ) { | 1117 | if ( incidence ) { |
1118 | mBlockDeselect = true; | ||
1113 | mMonthView->showContextMenu( incidence ); | 1119 | mMonthView->showContextMenu( incidence ); |
1114 | selection( item ); | ||
1115 | doHighLight( incidence ); | ||
1116 | } | 1120 | } |
1117 | } | 1121 | } |
1118 | 1122 | ||
1119 | void MonthViewCell::selection( QListBoxItem *item ) | 1123 | void MonthViewCell::selection( QListBoxItem *item ) |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index 61a141a..1a9d16d 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -86,9 +86,10 @@ class KNoScrollListBox: public QListBox | |||
86 | void rightClick(); | 86 | void rightClick(); |
87 | void nextCell(); | 87 | void nextCell(); |
88 | void prevCell(); | 88 | void prevCell(); |
89 | void highlightIncidence( Incidence * , MonthViewCell*, int ); | 89 | void highlightIncidence( Incidence * , MonthViewCell*, int ); |
90 | 90 | protected: | |
91 | bool mBlockDeselect; | ||
91 | protected slots: | 92 | protected slots: |
92 | void oneDown(); | 93 | void oneDown(); |
93 | void keyPressEvent(QKeyEvent *); | 94 | void keyPressEvent(QKeyEvent *); |
94 | void keyReleaseEvent(QKeyEvent *); | 95 | void keyReleaseEvent(QKeyEvent *); |