Add keyboard shorcuts to focus and unfocus chat (#3898)

* Added keyboard shorcuts to focus and unfocus chat

* Fixed format

* Changed the Esc behavior to work on any QLineEdit in the main Window and ignore shortcut conflicts

* Fixed a conflict with shortcuts

* Configurable unfocus shortcut and format fixes

* minor style fix
This commit is contained in:
Xenos6666 2020-03-17 02:48:05 +01:00 committed by GitHub
parent 7285f24a29
commit 63b4f9b2f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 235 additions and 107 deletions

View file

@ -1,13 +1,7 @@
#include "tab_userlists.h"
#include "abstractclient.h"
#include "soundengine.h"
#include "userinfobox.h"
#include "userlist.h"
#include <QHBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include "abstractclient.h"
#include "customlineedit.h"
#include "pb/event_add_to_list.pb.h"
#include "pb/event_remove_from_list.pb.h"
#include "pb/event_user_joined.pb.h"
@ -15,6 +9,13 @@
#include "pb/response_list_users.pb.h"
#include "pb/session_commands.pb.h"
#include "pending_command.h"
#include "soundengine.h"
#include "userinfobox.h"
#include "userlist.h"
#include <QHBoxLayout>
#include <QPushButton>
#include <QVBoxLayout>
TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
AbstractClient *_client,
@ -58,7 +59,7 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
vbox->addWidget(allUsersList);
QHBoxLayout *addToBuddyList = new QHBoxLayout;
addBuddyEdit = new QLineEdit;
addBuddyEdit = new LineEditUnfocusable;
addBuddyEdit->setPlaceholderText(tr("Add to Buddy List"));
connect(addBuddyEdit, SIGNAL(returnPressed()), this, SLOT(addToBuddyList()));
QPushButton *addBuddyButton = new QPushButton("Add");
@ -67,7 +68,7 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor,
addToBuddyList->addWidget(addBuddyButton);
QHBoxLayout *addToIgnoreList = new QHBoxLayout;
addIgnoreEdit = new QLineEdit;
addIgnoreEdit = new LineEditUnfocusable;
addIgnoreEdit->setPlaceholderText(tr("Add to Ignore List"));
connect(addIgnoreEdit, SIGNAL(returnPressed()), this, SLOT(addToIgnoreList()));
QPushButton *addIgnoreButton = new QPushButton("Add");