From e45c4d19d9418051cf32e503090485227662d91c Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 8 Sep 2013 19:07:31 +0000 Subject: [PATCH] (trunk, qt) #5312 'download checkbox toggle with spacebar is broken' -- fixed, patch by mikedld --- qt/file-tree.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qt/file-tree.cc b/qt/file-tree.cc index 4014d5ef6..363295dc3 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -1003,6 +1003,25 @@ FileTreeView :: eventFilter (QObject * o, QEvent * event) setColumnWidth(COL_NAME, std::max(left,0)); } + // handle using the keyboard to toggle the + // wanted/unwanted state or the file priority + else if (event->type () == QEvent::KeyPress && state () != EditingState) + { + switch (static_cast (event)->key ()) + { + case Qt::Key_Space: + foreach (const QModelIndex& i, selectionModel ()->selectedRows (COL_WANTED)) + clicked (i); + break; + + case Qt::Key_Enter: + case Qt::Key_Return: + foreach (const QModelIndex& i, selectionModel ()->selectedRows (COL_PRIORITY)) + clicked (i); + break; + } + } + return false; } -- 2.40.0