mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 09:11:06 -04:00
Enabled space to switch the read state in MessagesDialog and ForumsDialog.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4183 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
06bc6029f2
commit
ac18995bdf
4 changed files with 46 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
|||
#include <QFile>
|
||||
#include <QDateTime>
|
||||
#include <QMessageBox>
|
||||
#include <QItemDelegate>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "ForumsDialog.h"
|
||||
#include "forums/CreateForum.h"
|
||||
|
@ -208,6 +208,8 @@ ForumsDialog::ForumsDialog(QWidget *parent)
|
|||
|
||||
insertThreads();
|
||||
|
||||
ui.threadTreeWidget->installEventFilter(this);
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
|
||||
|
@ -399,6 +401,23 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
|||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
bool ForumsDialog::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == ui.threadTreeWidget) {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent && keyEvent->key() == Qt::Key_Space) {
|
||||
// Space pressed
|
||||
QTreeWidgetItem *item = ui.threadTreeWidget->currentItem ();
|
||||
clickedThread (item, COLUMN_THREAD_READ);
|
||||
return true; // eat event
|
||||
}
|
||||
}
|
||||
}
|
||||
// pass the event on to the parent class
|
||||
return RsAutoUpdatePage::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void ForumsDialog::restoreForumKeys(void)
|
||||
{
|
||||
rsForums->forumRestoreKeys(mCurrForumId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue