summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index ab9a4b6..9f7db69 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -85,2 +85,3 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
85 mWT = new KNOWhatsThis(this); 85 mWT = new KNOWhatsThis(this);
86 resetOnFocusIn = true;
86} 87}
@@ -90,2 +91,23 @@ KNoScrollListBox::~KNoScrollListBox()
90} 91}
92
93
94void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
95{
96 QListBox::focusInEvent ( e );
97 QListBoxItem * i = item ( 0 );
98 if ( i && resetOnFocusIn ) {
99 setCurrentItem( i );
100 setSelected ( 0, true );
101 }
102 resetOnFocusIn = true;
103}
104void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
105{
106 int i = currentItem ();
107 if ( i >= 0 ) {
108 setSelected ( i, false );
109 }
110 QListBox::focusOutEvent ( e );
111}
112
91QString KNoScrollListBox::getWhatsThisText(QPoint p) 113QString KNoScrollListBox::getWhatsThisText(QPoint p)
@@ -154,3 +176,3 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
154 case Key_I: 176 case Key_I:
155 QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); 177 QTimer::singleShot( 1, this, SLOT ( oneDown() ) );
156 e->ignore(); 178 e->ignore();
@@ -179,3 +201,4 @@ void KNoScrollListBox::oneDown()
179{ 201{
180 if ( count () ) { 202 if ( count () ) {
203 resetOnFocusIn = false;
181 setCurrentItem((currentItem()+1)%count()); 204 setCurrentItem((currentItem()+1)%count());