- fix: Shortcuts in non-editor panels conficts with the editor.

This commit is contained in:
Roy Qu 2024-03-13 11:04:51 +08:00
parent 904d0e29b1
commit 1e3404c591
7 changed files with 960 additions and 882 deletions

View File

@ -46,6 +46,7 @@ Red Panda C++ Version 2.27
- fix: Full scope typed variables in lambda expressions is not correctly parsed. - fix: Full scope typed variables in lambda expressions is not correctly parsed.
- fix: Failed to evaluate expressions while debugging, if the expression has spaces in it. - fix: Failed to evaluate expressions while debugging, if the expression has spaces in it.
- fix: When debugging, can't watch expressions that has spaces in it. - fix: When debugging, can't watch expressions that has spaces in it.
- fix: Shortcuts in non-editor panels conficts with the editor.
Red Panda C++ Version 2.26 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -689,8 +689,10 @@ void Editor::focusOutEvent(QFocusEvent *event)
{ {
QSynEdit::focusOutEvent(event); QSynEdit::focusOutEvent(event);
//pMainWindow->updateClassBrowserForEditor(nullptr); //pMainWindow->updateClassBrowserForEditor(nullptr);
if (!pMainWindow->isQuitting()) if (!pMainWindow->isQuitting()) {
pMainWindow->functionTip()->hide(); pMainWindow->functionTip()->hide();
pMainWindow->updateEditorActions();
}
} }
void Editor::keyPressEvent(QKeyEvent *event) void Editor::keyPressEvent(QKeyEvent *event)

View File

