diff options
| author | Peter Penz <[email protected]> | 2007-09-09 18:38:04 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-09-09 18:38:04 +0000 |
| commit | a69d7a39557527794fa871fba3f2909b662c3935 (patch) | |
| tree | 63e8ed1273e5d9b2e8044b6075a158c3e0db789d /src/dolphiniconsview.cpp | |
| parent | fd9296c18559058cc6e39e5d7ed73277f5656ea0 (diff) | |
Reactivate keyboard navigation again. Previously the Return key did not work, as the 'activated()' signal cannot be used (it ignores KDEs single vs. doubleclick setting).
svn path=/trunk/KDE/kdebase/apps/; revision=710356
Diffstat (limited to 'src/dolphiniconsview.cpp')
| -rw-r--r-- | src/dolphiniconsview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 37f0bf172..ed2332c05 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -46,6 +46,10 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle setMouseTracking(true); viewport()->setAttribute(Qt::WA_Hover); + // TODO: Connecting to the signal 'activated()' is not possible, as kstyle + // does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is + // necessary connecting the signal 'singleClick()' or 'doubleClick' and to handle the + // RETURN-key in keyPressEvent(). if (KGlobalSettings::singleClick()) { connect(this, SIGNAL(clicked(const QModelIndex&)), controller, SLOT(triggerItem(const QModelIndex&))); @@ -202,6 +206,14 @@ void DolphinIconsView::paintEvent(QPaintEvent* event) } } +void DolphinIconsView::keyPressEvent(QKeyEvent* event) +{ + KCategorizedView::keyPressEvent(event); + if (event->key() == Qt::Key_Return) { + m_controller->triggerItem(selectionModel()->currentIndex()); + } +} + void DolphinIconsView::slotShowPreviewChanged(bool showPreview) { updateGridSize(showPreview, m_controller->showAdditionalInfo()); |
