mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-12 17:49:31 +00:00
Sync
This commit is contained in:
@@ -361,13 +361,22 @@ void Text::set(const std::string value) {
|
||||
}
|
||||
|
||||
void Text::paint(Painter& painter) {
|
||||
if (style_ == nullptr) style_ = &style();
|
||||
|
||||
painter.draw_string(
|
||||
screen_pos(),
|
||||
style(),
|
||||
(*style_),
|
||||
text
|
||||
);
|
||||
}
|
||||
|
||||
void Text::set_style(const Style* new_style) {
|
||||
if( new_style != style_ ) {
|
||||
style_ = new_style;
|
||||
set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/* Checkbox **************************************************************/
|
||||
|
||||
void Checkbox::set_text(const std::string value) {
|
||||
@@ -641,6 +650,12 @@ void OptionsField::set_by_value(value_t v) {
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsField::set_options(options_t new_options) {
|
||||
options = new_options;
|
||||
set_by_value(0);
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void OptionsField::paint(Painter& painter) {
|
||||
const auto paint_style = has_focus() ? style().invert() : style();
|
||||
|
||||
|
||||
@@ -220,11 +220,13 @@ public:
|
||||
}
|
||||
|
||||
void set(const std::string value);
|
||||
|
||||
void set_style(const Style* new_style);
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
private:
|
||||
std::string text;
|
||||
const Style* style_ { nullptr };
|
||||
};
|
||||
|
||||
class Checkbox : public Widget {
|
||||
@@ -315,6 +317,8 @@ public:
|
||||
{
|
||||
flags.focusable = true;
|
||||
}
|
||||
|
||||
void set_options(options_t new_options);
|
||||
|
||||
size_t selected_index() const;
|
||||
void set_selected_index(const size_t new_index);
|
||||
|
||||
Reference in New Issue
Block a user