@ -570,7 +570,7 @@ void MainWindow::updateEditorActions(const Editor *e)
//it's not a compile action, but put here for convinience //it's not a compile action, but put here for convinience
ui->actionSaveAll->setEnabled( ui->actionSaveAll->setEnabled(
(mProject!=nullptr || mEditorList->pageCount()>0)); (mProject!=nullptr || mEditorList->pageCount()>0));
if (e==nullptr) { if (e==nullptr || !e->hasFocus()) {
ui->actionAuto_Detect->setEnabled(false); ui->actionAuto_Detect->setEnabled(false);
ui->actionEncode_in_ANSI->setEnabled(false); ui->actionEncode_in_ANSI->setEnabled(false);
ui->actionEncode_in_UTF_8->setEnabled(false); ui->actionEncode_in_UTF_8->setEnabled(false);
@ -590,7 +590,6 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionExport_As_HTML->setEnabled(false); ui->actionExport_As_HTML->setEnabled(false);
ui->actionExport_As_RTF->setEnabled(false); ui->actionExport_As_RTF->setEnabled(false);
ui->actionPrint->setEnabled(false); ui->actionPrint->setEnabled(false);
ui->actionSelectAll->setEnabled(false);
ui->actionToggleComment->setEnabled(false); ui->actionToggleComment->setEnabled(false);
ui->actionToggle_Block_Comment->setEnabled(false); ui->actionToggle_Block_Comment->setEnabled(false);
ui->actionUnIndent->setEnabled(false); ui->actionUnIndent->setEnabled(false);
@ -604,6 +603,28 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionDelete_to_Word_End->setEnabled(false); ui->actionDelete_to_Word_End->setEnabled(false);
ui->actionDelete_Last_Word->setEnabled(false); ui->actionDelete_Last_Word->setEnabled(false);
ui->menuMove_Caret->setEnabled(false);
ui->actionPage_Up->setEnabled(false);
ui->actionPage_Down->setEnabled(false);
ui->actionGoto_Line_Start->setEnabled(false);
ui->actionGoto_Line_End->setEnabled(false);
ui->actionGoto_File_Start->setEnabled(false);
ui->actionGoto_File_End->setEnabled(false);
ui->actionGoto_Page_Start->setEnabled(false);
ui->actionGoto_Page_End->setEnabled(false);
ui->actionSelectAll->setEnabled(false);
ui->actionSelect_Word->setEnabled(false);
ui->actionMove_Selection_Up->setEnabled(false);
ui->actionMove_Selection_Down->setEnabled(false);
ui->actionPage_Up_and_Select->setEnabled(false);
ui->actionPage_Down_and_Select->setEnabled(false);
ui->actionGoto_Line_Start_and_Select->setEnabled(false);
ui->actionGoto_Line_End_and_Select->setEnabled(false);
ui->actionGoto_File_Start_and_Select->setEnabled(false);
ui->actionGoto_File_End_and_Select->setEnabled(false);
ui->actionGoto_Page_Start_and_Select->setEnabled(false);
ui->actionGoto_Page_End_and_Select->setEnabled(false);
ui->actionFind->setEnabled(false); ui->actionFind->setEnabled(false);
ui->actionReplace->setEnabled(false); ui->actionReplace->setEnabled(false);
@ -621,7 +642,15 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionRemove_Bookmark->setEnabled(false); ui->actionRemove_Bookmark->setEnabled(false);
ui->actionModify_Bookmark_Description->setEnabled(false); ui->actionModify_Bookmark_Description->setEnabled(false);
ui->actionMatch_Bracket->setEnabled(false);
ui->actionGo_to_Line->setEnabled(false); ui->actionGo_to_Line->setEnabled(false);
ui->actionGoto_block_start->setEnabled(false);
ui->actionGoto_block_end->setEnabled(false);
ui->actionTrim_trailing_spaces->setEnabled(false);
mMenuInsertCodeSnippet->setEnabled(false);
ui->actionRename_Symbol->setEnabled(false);
ui->actionLocate_in_Files_View->setEnabled(false); ui->actionLocate_in_Files_View->setEnabled(false);
ui->actionToggle_Readonly->setEnabled(false); ui->actionToggle_Readonly->setEnabled(false);
@ -653,7 +682,6 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionExport_As_HTML->setEnabled(true); ui->actionExport_As_HTML->setEnabled(true);
ui->actionExport_As_RTF->setEnabled(true); ui->actionExport_As_RTF->setEnabled(true);
ui->actionPrint->setEnabled(true); ui->actionPrint->setEnabled(true);
ui->actionSelectAll->setEnabled(e->document()->count()>0);
ui->actionToggleComment->setEnabled(!e->readOnly() && e->document()->count()>0); ui->actionToggleComment->setEnabled(!e->readOnly() && e->document()->count()>0);
ui->actionToggle_Block_Comment->setEnabled(!e->readOnly() && e->selAvail()); ui->actionToggle_Block_Comment->setEnabled(!e->readOnly() && e->selAvail());
ui->actionUnIndent->setEnabled(!e->readOnly() && e->document()->count()>0); ui->actionUnIndent->setEnabled(!e->readOnly() && e->document()->count()>0);
@ -666,6 +694,28 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionDelete_to_Word_End->setEnabled(!e->readOnly() && e->document()->count()>0); ui->actionDelete_to_Word_End->setEnabled(!e->readOnly() && e->document()->count()>0);
ui->actionDelete_Last_Word->setEnabled(!e->readOnly() && e->document()->count()>0); ui->actionDelete_Last_Word->setEnabled(!e->readOnly() && e->document()->count()>0);
ui->menuMove_Caret->setEnabled(true);
ui->actionPage_Up->setEnabled(true);
ui->actionPage_Down->setEnabled(true);
ui->actionGoto_Line_Start->setEnabled(true);
ui->actionGoto_Line_End->setEnabled(true);
ui->actionGoto_File_Start->setEnabled(true);
ui->actionGoto_File_End->setEnabled(true);
ui->actionGoto_Page_Start->setEnabled(true);
ui->actionGoto_Page_End->setEnabled(true);
ui->actionSelectAll->setEnabled(e->document()->count()>0);
ui->actionSelect_Word->setEnabled(true);
ui->actionMove_Selection_Up->setEnabled(true);
ui->actionMove_Selection_Down->setEnabled(true);
ui->actionPage_Up_and_Select->setEnabled(true);
ui->actionPage_Down_and_Select->setEnabled(true);
ui->actionGoto_Line_Start_and_Select->setEnabled(true);
ui->actionGoto_Line_End_and_Select->setEnabled(true);
ui->actionGoto_File_Start_and_Select->setEnabled(true);
ui->actionGoto_File_End_and_Select->setEnabled(true);
ui->actionGoto_Page_Start_and_Select->setEnabled(true);
ui->actionGoto_Page_End_and_Select->setEnabled(true);
ui->actionFind->setEnabled(true); ui->actionFind->setEnabled(true);
ui->actionReplace->setEnabled(true); ui->actionReplace->setEnabled(true);
@ -684,7 +734,15 @@ void MainWindow::updateEditorActions(const Editor *e)
ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line)); ui->actionRemove_Bookmark->setEnabled(e->hasBookmark(line));
ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line)); ui->actionModify_Bookmark_Description->setEnabled(e->hasBookmark(line));
ui->actionMatch_Bracket->setEnabled(true);
ui->actionGo_to_Line->setEnabled(true); ui->actionGo_to_Line->setEnabled(true);
ui->actionGoto_block_start->setEnabled(true);
ui->actionGoto_block_end->setEnabled(true);
ui->actionTrim_trailing_spaces->setEnabled(true);
mMenuInsertCodeSnippet->setEnabled(true);
ui->actionRename_Symbol->setEnabled(true);
ui->actionLocate_in_Files_View->setEnabled(!e->isNew()); ui->actionLocate_in_Files_View->setEnabled(!e->isNew());
ui->actionToggle_Readonly->setEnabled(!e->modified()); ui->actionToggle_Readonly->setEnabled(!e->modified());

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>955</width> <width>2345</width>
<height>619</height> <height>619</height>
</rect> </rect>
</property> </property>
@ -119,8 +119,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>955</width> <width>2345</width>
<height>21</height> <height>30</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@ -177,9 +177,9 @@
<property name="title"> <property name="title">
<string>Edit</string> <string>Edit</string>
</property> </property>
<widget class="QMenu" name="menuMove_Cursor"> <widget class="QMenu" name="menuMove_Caret">
<property name="title"> <property name="title">
<string>Move Cursor</string> <string>Move Caret</string>
</property> </property>
<addaction name="actionPage_Up"/> <addaction name="actionPage_Up"/>
<addaction name="actionPage_Down"/> <addaction name="actionPage_Down"/>
@ -206,7 +206,7 @@
<addaction name="actionFoldAll"/> <addaction name="actionFoldAll"/>
<addaction name="actionUnfoldAll"/> <addaction name="actionUnfoldAll"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="menuMove_Cursor"/> <addaction name="menuMove_Caret"/>
<addaction name="actionDelete_Line"/> <addaction name="actionDelete_Line"/>
<addaction name="actionDuplicate_Line"/> <addaction name="actionDuplicate_Line"/>
<addaction name="actionDelete_Word"/> <addaction name="actionDelete_Word"/>
@ -946,6 +946,7 @@
<widget class="IssuesTable" name="tableIssues"> <widget class="IssuesTable" name="tableIssues">
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight>
<bold>false</bold> <bold>false</bold>
</font> </font>
</property> </property>
@ -3196,8 +3197,6 @@
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources/>
<include location="icons.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -515,14 +515,6 @@
<source>error:</source> <source>error:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>fatal error:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>syntax error:</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>warning:</source> <source>warning:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -5363,10 +5355,6 @@
<source>You should recompile after change the compiler set or it&apos;s settings.</source> <source>You should recompile after change the compiler set or it&apos;s settings.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Move Cursor</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Page Up</source> <source>Page Up</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -5479,6 +5467,10 @@
<source> %1 Version</source> <source> %1 Version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Move Caret</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MemoryModel</name> <name>MemoryModel</name>
@ -7193,6 +7185,14 @@
<source>Error executing platform compiler hint add-on</source> <source>Error executing platform compiler hint add-on</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Failed to parse json content: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The request message don&apos;t have &apos;%1&apos; field!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>RegisterModel</name> <name>RegisterModel</name>

File diff suppressed because it is too large Load Diff

View File

@ -416,14 +416,6 @@
<source>error:</source> <source>error:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>fatal error:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>syntax error:</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>warning:</source> <source>warning:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -5064,10 +5056,6 @@
<source>You should recompile after change the compiler set or it&apos;s settings.</source> <source>You should recompile after change the compiler set or it&apos;s settings.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Move Cursor</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Page Up</source> <source>Page Up</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -5180,6 +5168,10 @@
<source> %1 Version</source> <source> %1 Version</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Move Caret</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MemoryModel</name> <name>MemoryModel</name>
@ -6681,6 +6673,14 @@
<source>Error executing platform compiler hint add-on</source> <source>Error executing platform compiler hint add-on</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Failed to parse json content: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The request message don&apos;t have &apos;%1&apos; field!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>RegisterModel</name> <name>RegisterModel</name>