Added 'enable minimap' option to Editor config page.

This commit is contained in:
Ernie Pasveer
2026-07-27 13:07:26 -05:00
parent 9ea56161b1
commit dc8a6c49a5
8 changed files with 61 additions and 7 deletions
+10
View File
@@ -315,6 +315,16 @@ bool SeerConfigDialog::editorHighlighterEnabled () const {
return _editorConfigPage->highlighterEnabled();
}
void SeerConfigDialog::setEditorMinimapEnabled (bool flag) {
_editorConfigPage->setMinimapEnabled(flag);
}
bool SeerConfigDialog::editorMinimapEnabled () const {
return _editorConfigPage->minimapEnabled();
}
void SeerConfigDialog::setExternalEditorCommand (const QString& externalEditorCommand) {
_editorConfigPage->setExternalEditorCommand(externalEditorCommand);
+3
View File
@@ -88,6 +88,9 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm {
void setEditorHighlighterEnabled (bool flag);
bool editorHighlighterEnabled () const;
void setEditorMinimapEnabled (bool flag);
bool editorMinimapEnabled () const;
void setExternalEditorCommand (const QString& externalEditorCommand);
QString externalEditorCommand () const;
-2
View File
@@ -162,8 +162,6 @@ const SeerHighlighterSettings& SeerEditorConfigPage::highlighterSettings() const
void SeerEditorConfigPage::setHighlighterEnabled (bool flag) {
qDebug() << flag;
highlighterEnabledCheckBox->setChecked(flag);
editorWidget->sourceArea()->setHighlighterEnabled(flag);
+33 -2
View File
@@ -32,6 +32,7 @@ SeerEditorManagerWidget::SeerEditorManagerWidget (QWidget* parent) : QWidget(par
_editorFont = QFont("monospace", 10); // Default font.
_editorHighlighterSettings = SeerHighlighterSettings::populate(""); // Default syntax highlighting.
_editorHighlighterEnabled = true;
_editorMinimapEnabled = false;
_editorKeySettings = SeerKeySettings::populate(); // Default key settings.
_editorTabSize = 4;
_editorExternalEditorCommand = "";
@@ -384,9 +385,36 @@ void SeerEditorManagerWidget::setEditorHighlighterEnabled (bool flag) {
bool SeerEditorManagerWidget::editorHighlighterEnabled () const {
return _editorHighlighterEnabled;
}
void SeerEditorManagerWidget::setEditorMinimapEnabled (bool flag) {
_editorMinimapEnabled = flag;
// Update current editors.
SeerEditorManagerEntries::iterator b = beginEntry();
SeerEditorManagerEntries::iterator e = endEntry();
while (b != e) {
b->widget->sourceArea()->enableMiniMapArea(_editorMinimapEnabled);
b++;
}
// Don't forget about the assembly widget.
SeerEditorWidgetAssembly* assemblyWidget = assemblyWidgetTab();
if (assemblyWidget) {
assemblyWidget->assemblyArea()->enableMiniMapArea(_editorMinimapEnabled);
}
}
bool SeerEditorManagerWidget::editorMinimapEnabled () const {
return _editorMinimapEnabled;
}
void SeerEditorManagerWidget::setEditorAlternateDirectories (const QStringList alternateDirectories) {
_editorAlternateDirectories = alternateDirectories;
@@ -797,7 +825,7 @@ void SeerEditorManagerWidget::handleText (const QString& text) {
}
}else if (text.startsWith("*running")) {
// target / program is running, should erase 'yellow' color is for the current line
// target / program is running, should erase 'yellow' color is for the current line
// _lastFrameList is invoked to erase previously "colored" line
for ( const auto& frame_text : _lastFrameList ) {
QString fullname_text = Seer::parseFirst(frame_text, "fullname=", '"', '"', false);
@@ -926,7 +954,7 @@ void SeerEditorManagerWidget::handleOpenFileWithDetails (const QString& file, co
}
if (firstDisplayLine > 0) {
// firstDisplayLine is always > 0
// firstDisplayLine is always > 0
// this means the function is handling open closed files, set cursor position and first display line
QPlainTextEdit* textEdit = editorWidget->sourceArea();
// Create a small helper lambda that does the actual restoration
@@ -1076,6 +1104,7 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QS
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
editorWidget->sourceArea()->enableMiniMapArea(editorMinimapEnabled());
editorWidget->setKeySettings(editorKeySettings());
// Set the tooltip for the tab.
@@ -1141,6 +1170,7 @@ SeerEditorWidgetSource* SeerEditorManagerWidget::createEditorWidgetTab (const QS
editorWidget->sourceArea()->setHighlighterSettings(editorHighlighterSettings());
editorWidget->sourceArea()->setHighlighterEnabled(editorHighlighterEnabled());
editorWidget->sourceArea()->setAlternateDirectories(editorAlternateDirectories());
editorWidget->sourceArea()->enableMiniMapArea(editorMinimapEnabled());
editorWidget->setKeySettings(editorKeySettings());
// Set the tooltip for the tab.
@@ -1240,6 +1270,7 @@ SeerEditorWidgetAssembly* SeerEditorManagerWidget::createAssemblyWidgetTab () {
assemblyWidget->assemblyArea()->setEditorTabSize(editorTabSize());
assemblyWidget->assemblyArea()->setHighlighterSettings(editorHighlighterSettings());
assemblyWidget->assemblyArea()->setHighlighterEnabled(editorHighlighterEnabled());
assemblyWidget->assemblyArea()->enableMiniMapArea(editorMinimapEnabled());
assemblyWidget->setShowAddressColumn(assemblyShowAddressColumn());
assemblyWidget->setShowOffsetColumn(assemblyShowOffsetColumn());
+3
View File
@@ -63,6 +63,8 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
const SeerHighlighterSettings& editorHighlighterSettings () const;
void setEditorHighlighterEnabled (bool flag);
bool editorHighlighterEnabled () const;
void setEditorMinimapEnabled (bool flag);
bool editorMinimapEnabled () const;
void setEditorAlternateDirectories (const QStringList alternateDirectories);
const QStringList& editorAlternateDirectories () const;
void setEditorIgnoreDirectories (const QStringList ignoreDirectories);
@@ -162,6 +164,7 @@ class SeerEditorManagerWidget : public QWidget, protected Ui::SeerEditorManagerW
SeerEditorManagerEntries _entries;
SeerHighlighterSettings _editorHighlighterSettings;
bool _editorHighlighterEnabled;
bool _editorMinimapEnabled;
QFont _editorFont;
QStringList _editorAlternateDirectories;
QStringList _editorIgnoreDirectories;
+1 -1
View File
@@ -72,7 +72,7 @@ SeerEditorWidgetAssemblyArea::SeerEditorWidgetAssemblyArea(QWidget* parent) : Se
enableOffsetArea(true);
enableOpcodeArea(true);
enableBreakPointArea(true);
enableMiniMapArea(true);
enableMiniMapArea(false);
enableSourceLines(true);
setConvertUppercase(false);
+7 -1
View File
@@ -71,7 +71,7 @@ SeerEditorWidgetSourceArea::SeerEditorWidgetSourceArea(QWidget* parent) : SeerPl
enableLineNumberArea(true);
enableBreakPointArea(true);
enableMiniMapArea(true);
enableMiniMapArea(false);
_altHeldTimer->setInterval(40); // 40 ms interval = 25Hz update rate
QObject::connect(_altHeldTimer, &QTimer::timeout, this, [this]() {
@@ -108,26 +108,31 @@ SeerEditorWidgetSourceArea::SeerEditorWidgetSourceArea(QWidget* parent) : SeerPl
}
void SeerEditorWidgetSourceArea::enableLineNumberArea (bool flag) {
_enableLineNumberArea = flag;
updateMarginAreasWidth(0);
}
bool SeerEditorWidgetSourceArea::lineNumberAreaEnabled () const {
return _enableLineNumberArea;
}
void SeerEditorWidgetSourceArea::enableBreakPointArea (bool flag) {
_enableBreakPointArea = flag;
updateMarginAreasWidth(0);
}
bool SeerEditorWidgetSourceArea::breakPointAreaEnabled () const {
return _enableBreakPointArea;
}
void SeerEditorWidgetSourceArea::enableMiniMapArea (bool flag) {
_enableMiniMapArea = flag;
invalidateMiniMapCache();
@@ -135,6 +140,7 @@ void SeerEditorWidgetSourceArea::enableMiniMapArea (bool flag) {
}
bool SeerEditorWidgetSourceArea::miniMapAreaEnabled () const {
return _enableMiniMapArea;
}
+4 -1
View File
@@ -819,7 +819,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
dlg.setEditorTabSize(gdbWidget->editorManager()->editorTabSize());
dlg.setEditorHighlighterSettings(gdbWidget->editorManager()->editorHighlighterSettings());
dlg.setEditorHighlighterEnabled(gdbWidget->editorManager()->editorHighlighterEnabled());
dlg.setEditorHighlighterEnabled(gdbWidget->editorManager()->editorHighlighterEnabled());
dlg.setEditorMinimapEnabled(gdbWidget->editorManager()->editorMinimapEnabled());
dlg.setExternalEditorCommand(gdbWidget->editorManager()->editorExternalEditorCommand());
dlg.setEditorAutoSourceReload(gdbWidget->editorManager()->editorAutoSourceReload());
dlg.setSourceAlternateDirectories(gdbWidget->sourceAlternateDirectories());
@@ -866,6 +866,7 @@ void SeerMainWindow::handleSettingsConfiguration () {
gdbWidget->editorManager()->setEditorTabSize(dlg.editorTabSize());
gdbWidget->editorManager()->setEditorHighlighterSettings(dlg.editorHighlighterSettings());
gdbWidget->editorManager()->setEditorHighlighterEnabled(dlg.editorHighlighterEnabled());
gdbWidget->editorManager()->setEditorMinimapEnabled(dlg.editorMinimapEnabled());
gdbWidget->editorManager()->setEditorExternalEditorCommand(dlg.externalEditorCommand());
gdbWidget->editorManager()->setEditorAutoSourceReload(dlg.editorAutoSourceReload());
gdbWidget->setSourceAlternateDirectories(dlg.sourceAlternateDirectories());
@@ -1772,6 +1773,7 @@ void SeerMainWindow::writeConfigSettings () {
settings.setValue("tabsize", gdbWidget->editorManager()->editorTabSize());
settings.setValue("externaleditorcommand", gdbWidget->editorManager()->editorExternalEditorCommand());
settings.setValue("autosourcereload", gdbWidget->editorManager()->editorAutoSourceReload());
settings.setValue("minimapenabled", gdbWidget->editorManager()->editorMinimapEnabled());
settings.beginGroup("highlighter"); {
@@ -1874,6 +1876,7 @@ void SeerMainWindow::readConfigSettings () {
gdbWidget->editorManager()->setEditorTabSize(settings.value("tabsize", 4).toInt());
gdbWidget->editorManager()->setEditorExternalEditorCommand(settings.value("externaleditorcommand").toString());
gdbWidget->editorManager()->setEditorAutoSourceReload(settings.value("autosourcereload").toBool());
gdbWidget->editorManager()->setEditorMinimapEnabled(settings.value("minimapenabled",false).toBool());
settings.beginGroup("highlighter"); {