From 0e1275a67cae2435c0ac8cee2252f91737c2e10a Mon Sep 17 00:00:00 2001 From: eilers Date: Mon, 24 Mar 2003 07:44:33 +0000 Subject: DetailView: If card is too big to show, use page up/down instead of next/previous contact if cursor up/down is used .. --- diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO index 106747e..da9b9c2 100644 --- a/core/pim/addressbook/TODO +++ b/core/pim/addressbook/TODO @@ -13,8 +13,6 @@ Feature requests: - Beaming of multiple contacts (current list/ by search or by category) - Configure the letter-picker: lastname/fullname search - User center of the joypad to switch back from card to listview ! -- Cursor-UP/Down: Should additionally scroll cardview if it is too large - (behaviour should be selectable by configuration) Known Bugs: ----------- @@ -114,3 +112,5 @@ Fixed/Ready: If on second tab: The combo chooser is on the top left of the screen ! :( - Default Email-Button: Sometimes not hiding the textfields completely - Fix handling of 3 Firstnames +- Cursor-UP/Down: Should additionally scroll cardview if it is too large + (behaviour should be selectable by configuration) 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.."); - --m_itCurContact; - if ( *m_itCurContact != OContact() ) - sync(); - else - m_itCurContact = m_viewList.end(); + 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.."); - ++m_itCurContact; - if ( *m_itCurContact != OContact() ) - sync(); - else - m_itCurContact = m_viewList.begin(); +// 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 diff --git a/core/pim/addressbook/version.h b/core/pim/addressbook/version.h index 0f12bd7..999ce67 100644 --- a/core/pim/addressbook/version.h +++ b/core/pim/addressbook/version.h @@ -3,7 +3,7 @@ #define MAINVERSION "0" #define SUBVERSION "9" -#define PATCHVERSION "1" +#define PATCHVERSION "2" #define APPNAME "OPIE_ADDRESSBOOK" -- cgit v0.9.0.2