-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 @@ -115,7 +115,10 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) scrollBy(-4,0); break; case Key_Up: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+count()-1)%count()); if(!itemVisible(currentItem())) { if((unsigned int) currentItem() == (count()-1)) { @@ -126,7 +129,10 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) } break; case Key_Down: - if(!count()) break; + if(count() < 2) { + e->ignore(); + break; + } setCurrentItem((currentItem()+1)%count()); if(!itemVisible(currentItem())) { if(currentItem() == 0) { @@ -949,6 +955,7 @@ void KOMonthView::changeEventDisplay(Event *, int) void KOMonthView::updateView() { + if ( !updatePossible ) return; //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "); @@ -960,6 +967,7 @@ void KOMonthView::updateView() //qDebug("KOMonthView::updateView() "); processSelectionChange(); // qDebug("---------------------------------------------------------------------+ "); + setFocus(); } void KOMonthView::resizeEvent(QResizeEvent * e) @@ -1123,7 +1131,24 @@ void KOMonthView::clearSelection() } 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; + } } |