-rw-r--r-- | korganizer/journalentry.cpp | 16 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 3 |
2 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 7f6f221..5269af7 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp @@ -135,2 +135,6 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) : mEditor->installEventFilter(this); + installEventFilter(this); + mTitle->installEventFilter(this); + setFocusPolicy (QWidget::NoFocus); + connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); @@ -313,3 +317,9 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) // kdDebug() << "JournalEntry::event received " << e->type() << endl; - + if ( isVisible() ) { + mEditor->setFocusPolicy (QWidget::StrongFocus); + mTitle->setFocusPolicy (QWidget::StrongFocus); + } else { + mEditor->setFocusPolicy (QWidget::NoFocus); + mTitle->setFocusPolicy (QWidget::NoFocus); + } if ( e->type() == QEvent::FocusOut ) { @@ -318,3 +328,5 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e ) if ( e->type() == QEvent::KeyPress ) { - QKeyEvent * k = (QKeyEvent *) e; + QKeyEvent * k = (QKeyEvent *) e; + if ( !isVisible() ) + return true; if ( k->state() == Qt::ControlButton ) { diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 4fc1194..b378330 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -1295,3 +1295,4 @@ KOListViewListView::KOListViewListView(KOListView * lv ) { - mYMousePos = 0; + mYMousePos = 0; + setAllColumnsShowFocus( true ); mPopupTimer = new QTimer(this); |