author | zautrix <zautrix> | 2005-04-05 19:42:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-05 19:42:46 (UTC) |
commit | 6add774cf9841377f32613c7aa23161a823aa1da (patch) (unidiff) | |
tree | 43631d25bdfff4eb9d9934bc604609c38717b000 /korganizer/komonthview.cpp | |
parent | 8734ae4789ed411cb546edd304816a77c431a2bf (diff) | |
download | kdepimpi-6add774cf9841377f32613c7aa23161a823aa1da.zip kdepimpi-6add774cf9841377f32613c7aa23161a823aa1da.tar.gz kdepimpi-6add774cf9841377f32613c7aa23161a823aa1da.tar.bz2 |
fix
-rw-r--r-- | korganizer/komonthview.cpp | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index e66ddce..4dfb9df 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -98,7 +98,10 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) | |||
98 | QListBox::focusInEvent ( e ); | 98 | QListBox::focusInEvent ( e ); |
99 | QListBoxItem * i = item ( 0 ); | 99 | if ( count() ){ |
100 | if ( i && resetOnFocusIn ) { | 100 | int ci = currentItem(); |
101 | setCurrentItem( i ); | 101 | if ( ci < 0 ) ci = 0; |
102 | setSelected ( 0, true ); | 102 | |
103 | } | 103 | setCurrentItem( ci ); |
104 | setSelected ( ci, true ); | ||
105 | emit highlighted( item ( ci ) ); | ||
106 | |||
104 | resetOnFocusIn = true; | 107 | resetOnFocusIn = true; |
@@ -127,2 +130,3 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e ) | |||
127 | } | 130 | } |
131 | } | ||
128 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) | 132 | void KNoScrollListBox::focusOutEvent ( QFocusEvent * e ) |
@@ -175,2 +179,5 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
175 | if ( count() ) { | 179 | if ( count() ) { |
180 | if ( currentItem() == 0 ) { | ||
181 | emit prevCell(); | ||
182 | } else { | ||
176 | setCurrentItem((currentItem()+count()-1)%count()); | 183 | setCurrentItem((currentItem()+count()-1)%count()); |
@@ -184,2 +191,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
184 | } | 191 | } |
192 | } | ||
185 | break; | 193 | break; |
@@ -191,2 +199,5 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
191 | if ( count () ) { | 199 | if ( count () ) { |
200 | if ( currentItem()+1 == count () ) { | ||
201 | emit nextCell(); | ||
202 | } else { | ||
192 | setCurrentItem((currentItem()+1)%count()); | 203 | setCurrentItem((currentItem()+1)%count()); |
@@ -200,2 +211,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
200 | } | 211 | } |
212 | } | ||
201 | break; | 213 | break; |
@@ -228,2 +240,5 @@ void KNoScrollListBox::oneDown() | |||
228 | if ( count () ) { | 240 | if ( count () ) { |
241 | if ( currentItem()+1 == count () ) { | ||
242 | emit nextCell(); | ||
243 | } else { | ||
229 | resetOnFocusIn = false; | 244 | resetOnFocusIn = false; |
@@ -239,2 +254,3 @@ void KNoScrollListBox::oneDown() | |||
239 | } | 254 | } |
255 | } | ||
240 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) | 256 | void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) |
@@ -475,6 +491,7 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | |||
475 | SLOT( selection( QListBoxItem * ) ) ); | 491 | SLOT( selection( QListBoxItem * ) ) ); |
476 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), | 492 | |
477 | SLOT( cellClicked( QListBoxItem * ) ) ); | 493 | /* |
478 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), | 494 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), |
479 | SLOT( selection( QListBoxItem * ) ) ); | 495 | SLOT( selection( QListBoxItem * ) ) ); |
496 | */ | ||
480 | } | 497 | } |
@@ -991,2 +1008,3 @@ void MonthViewCell::defaultAction( QListBoxItem *item ) | |||
991 | { | 1008 | { |
1009 | |||
992 | if ( !item ) { | 1010 | if ( !item ) { |
@@ -1012,2 +1030,3 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) | |||
1012 | { | 1030 | { |
1031 | qDebug("CELL "); | ||
1013 | if ( item == 0 ) { | 1032 | if ( item == 0 ) { |
@@ -1017,13 +1036,3 @@ void MonthViewCell::cellClicked( QListBoxItem *item ) | |||
1017 | } | 1036 | } |
1018 | /* | ||
1019 | if ( lastClicked ) | ||
1020 | if ( ! item ) { | ||
1021 | if ( lastClicked->listBox() != item->listBox() ) | ||
1022 | lastClicked->listBox()->clearSelection(); | ||
1023 | } | ||
1024 | */ | ||
1025 | 1037 | ||
1026 | mMonthView->setSelectedCell( this ); | ||
1027 | if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); | ||
1028 | select(); | ||
1029 | } | 1038 | } |
@@ -1153,2 +1162,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1153 | SIGNAL( showDaySignal( QDate ) ) ); | 1162 | SIGNAL( showDaySignal( QDate ) ) ); |
1163 | connect( cell, SIGNAL( nextCell() ), | ||
1164 | SLOT( nextCell() ) ); | ||
1165 | connect( cell, SIGNAL( prevCell() ), | ||
1166 | SLOT( prevCell() ) ); | ||
1154 | } | 1167 | } |
@@ -1166,2 +1179,6 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
1166 | SIGNAL( showDaySignal( QDate ) ) ); | 1179 | SIGNAL( showDaySignal( QDate ) ) ); |
1180 | connect( cell, SIGNAL( nextCell() ), | ||
1181 | SLOT( nextCell() ) ); | ||
1182 | connect( cell, SIGNAL( prevCell() ), | ||
1183 | SLOT( prevCell() ) ); | ||
1167 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); | 1184 | cell->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont ); |
@@ -1976 +1993,10 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e ) | |||
1976 | } | 1993 | } |
1994 | |||
1995 | void KOMonthView::nextCell() | ||
1996 | { | ||
1997 | bool res = focusNextPrevChild ( true ); | ||
1998 | } | ||
1999 | void KOMonthView::prevCell() | ||
2000 | { | ||
2001 | focusNextPrevChild ( false ); | ||
2002 | } | ||