mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Added ability to open last tab with Ctrl+9. (Chromium behaviour.)
- Fixed #1106.
This commit is contained in:
parent
c578cd47e1
commit
838fd6bab6
3 changed files with 13 additions and 1 deletions
|
@ -256,6 +256,17 @@ void Notebook::selectPreviousTab()
|
|||
this->select(this->items_[index].page);
|
||||
}
|
||||
|
||||
void Notebook::selectLastTab()
|
||||
{
|
||||
const auto size = this->items_.size();
|
||||
if (size <= 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->select(this->items_[size - 1].page);
|
||||
}
|
||||
|
||||
int Notebook::getPageCount() const
|
||||
{
|
||||
return this->items_.count();
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
void selectIndex(int index);
|
||||
void selectNextTab();
|
||||
void selectPreviousTab();
|
||||
void selectLastTab();
|
||||
|
||||
int getPageCount() const;
|
||||
QWidget *getPageAt(int index) const;
|
||||
|
|
|
@ -287,7 +287,7 @@ void Window::addShortcuts()
|
|||
createWindowShortcut(this, "CTRL+8",
|
||||
[this] { this->notebook_->selectIndex(7); });
|
||||
createWindowShortcut(this, "CTRL+9",
|
||||
[this] { this->notebook_->selectIndex(8); });
|
||||
[this] { this->notebook_->selectLastTab(); });
|
||||
|
||||
// Zoom in
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue