aboutsummaryrefslogtreecommitdiff
path: root/src/ui/source_view.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-05 19:52:33 +0200
committerhachem <im@hachem.wtf>2026-09-05 19:52:33 +0200
commita92a298684d6e6d497ab7bef98ff1e380a707503 (patch)
treef8df1f67532e90b9635d775d5a9aa87e0dcf0e09 /src/ui/source_view.h
parentc0302d681459214f9c2a845edb64b7f14d213f6a (diff)
feat: ui refactor of doom and despair
Diffstat (limited to 'src/ui/source_view.h')
-rw-r--r--src/ui/source_view.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ui/source_view.h b/src/ui/source_view.h
index 4c2cbe4..7dd949d 100644
--- a/src/ui/source_view.h
+++ b/src/ui/source_view.h
@@ -10,6 +10,7 @@
#include <vector>
struct ImDrawList;
+struct ImFont;
namespace Hsdbg
{
@@ -53,6 +54,9 @@ namespace Hsdbg
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; }
+ // the monospace face the code (and its gutter) is rendered in
+ auto set_mono_font(ImFont* font) -> void { m_mono_font = font; }
+
auto path() const -> const std::filesystem::path& { return m_path; }
auto line_count() const -> size_t { return m_lines.size(); }
auto is_open() const -> bool { return !m_lines.empty(); }
@@ -79,6 +83,7 @@ namespace Hsdbg
auto draw_macro_span(ImDrawList* draw_list, const std::string& line,
const SourceSpan& span) -> void;
+ ImFont* m_mono_font = nullptr;
std::filesystem::path m_path;
std::vector<std::string> m_lines;
std::vector<std::vector<SourceSpan>> m_spans;