diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 8 | ||||
| -rw-r--r-- | src/mainwindow.ui | 11 |
2 files changed, 13 insertions, 6 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]() { diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 5698074..016b22c 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -64,6 +64,9 @@ <property name="windowTitle"> <string>Document Outline</string> </property> + <property name="_shortcut" stdset="0"> + <string>Ctrl+M</string> + </property> <attribute name="dockWidgetArea"> <number>1</number> </attribute> @@ -102,6 +105,9 @@ <property name="windowTitle"> <string>Bookmarks</string> </property> + <property name="_shortcut" stdset="0"> + <string>Ctrl+B</string> + </property> <attribute name="dockWidgetArea"> <number>2</number> </attribute> @@ -143,6 +149,9 @@ <property name="windowTitle"> <string>History</string> </property> + <property name="_shortcut" stdset="0"> + <string>Ctrl+H</string> + </property> <attribute name="dockWidgetArea"> <number>2</number> </attribute> @@ -357,7 +366,7 @@ <string>Go to home</string> </property> <property name="shortcut"> - <string>Ctrl+H</string> + <string>Alt+Home</string> </property> </action> <action name="actionHelp"> |
