diff --git a/NEWS.md b/NEWS.md index 048c52ed..5bd17a23 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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: 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. + - enhancement: "Switch Header/Source" in editor title bar context menu. Red Panda C++ Version 2.7 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 501bbe8d..dae6ff56 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4812,6 +4812,11 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos tabWidget->setCurrentIndex(index); QMenu menu(this); QTabBar* tabBar = tabWidget->tabBar(); + Editor * editor = dynamic_cast(tabWidget->widget(index)); + if (!switchHeaderSourceTarget(editor).isEmpty()) { + menu.addAction(ui->actionSwitchHeaderSource); + menu.addSeparator(); + } menu.addAction(ui->actionClose); menu.addAction(ui->actionClose_All); menu.addSeparator(); @@ -4826,7 +4831,6 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos tabWidget==ui->EditorTabsRight || tabWidget->count()>1 ); - Editor * editor = dynamic_cast(tabWidget->widget(index)); if (editor ) { ui->actionLocate_in_Files_View->setEnabled(!editor->isNew()); }