- enhancement: "Switch Header/Source" in editor title bar context menu.

This commit is contained in:
Roy Qu 2023-01-01 08:32:33 +08:00
parent 0caaad8436
commit 96f9a898d0
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Red Panda C++ Version 2.8
- fix: Can't set project icon to "app.ico" in the project folder, if the project doesn't has icon. - fix: Can't set project icon to "app.ico" in the project folder, if the project doesn't has icon.
- fix: Resource compilation items is missing in the auto generated makefile, if the project's icon is removed and re-added. - fix: Resource compilation items is missing in the auto generated makefile, if the project's icon is removed and re-added.
- fix: Action "Run all problem cases" is triggered twice by one clicked. - fix: Action "Run all problem cases" is triggered twice by one clicked.
- enhancement: "Switch Header/Source" in editor title bar context menu.
Red Panda C++ Version 2.7 Red Panda C++ Version 2.7

View File

@ -4812,6 +4812,11 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos
tabWidget->setCurrentIndex(index); tabWidget->setCurrentIndex(index);
QMenu menu(this); QMenu menu(this);
QTabBar* tabBar = tabWidget->tabBar(); QTabBar* tabBar = tabWidget->tabBar();
Editor * editor = dynamic_cast<Editor *>(tabWidget->widget(index));
if (!switchHeaderSourceTarget(editor).isEmpty()) {
menu.addAction(ui->actionSwitchHeaderSource);
menu.addSeparator();
}
menu.addAction(ui->actionClose); menu.addAction(ui->actionClose);
menu.addAction(ui->actionClose_All); menu.addAction(ui->actionClose_All);
menu.addSeparator(); menu.addSeparator();
@ -4826,7 +4831,6 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos
tabWidget==ui->EditorTabsRight tabWidget==ui->EditorTabsRight
|| tabWidget->count()>1 || tabWidget->count()>1
); );
Editor * editor = dynamic_cast<Editor *>(tabWidget->widget(index));
if (editor ) { if (editor ) {
ui->actionLocate_in_Files_View->setEnabled(!editor->isNew()); ui->actionLocate_in_Files_View->setEnabled(!editor->isNew());
} }