Skip to content

Commit

Permalink
GUI: change editor highlight naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jdupak committed Jun 17, 2024
1 parent 07b0d79 commit 6af4d88
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions src/gui/mainwindow/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<iconset>
<normaloff>
:/icons/gui.png</normaloff>
:/icons/gui.png
:/icons/gui.png
</iconset>
</property>
<property name="dockNestingEnabled">
Expand Down Expand Up @@ -54,7 +54,7 @@
<x>0</x>
<y>0</y>
<width>900</width>
<height>32</height>
<height>31</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand Down Expand Up @@ -129,8 +129,8 @@
<string>&amp;Options</string>
</property>
<addaction name="actionEditorShowLineNumbers"/>
<addaction name="actionEditorEnableHighlight"/>
<addaction name="actionEditorEnableFocusChange"/>
<addaction name="actionEditorHighlightPC"/>
<addaction name="actionEditorFollowPC"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuMachine"/>
Expand All @@ -147,7 +147,7 @@
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::TopToolBarArea</set>
<set>Qt::ToolBarArea::TopToolBarArea</set>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
Expand Down Expand Up @@ -613,32 +613,32 @@
<string>Show line number in the code editor.</string>
</property>
</action>
<action name="actionEditorEnableHighlight">
<action name="actionEditorHighlightPC">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Enable &amp;Highlighting</string>
<string>&amp;Highlight Curent Instruction</string>
</property>
<property name="toolTip">
<string>Highlight currently executed instruction in internal editor.</string>
<string>Highlight currently the currently executed instruction in the internal editor.</string>
</property>
</action>
<action name="actionEditorEnableFocusChange">
<action name="actionEditorFollowPC">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Enable &amp;Focus Change</string>
<string>&amp;Follow Current Instruction</string>
</property>
<property name="toolTip">
<string>Focus on currently executed instruction in internal editor.</string>
<string>Always focus the currently executed instruction in the internal editor.</string>
</property>
</action>
</widget>
Expand Down
8 changes: 4 additions & 4 deletions src/gui/mainwindow/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ MainWindow::MainWindow(QSettings *settings, QWidget *parent)
ui->actionEditorShowLineNumbers, &QAction::triggered, editor_tabs.data(),
&EditorDock::set_show_line_numbers);
connect(
ui->actionEditorEnableHighlight, &QAction::triggered, editor_tabs.data(),
&EditorDock::set_enable_hightlight);
ui->actionEditorHighlightPC, &QAction::triggered, editor_tabs.data(),
&EditorDock::set_highlight_pc);
connect(
ui->actionEditorEnableFocusChange, &QAction::triggered, editor_tabs.data(),
&EditorDock::set_enable_focus_change);
ui->actionEditorFollowPC, &QAction::triggered, editor_tabs.data(),
&EditorDock::set_follow_pc);

bool line_numbers_visible = settings->value("EditorShowLineNumbers", true).toBool();
editor_tabs->set_show_line_numbers(line_numbers_visible);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/windows/editor/editordock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ void EditorDock::set_show_line_numbers(bool visible) {
}
}

void EditorDock::set_enable_hightlight(bool enable) {
void EditorDock::set_highlight_pc(bool enable) {
enable_hightlight = enable;
settings->setValue("editorEnableHighlisht", enable);
for (int i = 0; i < this->count(); i++) {
get_tab(i)->set_enable_highlight(enable);
}
}

void EditorDock::set_enable_focus_change(bool enable) {
void EditorDock::set_follow_pc(bool enable) {
enable_focus_change = enable;
settings->setValue("editorEnableFocusChange", enable);
for (int i = 0; i < this->count(); i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/windows/editor/editordock.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class EditorDock : public HidingTabWidget {

public slots:
void set_show_line_numbers(bool visible);
void set_enable_hightlight(bool enable);
void set_enable_focus_change(bool enable);
void set_highlight_pc(bool enable);
void set_follow_pc(bool enable);

void open_file_dialog();
void save_tab(int index);
Expand Down

0 comments on commit 6af4d88

Please sign in to comment.