Improve highlighting structure

- switched to a sparse delta based map
- true lazy-loading to avoid any unneccessary allocations
- fixed windows management api
This commit is contained in:
2026-02-11 18:18:28 +00:00
parent d79ea4e75a
commit 5b66f503e4
24 changed files with 481 additions and 549 deletions

View File

@@ -6,9 +6,7 @@
#include "utils/utils.h"
#include "windows/decl.h"
TileRoot *init_hover();
struct HoverBox : Window {
struct HoverBox : Popup {
std::string text;
std::atomic<bool> is_markup;
uint32_t scroll_;
@@ -24,8 +22,16 @@ struct HoverBox : Window {
}
void scroll(int32_t number);
void render(std::vector<ScreenCell> &buffer, Coord size, Coord pos) override;
void handle_click(KeyEvent, Coord) override { this->hidden = true; };
void handle_click(KeyEvent ev, Coord) override {
if (ev.mouse_button == SCROLL_BTN && ev.mouse_state == SCROLL) {
this->scroll(ev.mouse_direction == SCROLL_UP ? -1 : 1);
return;
}
this->hidden = true;
};
~HoverBox() {};
};
HoverBox *init_hover();
#endif