Add keybindings to tab context menu items (#3265)
Co-authored-by: Paweł <zneix@zneix.eu>
This commit is contained in:
@@ -36,9 +36,12 @@ Notebook::Notebook(QWidget *parent)
|
|||||||
|
|
||||||
this->addButton_->setHidden(true);
|
this->addButton_->setHidden(true);
|
||||||
|
|
||||||
this->menu_.addAction("Toggle visibility of tabs", [this]() {
|
this->menu_.addAction(
|
||||||
this->setShowTabs(!this->getShowTabs());
|
"Toggle visibility of tabs",
|
||||||
});
|
[this]() {
|
||||||
|
this->setShowTabs(!this->getShowTabs());
|
||||||
|
},
|
||||||
|
QKeySequence("Ctrl+U"));
|
||||||
}
|
}
|
||||||
|
|
||||||
NotebookTab *Notebook::addPage(QWidget *page, QString title, bool select)
|
NotebookTab *Notebook::addPage(QWidget *page, QString title, bool select)
|
||||||
|
|||||||
@@ -60,9 +60,12 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
|||||||
this->showRenameDialog();
|
this->showRenameDialog();
|
||||||
});
|
});
|
||||||
|
|
||||||
this->menu_.addAction("Close Tab", [=]() {
|
this->menu_.addAction(
|
||||||
this->notebook_->removePage(this->page);
|
"Close Tab",
|
||||||
});
|
[=]() {
|
||||||
|
this->notebook_->removePage(this->page);
|
||||||
|
},
|
||||||
|
QKeySequence("Ctrl+Shift+W"));
|
||||||
|
|
||||||
this->menu_.addAction(
|
this->menu_.addAction(
|
||||||
"Popup Tab",
|
"Popup Tab",
|
||||||
@@ -86,9 +89,12 @@ NotebookTab::NotebookTab(Notebook *notebook)
|
|||||||
|
|
||||||
this->menu_.addSeparator();
|
this->menu_.addSeparator();
|
||||||
|
|
||||||
this->menu_.addAction("Toggle visibility of tabs", [this]() {
|
this->menu_.addAction(
|
||||||
this->notebook_->setShowTabs(!this->notebook_->getShowTabs());
|
"Toggle visibility of tabs",
|
||||||
});
|
[this]() {
|
||||||
|
this->notebook_->setShowTabs(!this->notebook_->getShowTabs());
|
||||||
|
},
|
||||||
|
QKeySequence("Ctrl+U"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotebookTab::showRenameDialog()
|
void NotebookTab::showRenameDialog()
|
||||||
|
|||||||
Reference in New Issue
Block a user