- fix: When debugging project, the executing source file is not auto switched to. (#476)

This commit is contained in:
Roy Qu 2024-09-29 20:39:57 +08:00
parent b9f36558ba
commit 785614607c
4 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,8 @@ Red Panda C++ Version 3.2
- fix: Crash in windows 7. (by CyanoHao)
- fix: While Control is pressed, can't start Drag&Drop by mouse.
- enhancement: Auto detect gdb ACP (by CyanoHao)
- fix: When debugging project, the executing source file is not auto switched to. #476
Red Panda C++ Version 3.1

View File

@ -608,11 +608,12 @@ void Editor::setFilename(const QString &newName)
return;
}
void Editor::activate()
void Editor::activate(bool focus)
{
if (mParentPageControl)
mParentPageControl->setCurrentWidget(this);
setFocus();
if (focus)
setFocus();
}
const QByteArray& Editor::encodingOption() const noexcept{

View File

@ -150,7 +150,7 @@ public:
bool save(bool force=false, bool reparse=true);
bool saveAs(const QString& name="", bool fromProject = false);
void setFilename(const QString& newName);
void activate();
void activate(bool focus=true);
QTabWidget* pageControl() noexcept;
void setPageControl(QTabWidget* newPageControl);

View File

@ -1163,6 +1163,7 @@ void MainWindow::setActiveBreakpoint(QString fileName, int Line, bool setFocus)
Editor *e = openFile(fileName, false);
if (e!=nullptr) {
e->setActiveBreakpointFocus(Line,setFocus);
e->activate(false);
if (setFocus) {
activateWindow();
}