Merge pull request #931 from kallanreed/cursor_text_input

Add a TextField widget that supports a cursor.
This commit is contained in:
gullradriel
2023-04-30 17:28:42 +02:00
committed by GitHub
6 changed files with 218 additions and 80 deletions

View File

@@ -43,7 +43,7 @@ int Painter::draw_char(const Point p, const Style& style, const char c) {
}
int Painter::draw_string(Point p, const Font& font, const Color foreground,
const Color background, const std::string text) {
const Color background, const std::string& text) {
bool escape = false;
size_t width = 0;
@@ -71,7 +71,7 @@ int Painter::draw_string(Point p, const Font& font, const Color foreground,
return width;
}
int Painter::draw_string(Point p, const Style& style, const std::string text) {
int Painter::draw_string(Point p, const Style& style, const std::string& text) {
return draw_string(p, style.font, style.foreground, style.background, text);
}

View File

@@ -49,8 +49,8 @@ public:
int draw_char(const Point p, const Style& style, const 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);
const Color background, const std::string& text);
int draw_string(Point p, const Style& style, const std::string& text);
void draw_bitmap(const Point p, const Bitmap& bitmap, const Color background, const Color foreground);