mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Added tab navigation shortcut to SelectChannelDialog (#2142)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
ee14492e15
commit
523874dc21
|
@ -4,6 +4,7 @@
|
|||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
#include "util/Shortcut.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/dialogs/IrcConnectionEditor.hpp"
|
||||
#include "widgets/helper/NotebookTab.hpp"
|
||||
|
@ -213,17 +214,24 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
|||
this->ui_.twitch.channel->setFocus();
|
||||
|
||||
// Shortcuts
|
||||
auto *shortcut_ok = new QShortcut(QKeySequence("Return"), this);
|
||||
QObject::connect(shortcut_ok, &QShortcut::activated, [=] { this->ok(); });
|
||||
auto *shortcut_cancel = new QShortcut(QKeySequence("Esc"), this);
|
||||
QObject::connect(shortcut_cancel, &QShortcut::activated,
|
||||
[=] { this->close(); });
|
||||
createWindowShortcut(this, "Return", [=] {
|
||||
this->ok(); //
|
||||
});
|
||||
createWindowShortcut(this, "Esc", [=] {
|
||||
this->close(); //
|
||||
});
|
||||
|
||||
// restore ui state
|
||||
// fourtf: enable when releasing irc
|
||||
if (getSettings()->enableExperimentalIrc)
|
||||
{
|
||||
this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab);
|
||||
createWindowShortcut(this, "Ctrl+Tab", [=] {
|
||||
this->ui_.notebook->selectNextTab(); //
|
||||
});
|
||||
createWindowShortcut(this, "CTRL+Shift+Tab", [=] {
|
||||
this->ui_.notebook->selectPreviousTab(); //
|
||||
});
|
||||
}
|
||||
|
||||
this->ui_.irc.servers->getTableView()->selectRow(
|
||||
|
|
Loading…
Reference in a new issue