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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user