summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/ablabel.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/ablabel.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/ablabel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/pim/addressbook/ablabel.cpp b/core/pim/addressbook/ablabel.cpp
index 80b57ae..6d8de91 100644
--- a/core/pim/addressbook/ablabel.cpp
+++ b/core/pim/addressbook/ablabel.cpp
@@ -90,6 +90,7 @@ void AbLabel::sync()
void AbLabel::keyPressEvent( QKeyEvent *e )
{
+
// Commonly handled keys
if ( !m_empty ){
switch( e->key() ) {
@@ -103,20 +104,33 @@ void AbLabel::keyPressEvent( QKeyEvent *e )
break;
case Qt::Key_Up:
qWarning( "UP..");
+ if ( ( visibleHeight() < contentsHeight() ) &&
+ ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) )
+ scrollBy( 0, -(visibleHeight()-20) );
+ else {
--m_itCurContact;
if ( *m_itCurContact != OContact() )
sync();
else
m_itCurContact = m_viewList.end();
+ }
break;
case Qt::Key_Down:
qWarning( "DOWN..");
+// qWarning( "visible: %d, content: %d",visibleHeight(),contentsHeight());
+// qWarning( "value: %d; barMaxValue: %d", verticalScrollBar()->value()
+// , verticalScrollBar()->maxValue() );
+ if ( ( visibleHeight() < contentsHeight() ) &&
+ ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) )
+ scrollBy( 0, visibleHeight()-20 );
+ else {
++m_itCurContact;
if ( *m_itCurContact != OContact() )
sync();
else
m_itCurContact = m_viewList.begin();
+ }
break;
case Qt::Key_Return: // fall through
case Qt::Key_Space: // fall through