Changeset View
Changeset View
Standalone View
Standalone View
krusader/Panel/PanelView/krinterbriefview.cpp
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | 154 | { | |||
---|---|---|---|---|---|
158 | if (handleKeyEvent(e)) | 158 | if (handleKeyEvent(e)) | ||
159 | return; | 159 | return; | ||
160 | 160 | | |||
161 | QAbstractItemView::keyPressEvent(e); | 161 | QAbstractItemView::keyPressEvent(e); | ||
162 | } | 162 | } | ||
163 | 163 | | |||
164 | bool KrInterBriefView::handleKeyEvent(QKeyEvent *e) | 164 | bool KrInterBriefView::handleKeyEvent(QKeyEvent *e) | ||
165 | { | 165 | { | ||
166 | if ((e->key() != Qt::Key_Left && e->key() != Qt::Key_Right) && (KrView::handleKeyEvent(e))) | 166 | | ||
167 | if (((e->key() != Qt::Key_Left && e->key() != Qt::Key_Right) || (e->modifiers() == Qt::ControlModifier)) && (KrView::handleKeyEvent(e))) | ||||
167 | // did the view class handled the event? | 168 | // did the view class handled the event? | ||
168 | return true; | 169 | return true; | ||
169 | 170 | | |||
170 | switch (e->key()) { | 171 | switch (e->key()) { | ||
171 | case Qt::Key_Right : { | 172 | case Qt::Key_Right : { | ||
172 | if (e->modifiers() == Qt::ControlModifier) { | | |||
173 | // let the panel handle it | | |||
174 | e->ignore(); | | |||
175 | break; | | |||
176 | } | | |||
177 | KrViewItem *i = getCurrentKrViewItem(); | 173 | KrViewItem *i = getCurrentKrViewItem(); | ||
178 | KrViewItem *newCurrent = i; | 174 | KrViewItem *newCurrent = i; | ||
179 | 175 | | |||
180 | if (!i) | 176 | if (!i) | ||
181 | break; | 177 | break; | ||
182 | 178 | | |||
183 | int num = itemsPerPage() + 1; | 179 | int num = itemsPerPage() + 1; | ||
184 | 180 | | |||
Show All 10 Lines | 190 | if (newCurrent) { | |||
195 | setCurrentKrViewItem(newCurrent); | 191 | setCurrentKrViewItem(newCurrent); | ||
196 | makeCurrentVisible(); | 192 | makeCurrentVisible(); | ||
197 | } | 193 | } | ||
198 | if (e->modifiers() & Qt::ShiftModifier) | 194 | if (e->modifiers() & Qt::ShiftModifier) | ||
199 | op()->emitSelectionChanged(); | 195 | op()->emitSelectionChanged(); | ||
200 | return true; | 196 | return true; | ||
201 | } | 197 | } | ||
202 | case Qt::Key_Left : { | 198 | case Qt::Key_Left : { | ||
203 | if (e->modifiers() == Qt::ControlModifier) { | | |||
204 | // let the panel handle it | | |||
205 | e->ignore(); | | |||
206 | break; | | |||
207 | } | | |||
208 | KrViewItem *i = getCurrentKrViewItem(); | 199 | KrViewItem *i = getCurrentKrViewItem(); | ||
209 | KrViewItem *newCurrent = i; | 200 | KrViewItem *newCurrent = i; | ||
210 | 201 | | |||
211 | if (!i) | 202 | if (!i) | ||
212 | break; | 203 | break; | ||
213 | 204 | | |||
214 | int num = itemsPerPage() + 1; | 205 | int num = itemsPerPage() + 1; | ||
215 | 206 | | |||
▲ Show 20 Lines • Show All 490 Lines • Show Last 20 Lines |