mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-22 01:37:46 +00:00
Add edit support for Notepad (#1093)
* WIP file editing * WIP file editing * Add "on_pop" handler to navigation. * WIP Editing * WIP for draft * Fix mock and unit tests, support +newline at end. * Clean up Painter API and use string_view * Fix optional rvalue functions * Fix Result 'take' to be more standard * FileWrapper stack buffer reads * Grasping at straws * Nit * Move set_on_pop impl to cpp * Workaround "Open" when file not dirty. --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "ui.hpp"
|
||||
#include "ui_text.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace ui {
|
||||
|
||||
@@ -46,24 +46,24 @@ class Painter {
|
||||
Painter(const Painter&) = delete;
|
||||
Painter(Painter&&) = delete;
|
||||
|
||||
int draw_char(const Point p, const Style& style, const char c);
|
||||
int draw_char(Point p, const Style& style, char c);
|
||||
|
||||
int draw_string(Point p, const Font& font, const Color foreground, const Color background, const std::string& text);
|
||||
int draw_string(Point p, const Style& style, const std::string& text);
|
||||
int draw_string(Point p, const Style& style, std::string_view text);
|
||||
int draw_string(Point p, const Font& font, Color foreground, Color background, std::string_view text);
|
||||
|
||||
void draw_bitmap(const Point p, const Bitmap& bitmap, const Color background, const Color foreground);
|
||||
void draw_bitmap(Point p, const Bitmap& bitmap, Color background, Color foreground);
|
||||
|
||||
void draw_rectangle(const Rect r, const Color c);
|
||||
void fill_rectangle(const Rect r, const Color c);
|
||||
void fill_rectangle_unrolled8(const Rect r, const Color c);
|
||||
void draw_rectangle(Rect r, Color c);
|
||||
void fill_rectangle(Rect r, Color c);
|
||||
void fill_rectangle_unrolled8(Rect r, Color c);
|
||||
|
||||
void paint_widget_tree(Widget* const w);
|
||||
void paint_widget_tree(Widget* w);
|
||||
|
||||
void draw_hline(Point p, int width, const Color c);
|
||||
void draw_vline(Point p, int height, const Color c);
|
||||
void draw_hline(Point p, int width, Color c);
|
||||
void draw_vline(Point p, int height, Color c);
|
||||
|
||||
private:
|
||||
void paint_widget(Widget* const w);
|
||||
void paint_widget(Widget* w);
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
Reference in New Issue
Block a user