From eac1077de17b0f6fb79541be57dc67b7d067d0ce Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 3 Mar 2023 09:04:26 +0800 Subject: [PATCH] - enhancement: Add "Close window" and "Move to other view" in the "Window" menu --- NEWS.md | 1 + RedPandaIDE/mainwindow.cpp | 7 +++---- RedPandaIDE/mainwindow.ui | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index f784df60..172d6403 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,7 @@ Red Panda C++ Version 2.16 - enhancement: When first display two editor panes, auto make them the same width - change: Don't rebuild the whole project when run/debug, if only contents of project unit file is modified. - fix: rebuild may not work, if project's parallel build option is enabled. + - enhancement: Add "Close window" and "Move to other view" in the "Window" menu Red Panda C++ Version 2.15 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index d349d163..15aa2488 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -592,6 +592,8 @@ void MainWindow::updateEditorActions(const Editor *e) ui->actionGoto_Declaration->setEnabled(false); ui->actionGoto_Definition->setEnabled(false); ui->actionFind_references->setEnabled(false); + + ui->actionMove_To_Other_View->setEnabled(false); } else { ui->actionAuto_Detect->setEnabled(true); ui->actionEncode_in_ANSI->setEnabled(true); @@ -653,6 +655,7 @@ void MainWindow::updateEditorActions(const Editor *e) ui->actionGoto_Declaration->setEnabled(e->parser()!=nullptr); ui->actionGoto_Definition->setEnabled(e->parser()!=nullptr); ui->actionFind_references->setEnabled(e->parser()!=nullptr); + ui->actionMove_To_Other_View->setEnabled(editorList()->pageCount()>1); } updateCompileActions(e); @@ -4964,10 +4967,6 @@ void MainWindow::onEditorTabContextMenu(QTabWidget* tabWidget, const QPoint &pos menu.addAction(ui->actionMove_To_Other_View); menu.addSeparator(); menu.addAction(ui->actionFile_Properties); - ui->actionMove_To_Other_View->setEnabled( - tabWidget==ui->EditorTabsRight - || tabWidget->count()>1 - ); if (editor ) { ui->actionLocate_in_Files_View->setEnabled(!editor->isNew()); } diff --git a/RedPandaIDE/mainwindow.ui b/RedPandaIDE/mainwindow.ui index b1978e4b..334caea9 100644 --- a/RedPandaIDE/mainwindow.ui +++ b/RedPandaIDE/mainwindow.ui @@ -136,8 +136,8 @@ - + @@ -238,8 +238,10 @@ Window + + @@ -967,6 +969,7 @@ + 50 false