diff options
| author | hachem <im@hachem.wtf> | 2026-09-08 12:54:05 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-08 12:54:05 +0200 |
| commit | 1fa69b34a0968cf79461f37b8d9fdadba745b4d3 (patch) | |
| tree | 639cb5b89c8eeebcb8b83b6f3fd114d19c4f5b81 /src/ui/source_view.h | |
| parent | ff58bb0cda2f183836f8e016db42caf055041744 (diff) | |
feat: source view zoom and line mentions
Diffstat (limited to 'src/ui/source_view.h')
| -rw-r--r-- | src/ui/source_view.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ui/source_view.h b/src/ui/source_view.h index 5673d69..b38772b 100644 --- a/src/ui/source_view.h +++ b/src/ui/source_view.h @@ -7,6 +7,7 @@ #include <filesystem> #include <optional> #include <string> +#include <unordered_set> #include <vector> struct ImDrawList; @@ -44,6 +45,10 @@ namespace Hsdbg auto draw(Debugger& debugger) -> void; auto set_highlighted_line(uint32_t line) -> void; + + auto set_frame_extent(uint32_t first, uint32_t last) -> void; + + auto set_changed_locals(const std::unordered_set<std::string>* names) -> void { m_changed_locals = names; } 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; } @@ -52,6 +57,8 @@ namespace Hsdbg auto set_current_line_color(unsigned int color) -> void { m_current_line_color = color; } auto set_mono_font(ImFont* font) -> void { m_mono_font = font; } + auto set_font_size(float size) -> void { m_font_size = size; } + auto font_size() const -> float { return m_font_size; } auto path() const -> const std::filesystem::path& { return m_path; } auto line_count() const -> size_t { return m_lines.size(); } @@ -66,6 +73,7 @@ namespace Hsdbg private: auto draw_open_bar() -> void; auto draw_lines(Debugger& debugger) -> void; + auto handle_zoom() -> void; auto draw_macro_span(ImDrawList* draw_list, const std::string& line, const SourceSpan& span) -> void; @@ -91,5 +99,16 @@ namespace Hsdbg std::string m_error; uint32_t m_highlighted_line = 0; bool m_scroll_to_highlight = false; + + bool m_editing_path = false; + bool m_focus_path = false; + + float m_font_size = 16.0f; + float m_zoom_accumulator = 0.0f; + double m_zoom_badge_until = 0.0; + + uint32_t m_frame_first_line = 0; + uint32_t m_frame_last_line = 0; + const std::unordered_set<std::string>* m_changed_locals = nullptr; }; } |
