author | eilers <eilers> | 2003-03-24 07:44:33 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-24 07:44:33 (UTC) |
commit | 0e1275a67cae2435c0ac8cee2252f91737c2e10a (patch) (unidiff) | |
tree | 0d65a291c21353a5e25932331b63e85050c6bff8 /core/pim/addressbook/ablabel.cpp | |
parent | 1b4836ba28ca57947d37699fc67cddd74fb29fbe (diff) | |
download | opie-0e1275a67cae2435c0ac8cee2252f91737c2e10a.zip opie-0e1275a67cae2435c0ac8cee2252f91737c2e10a.tar.gz opie-0e1275a67cae2435c0ac8cee2252f91737c2e10a.tar.bz2 |
DetailView: If card is too big to show, use page up/down instead of
next/previous contact if cursor up/down is used ..
Diffstat (limited to 'core/pim/addressbook/ablabel.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/ablabel.cpp | 34 |
1 files changed, 24 insertions, 10 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() | |||
90 | 90 | ||
91 | void AbLabel::keyPressEvent( QKeyEvent *e ) | 91 | void AbLabel::keyPressEvent( QKeyEvent *e ) |
92 | { | 92 | { |
93 | |||
93 | // Commonly handled keys | 94 | // Commonly handled keys |
94 | if ( !m_empty ){ | 95 | if ( !m_empty ){ |
95 | switch( e->key() ) { | 96 | switch( e->key() ) { |
@@ -103,20 +104,33 @@ void AbLabel::keyPressEvent( QKeyEvent *e ) | |||
103 | break; | 104 | break; |
104 | case Qt::Key_Up: | 105 | case Qt::Key_Up: |
105 | qWarning( "UP.."); | 106 | qWarning( "UP.."); |
106 | --m_itCurContact; | 107 | if ( ( visibleHeight() < contentsHeight() ) && |
107 | if ( *m_itCurContact != OContact() ) | 108 | ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) ) |
108 | sync(); | 109 | scrollBy( 0, -(visibleHeight()-20) ); |
109 | else | 110 | else { |
110 | m_itCurContact = m_viewList.end(); | 111 | --m_itCurContact; |
112 | if ( *m_itCurContact != OContact() ) | ||
113 | sync(); | ||
114 | else | ||
115 | m_itCurContact = m_viewList.end(); | ||
116 | } | ||
111 | 117 | ||
112 | break; | 118 | break; |
113 | case Qt::Key_Down: | 119 | case Qt::Key_Down: |
114 | qWarning( "DOWN.."); | 120 | qWarning( "DOWN.."); |
115 | ++m_itCurContact; | 121 | // qWarning( "visible: %d, content: %d",visibleHeight(),contentsHeight()); |
116 | if ( *m_itCurContact != OContact() ) | 122 | // qWarning( "value: %d; barMaxValue: %d", verticalScrollBar()->value() |
117 | sync(); | 123 | // , verticalScrollBar()->maxValue() ); |
118 | else | 124 | if ( ( visibleHeight() < contentsHeight() ) && |
119 | m_itCurContact = m_viewList.begin(); | 125 | ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) ) |
126 | scrollBy( 0, visibleHeight()-20 ); | ||
127 | else { | ||
128 | ++m_itCurContact; | ||
129 | if ( *m_itCurContact != OContact() ) | ||
130 | sync(); | ||
131 | else | ||
132 | m_itCurContact = m_viewList.begin(); | ||
133 | } | ||
120 | break; | 134 | break; |
121 | case Qt::Key_Return: // fall through | 135 | case Qt::Key_Return: // fall through |
122 | case Qt::Key_Space: // fall through | 136 | case Qt::Key_Space: // fall through |