- switched to a sparse delta based map - true lazy-loading to avoid any unneccessary allocations - fixed windows management api
38 lines
861 B
C++
38 lines
861 B
C++
#ifndef EXTENTION_HOVER_H
|
|
#define EXTENTION_HOVER_H
|
|
|
|
#include "io/sysio.h"
|
|
#include "pch.h"
|
|
#include "utils/utils.h"
|
|
#include "windows/decl.h"
|
|
|
|
struct HoverBox : Popup {
|
|
std::string text;
|
|
std::atomic<bool> is_markup;
|
|
uint32_t scroll_;
|
|
bool scroll_dirty;
|
|
|
|
HoverBox() : scroll_(0) { this->hidden = true; }
|
|
void clear() {
|
|
this->text = "";
|
|
this->hidden = true;
|
|
this->is_markup = false;
|
|
this->scroll_ = 0;
|
|
this->scroll_dirty = true;
|
|
}
|
|
void scroll(int32_t number);
|
|
void render(std::vector<ScreenCell> &buffer, Coord size, Coord pos) override;
|
|
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
|