summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/journalentry.cpp16
-rw-r--r--korganizer/kolistview.cpp3
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
@@ -133,6 +133,10 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
topLayout->addWidget(vb);
topLayout->addWidget(mEditor);
mEditor->installEventFilter(this);
+ installEventFilter(this);
+ mTitle->installEventFilter(this);
+ setFocusPolicy (QWidget::NoFocus);
+
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
connect( toggleJournal, SIGNAL( clicked() ), this , SLOT( toggleShowJournal() ) );
@@ -311,12 +315,20 @@ void JournalEntry::clear()
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 ) {
writeJournal();
}
if ( e->type() == QEvent::KeyPress ) {
- QKeyEvent * k = (QKeyEvent *) e;
+ QKeyEvent * k = (QKeyEvent *) e;
+ if ( !isVisible() )
+ return true;
if ( k->state() == Qt::ControlButton ) {
k->ignore();
//return true;
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 4fc1194..b378330 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1293,7 +1293,8 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
KOListViewListView::KOListViewListView(KOListView * lv )
: KListView( lv, "kolistlistview", false )
{
- mYMousePos = 0;
+ mYMousePos = 0;
+ setAllColumnsShowFocus( true );
mPopupTimer = new QTimer(this);
connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
#ifndef DESKTOP_VERSION