aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorKarol Kosek <krkk@krkk.ct8.pl>2020-12-23 11:16:30 +0100
committerFelix Queißner <felix@ib-queissner.de>2020-12-24 23:29:59 +0100
commit1ceae995f1984b2e9512752cf5e8d8b56d03d574 (patch)
treee536f02e43a9046813ae7d246f10e23c3430fc45 /src/mainwindow.cpp
parent6686c4ad47db6993bfaa442998e845f55ea50f40 (diff)
downloadkristall-1ceae995f1984b2e9512752cf5e8d8b56d03d574.tar.gz
Add shortcuts for Document Outline, Bookmark, and History docks
Had to use custom properties and rebind the Go home shortcut.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index b129414..fc0d94e 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -43,12 +43,10 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) :
for(QDockWidget * dock : findChildren<QDockWidget *>())
{
- QAction * act = this->ui->menuView ->addAction(dock->windowTitle());
- act->setCheckable(true);
- act->setChecked(dock->isVisible());
- act->setData(QVariant::fromValue(dock));
+ QAction * act = dock->toggleViewAction();
+ act->setShortcut(dock->property("_shortcut").toString());
// act->setIcon(dock->windowIcon());
- connect(act, QOverload<bool>::of(&QAction::triggered), dock, &QDockWidget::setVisible);
+ this->ui->menuView->addAction(act);
}
connect(this->ui->menuNavigation, &QMenu::aboutToShow, [this]() {