Added Ctrl+1/2/3/... shortcuts to Emote Popup (#2263)
This commit is contained in:
@@ -305,12 +305,11 @@ void Window::addShortcuts()
|
||||
// CTRL + 1-8 to open corresponding tab.
|
||||
for (auto i = 0; i < 8; i++)
|
||||
{
|
||||
char hotkey[7];
|
||||
std::sprintf(hotkey, "CTRL+%d", i + 1);
|
||||
const auto openTab = [this, i] {
|
||||
this->notebook_->selectIndex(i);
|
||||
};
|
||||
createWindowShortcut(this, hotkey, openTab);
|
||||
createWindowShortcut(this, QString("CTRL+%1").arg(i + 1).toUtf8(),
|
||||
openTab);
|
||||
}
|
||||
|
||||
createWindowShortcut(this, "CTRL+9", [this] {
|
||||
|
||||
@@ -156,6 +156,22 @@ EmotePopup::EmotePopup(QWidget *parent)
|
||||
|
||||
this->loadEmojis();
|
||||
|
||||
// CTRL + 1-8 to open corresponding tab
|
||||
for (auto i = 0; i < 8; i++)
|
||||
{
|
||||
const auto openTab = [this, i, notebook] {
|
||||
notebook->selectIndex(i);
|
||||
};
|
||||
createWindowShortcut(this, QString("CTRL+%1").arg(i + 1).toUtf8(),
|
||||
openTab);
|
||||
}
|
||||
|
||||
// Open last tab (first one from right)
|
||||
createWindowShortcut(this, "CTRL+9", [=] {
|
||||
notebook->selectLastTab();
|
||||
});
|
||||
|
||||
// Cycle through tabs
|
||||
createWindowShortcut(this, "CTRL+Tab", [=] {
|
||||
notebook->selectNextTab();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user