-rw-r--r-- | korganizer/komonthview.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 437debe..10e4f1d 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -117,3 +117,6 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) case Key_Up: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+count()-1)%count()); @@ -128,3 +131,6 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) case Key_Down: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+1)%count()); @@ -951,2 +957,3 @@ void KOMonthView::updateView() { + if ( !updatePossible ) @@ -962,2 +969,3 @@ void KOMonthView::updateView() // qDebug("---------------------------------------------------------------------+ "); + setFocus(); } @@ -1125,5 +1133,22 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) { - + switch(e->key()) { + break; + case Key_Up: + { + emit prevMonth(); + setFocus(); + } + e->accept(); + break; + case Key_Down: + { + emit nextMonth(); + setFocus(); + } + e->accept(); + break; + default: e->ignore(); - + break; + } } |