hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/ui/source_view.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-09-20 03:49:18 +0200
committerhachem <im@hachem.wtf>2025-09-20 03:49:18 +0200
commit049e7e2aa15debb1ed112494681d7b3e28765679 (patch)
tree9c60baf2de75e3051dc1c0f9914d4e4a2ea90edd /src/ui/source_view.h
parent6f02694e2b994a4d4ba0308b384a37eb6fbafe89 (diff)
feat: add preferences panel
Diffstat (limited to 'src/ui/source_view.h')
-rw-r--r--src/ui/source_view.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ui/source_view.h b/src/ui/source_view.h
index 9bea9d8..dd3ed27 100644
--- a/src/ui/source_view.h
+++ b/src/ui/source_view.h
@@ -38,6 +38,12 @@ namespace Hsdbg
auto draw(Debugger& debugger) -> void;
auto set_highlighted_line(uint32_t line) -> void;
+ auto set_highlighting(bool enabled) -> void { m_highlighting_enabled = enabled; }
+ auto set_line_numbers(bool enabled) -> void { m_line_numbers = enabled; }
+ auto set_highlight_current_line(bool enabled) -> void { m_highlight_current_line = enabled; }
+
+ auto set_syntax_color(size_t kind, unsigned int color) -> void { m_syntax_colors[kind] = color; }
+ auto set_current_line_color(unsigned int color) -> void { m_current_line_color = color; }
auto path() const -> const std::filesystem::path& { return m_path; }
auto line_count() const -> size_t { return m_lines.size(); }
@@ -51,6 +57,14 @@ namespace Hsdbg
std::vector<std::string> m_lines;
std::vector<std::vector<SourceSpan>> m_spans;
bool m_highlight = false;
+ bool m_highlighting_enabled = true;
+ bool m_line_numbers = true;
+ bool m_highlight_current_line = true;
+
+ unsigned int m_syntax_colors[7] = {
+ 0, 0xFFD69C56, 0xFFB0C94E, 0xFF7891CE, 0xFFA8CEB5, 0xFF55996A, 0xFFC086C5,
+ };
+ unsigned int m_current_line_color = 0xFF2E483A;
std::string m_path_input;
std::string m_error;
uint32_t m_highlighted_line = 0;