- emhancement: Improve display of disassembled codes in the cpu info dialog.

This commit is contained in:
Roy Qu 2023-03-01 20:28:00 +08:00
parent c96209cc42
commit 7943801f91
3 changed files with 9 additions and 4 deletions

View File

@ -5,6 +5,8 @@ Red Panda C++ Version 2.16
- fix: Can't debug project when project is saved after it's compiled. - fix: Can't debug project when project is saved after it's compiled.
- fix: Icons for buttons in the cpu info dialog is not correctly set. - fix: Icons for buttons in the cpu info dialog is not correctly set.
- enhancement: Add cfi directives for asm syntaxer in linux. - enhancement: Add cfi directives for asm syntaxer in linux.
- change: Editor option "Scroll past end of line" default to false.
- emhancement: Improve display of disassembled codes in the cpu info dialog.
Red Panda C++ Version 2.15 Red Panda C++ Version 2.15

View File

@ -1447,7 +1447,7 @@ void Settings::Editor::doLoad()
//scroll //scroll
mAutoHideScrollbar = boolValue("auto_hide_scroll_bar", false); mAutoHideScrollbar = boolValue("auto_hide_scroll_bar", false);
mScrollPastEof = boolValue("scroll_past_eof", true); mScrollPastEof = boolValue("scroll_past_eof", true);
mScrollPastEol = boolValue("scroll_past_eol", true); mScrollPastEol = boolValue("scroll_past_eol", false);
mScrollByOneLess = boolValue("scroll_by_one_less", false); mScrollByOneLess = boolValue("scroll_by_one_less", false);
mHalfPageScroll = boolValue("half_page_scroll",false); mHalfPageScroll = boolValue("half_page_scroll",false);
mMouseWheelScrollSpeed = intValue("mouse_wheel_scroll_speed", 3); mMouseWheelScrollSpeed = intValue("mouse_wheel_scroll_speed", 3);

View File

@ -42,6 +42,10 @@ CPUDialog::CPUDialog(QWidget *parent) :
ui->txtCode->setGutterWidth(0); ui->txtCode->setGutterWidth(0);
ui->txtCode->setUseCodeFolding(false); ui->txtCode->setUseCodeFolding(false);
ui->txtCode->setRightEdge(0); ui->txtCode->setRightEdge(0);
QSynedit::EditorOptions options=ui->txtCode->getOptions();
options.setFlag(QSynedit::EditorOption::eoScrollPastEof,false);
options.setFlag(QSynedit::EditorOption::eoScrollPastEol,false);
ui->txtCode->setOptions(options);
syntaxerManager.applyColorScheme(ui->txtCode->syntaxer(), syntaxerManager.applyColorScheme(ui->txtCode->syntaxer(),
pSettings->editor().colorScheme()); pSettings->editor().colorScheme());
PColorSchemeItem item = pColorManager->getItem(pSettings->editor().colorScheme(),COLOR_SCHEME_ACTIVE_LINE); PColorSchemeItem item = pColorManager->getItem(pSettings->editor().colorScheme(),COLOR_SCHEME_ACTIVE_LINE);
@ -114,16 +118,15 @@ void CPUDialog::setDisassembly(const QString& file, const QString& funcName,cons
{ {
ui->txtFunctionName->setText(QString("%1:%2").arg(file, funcName)); ui->txtFunctionName->setText(QString("%1:%2").arg(file, funcName));
int activeLine = -1; int activeLine = -1;
ui->txtCode->document()->clear();
for (int i=0;i<lines.size();i++) { for (int i=0;i<lines.size();i++) {
QString line = lines[i]; QString line = lines[i];
if (line.startsWith("=>")) { if (line.startsWith("=>")) {
activeLine = i; activeLine = i;
} }
ui->txtCode->document()->addLine(line);
} }
ui->txtCode->document()->setContents(lines);
if (activeLine!=-1) if (activeLine!=-1)
ui->txtCode->setCaretXYEx(true,QSynedit::BufferCoord{1,activeLine+1}); ui->txtCode->setCaretXYCentered(QSynedit::BufferCoord{1,activeLine+1});
} }
void CPUDialog::resetEditorFont(float dpi) void CPUDialog::resetEditorFont(float dpi)