summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index d825493..940d288 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -103,95 +103,101 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
103{ 103{
104 104
105 switch(e->key()) { 105 switch(e->key()) {
106 case Key_Right: 106 case Key_Right:
107 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 107 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
108 { 108 {
109 e->ignore(); 109 e->ignore();
110 return; 110 return;
111 } 111 }
112 scrollBy(10,0); 112 scrollBy(10,0);
113 break; 113 break;
114 case Key_Left: 114 case Key_Left:
115 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 115 if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
116 { 116 {
117 e->ignore(); 117 e->ignore();
118 return; 118 return;
119 } 119 }
120 scrollBy(-10,0); 120 scrollBy(-10,0);
121 break; 121 break;
122 case Key_Up: 122 case Key_Up:
123 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 123 if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
124 e->ignore(); 124 e->ignore();
125 break; 125 break;
126 } 126 }
127 if ( count() ) {
127 setCurrentItem((currentItem()+count()-1)%count()); 128 setCurrentItem((currentItem()+count()-1)%count());
128 if(!itemVisible(currentItem())) { 129 if(!itemVisible(currentItem())) {
129 if((unsigned int) currentItem() == (count()-1)) { 130 if((unsigned int) currentItem() == (count()-1)) {
130 setTopItem(currentItem()-numItemsVisible()+1); 131 setTopItem(currentItem()-numItemsVisible()+1);
131 } else { 132 } else {
132 setTopItem(topItem()-1); 133 setTopItem(topItem()-1);
133 } 134 }
134 } 135 }
136 }
135 break; 137 break;
136 case Key_Down: 138 case Key_Down:
137 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 139 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
138 e->ignore(); 140 e->ignore();
139 break; 141 break;
140 } 142 }
143 if ( count () ) {
141 setCurrentItem((currentItem()+1)%count()); 144 setCurrentItem((currentItem()+1)%count());
142 if(!itemVisible(currentItem())) { 145 if(!itemVisible(currentItem())) {
143 if(currentItem() == 0) { 146 if(currentItem() == 0) {
144 setTopItem(0); 147 setTopItem(0);
145 } else { 148 } else {
146 setTopItem(topItem()+1); 149 setTopItem(topItem()+1);
147 } 150 }
148 } 151 }
152 }
149 break; 153 break;
150 case Key_I: 154 case Key_I:
151 QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); 155 QTimer::singleShot( 11, this, SLOT ( oneDown() ) );
152 e->ignore(); 156 e->ignore();
153 break; 157 break;
154 case Key_Shift: 158 case Key_Shift:
155 emit shiftDown(); 159 emit shiftDown();
156 break; 160 break;
157 default: 161 default:
158 e->ignore(); 162 e->ignore();
159 break; 163 break;
160 } 164 }
161} 165}
162 166
163void KNoScrollListBox::oneDown() 167void KNoScrollListBox::oneDown()
164{ 168{
169 if ( count () ) {
165 setCurrentItem((currentItem()+1)%count()); 170 setCurrentItem((currentItem()+1)%count());
166 if(!itemVisible(currentItem())) { 171 if(!itemVisible(currentItem())) {
167 if(currentItem() == 0) { 172 if(currentItem() == 0) {
168 setTopItem(0); 173 setTopItem(0);
169 } else { 174 } else {
170 setTopItem(topItem()+1); 175 setTopItem(topItem()+1);
171 } 176 }
172 } 177 }
173} 178}
179}
174void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 180void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
175{ 181{
176 switch(e->key()) { 182 switch(e->key()) {
177 case Key_Shift: 183 case Key_Shift:
178 emit shiftUp(); 184 emit shiftUp();
179 break; 185 break;
180 default: 186 default:
181 break; 187 break;
182 } 188 }
183} 189}
184 190
185void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 191void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
186{ 192{
187 QListBox::mousePressEvent(e); 193 QListBox::mousePressEvent(e);
188 194
189 if(e->button() == RightButton) { 195 if(e->button() == RightButton) {
190 emit rightClick(); 196 emit rightClick();
191 } 197 }
192} 198}
193 199
194MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) 200MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
195 : QListBoxItem() 201 : QListBoxItem()
196{ 202{
197 mblockRepaint = true; 203 mblockRepaint = true;