mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #1179 from 23rd/patch-30-simplified-tab-hotkeys
Moved to one place and simplified hotkeys of switching tabs.
This commit is contained in:
commit
989dad1a6d
|
@ -34,14 +34,6 @@ Notebook::Notebook(QWidget *parent)
|
||||||
this->addButton_->setIcon(NotebookButton::Icon::Plus);
|
this->addButton_->setIcon(NotebookButton::Icon::Plus);
|
||||||
|
|
||||||
this->addButton_->setHidden(true);
|
this->addButton_->setHidden(true);
|
||||||
|
|
||||||
auto *shortcut_next = new QShortcut(QKeySequence("Ctrl+Tab"), this);
|
|
||||||
QObject::connect(shortcut_next, &QShortcut::activated,
|
|
||||||
[this] { this->selectNextTab(); });
|
|
||||||
|
|
||||||
auto *shortcut_prev = new QShortcut(QKeySequence("Ctrl+Shift+Tab"), this);
|
|
||||||
QObject::connect(shortcut_prev, &QShortcut::activated,
|
|
||||||
[this] { this->selectPreviousTab(); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NotebookTab *Notebook::addPage(QWidget *page, QString title, bool select)
|
NotebookTab *Notebook::addPage(QWidget *page, QString title, bool select)
|
||||||
|
|
|
@ -282,6 +282,11 @@ void Window::addShortcuts()
|
||||||
createWindowShortcut(this, "CTRL+9",
|
createWindowShortcut(this, "CTRL+9",
|
||||||
[this] { this->notebook_->selectLastTab(); });
|
[this] { this->notebook_->selectLastTab(); });
|
||||||
|
|
||||||
|
createWindowShortcut(this, "CTRL+TAB",
|
||||||
|
[this] { this->notebook_->selectNextTab(); });
|
||||||
|
createWindowShortcut(this, "CTRL+SHIFT+TAB",
|
||||||
|
[this] { this->notebook_->selectPreviousTab(); });
|
||||||
|
|
||||||
// Zoom in
|
// Zoom in
|
||||||
{
|
{
|
||||||
auto s = new QShortcut(QKeySequence::ZoomIn, this);
|
auto s = new QShortcut(QKeySequence::ZoomIn, this);
|
||||||
|
|
|
@ -400,32 +400,6 @@ void SplitInput::installKeyPressedEvent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->key() == Qt::Key_Tab)
|
|
||||||
{
|
|
||||||
if (event->modifiers() == Qt::ControlModifier)
|
|
||||||
{
|
|
||||||
SplitContainer *page =
|
|
||||||
static_cast<SplitContainer *>(this->split_->parentWidget());
|
|
||||||
|
|
||||||
Notebook *notebook =
|
|
||||||
static_cast<Notebook *>(page->parentWidget());
|
|
||||||
|
|
||||||
notebook->selectNextTab();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (event->key() == Qt::Key_Backtab)
|
|
||||||
{
|
|
||||||
if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier))
|
|
||||||
{
|
|
||||||
SplitContainer *page =
|
|
||||||
static_cast<SplitContainer *>(this->split_->parentWidget());
|
|
||||||
|
|
||||||
Notebook *notebook =
|
|
||||||
static_cast<Notebook *>(page->parentWidget());
|
|
||||||
|
|
||||||
notebook->selectPreviousTab();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (event->key() == Qt::Key_C &&
|
else if (event->key() == Qt::Key_C &&
|
||||||
event->modifiers() == Qt::ControlModifier)
|
event->modifiers() == Qt::ControlModifier)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue