mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-19 19:42:24 -05:00
Refined Tx Random Data (Still WIP) (#1616)
* managing initial cursor * work on adding marked cursors
This commit is contained in:
parent
cca0e18f5a
commit
b7b4a10485
4 changed files with 134 additions and 26 deletions
|
|
@ -59,7 +59,7 @@ class TextViewer : public Widget {
|
|||
bool on_key(KeyEvent key) override;
|
||||
bool on_encoder(EncoderEvent delta) override;
|
||||
|
||||
void redraw(bool redraw_text = false);
|
||||
void redraw(bool redraw_text = false, bool redraw_marked = false);
|
||||
|
||||
void set_file(FileWrapper& file) { reset_file(&file); }
|
||||
void clear_file() { reset_file(); }
|
||||
|
|
@ -71,6 +71,11 @@ class TextViewer : public Widget {
|
|||
|
||||
void cursor_home();
|
||||
void cursor_end();
|
||||
void cursor_set(uint16_t line, uint16_t col);
|
||||
void cursor_mark_selected();
|
||||
|
||||
typedef std::pair<uint16_t, uint16_t> LineColPair;
|
||||
std::vector<LineColPair> pairedVector{};
|
||||
|
||||
// Gets the length of the current line.
|
||||
uint16_t line_length();
|
||||
|
|
@ -97,6 +102,7 @@ class TextViewer : public Widget {
|
|||
|
||||
void paint_text(Painter& painter, uint32_t line, uint16_t col);
|
||||
void paint_cursor(Painter& painter);
|
||||
void paint_marked(Painter& painter);
|
||||
|
||||
void reset_file(FileWrapper* file = nullptr);
|
||||
|
||||
|
|
@ -111,6 +117,8 @@ class TextViewer : public Widget {
|
|||
uint32_t first_line{};
|
||||
uint16_t first_col{};
|
||||
bool redraw_text{true};
|
||||
bool redraw_marked{false};
|
||||
bool mark_change{true};
|
||||
} paint_state_{};
|
||||
|
||||
struct {
|
||||
|
|
@ -121,6 +129,8 @@ class TextViewer : public Widget {
|
|||
// Pixel buffer used for cursor XOR'ing - Max cursor width = Max char width + 1
|
||||
ColorRGB888 pixel_buffer8[ui::char_width + 1]{};
|
||||
Color pixel_buffer[ui::char_width + 1]{};
|
||||
|
||||
bool mark_change{true};
|
||||
} cursor_{};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue