-rw-r--r-- | korganizer/kotodoview.cpp | 26 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
2 files changed, 17 insertions, 10 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 8d354c8..e2966f8 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -750,3 +750,2 @@ void KOTodoView::updateView() } - storeCurrentItem(); //qDebug("KOTodoView::updateView() %x", this); @@ -754,5 +753,5 @@ void KOTodoView::updateView() displayAllFlat(); - resetCurrentItem(); return; } + storeCurrentItem(); //qDebug("update "); @@ -837,3 +836,2 @@ void KOTodoView::updateView() resetCurrentItem(); - processSelectionChange(); } @@ -862,3 +860,3 @@ void KOTodoView::resetCurrentItem() { - mTodoListView->setFocus(); + //mTodoListView->setFocus(); KOTodoViewItem* foundItem = 0; @@ -898,8 +896,18 @@ void KOTodoView::resetCurrentItem() if ( foundItem ) { + mTodoListView->setSelected ( foundItem, true ); mTodoListView->setCurrentItem( foundItem ); mTodoListView->ensureItemVisible( foundItem ); - } else { - mTodoListView->setCurrentItem( mTodoListView->firstChild () ); + } else { + if ( mTodoListView->firstChild () ) { + mTodoListView->setSelected ( mTodoListView->firstChild (), true ); + mTodoListView->setCurrentItem( mTodoListView->firstChild () ); + } } } + processSelectionChange(); + QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); +} +void KOTodoView::resetFocusToList() +{ + topLevelWidget()->setActiveWindow(); mTodoListView->setFocus(); @@ -1406,2 +1414,3 @@ void KOTodoView::displayAllFlat() { + storeCurrentItem(); pendingSubtodo = 0; @@ -1420,4 +1429,3 @@ void KOTodoView::displayAllFlat() } - mTodoListView->setFocus(); - processSelectionChange(); + resetCurrentItem(); } @@ -1432,5 +1440,3 @@ void KOTodoView::setAllFlat() } - storeCurrentItem(); displayAllFlat(); - resetCurrentItem(); } diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 1b31d0d..9ae7f53 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -226,2 +226,3 @@ class KOTodoView : public KOrg::BaseView void itemDoubleClicked(QListViewItem *item); + void resetFocusToList(); |