Added tab navigation shortcut to SelectChannelDialog (#2142)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||||
#include "singletons/Theme.hpp"
|
#include "singletons/Theme.hpp"
|
||||||
#include "util/LayoutCreator.hpp"
|
#include "util/LayoutCreator.hpp"
|
||||||
|
#include "util/Shortcut.hpp"
|
||||||
#include "widgets/Notebook.hpp"
|
#include "widgets/Notebook.hpp"
|
||||||
#include "widgets/dialogs/IrcConnectionEditor.hpp"
|
#include "widgets/dialogs/IrcConnectionEditor.hpp"
|
||||||
#include "widgets/helper/NotebookTab.hpp"
|
#include "widgets/helper/NotebookTab.hpp"
|
||||||
@@ -213,17 +214,24 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
|
|||||||
this->ui_.twitch.channel->setFocus();
|
this->ui_.twitch.channel->setFocus();
|
||||||
|
|
||||||
// Shortcuts
|
// Shortcuts
|
||||||
auto *shortcut_ok = new QShortcut(QKeySequence("Return"), this);
|
createWindowShortcut(this, "Return", [=] {
|
||||||
QObject::connect(shortcut_ok, &QShortcut::activated, [=] { this->ok(); });
|
this->ok(); //
|
||||||
auto *shortcut_cancel = new QShortcut(QKeySequence("Esc"), this);
|
});
|
||||||
QObject::connect(shortcut_cancel, &QShortcut::activated,
|
createWindowShortcut(this, "Esc", [=] {
|
||||||
[=] { this->close(); });
|
this->close(); //
|
||||||
|
});
|
||||||
|
|
||||||
// restore ui state
|
// restore ui state
|
||||||
// fourtf: enable when releasing irc
|
// fourtf: enable when releasing irc
|
||||||
if (getSettings()->enableExperimentalIrc)
|
if (getSettings()->enableExperimentalIrc)
|
||||||
{
|
{
|
||||||
this->ui_.notebook->selectIndex(getSettings()->lastSelectChannelTab);
|
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(
|
this->ui_.irc.servers->getTableView()->selectRow(
|
||||||
|
|||||||
Reference in New Issue
Block a user