mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-02 03:26:40 -04:00
SymField rewrite (#1444)
* First WIP symfield * Cleanup widget code * Rebase and format * Fix 'to_integer' bug, fix siggen UI. * to_string_hex fix, unit tests for string code * Pass instance in callback * Fix on_change callbacks * Fix keyfob (not active) * to_byte_array, coaster tx cleanup * Add to_byte_array tests * Changes in ui_numbers * Fix ui_encoders * Format * Fix modemsetup view's symfields * Remove header * Format
This commit is contained in:
parent
70e0f2913f
commit
af424aa5f8
30 changed files with 607 additions and 371 deletions
|
@ -37,6 +37,29 @@ struct Style {
|
|||
Style invert() const;
|
||||
};
|
||||
|
||||
/* Sometimes mutation is just the more readable thing... */
|
||||
struct MutableStyle {
|
||||
const Font* font;
|
||||
Color background;
|
||||
Color foreground;
|
||||
|
||||
MutableStyle(const Style& s)
|
||||
: font{&s.font},
|
||||
background{s.background},
|
||||
foreground{s.foreground} {}
|
||||
|
||||
void invert() {
|
||||
std::swap(background, foreground);
|
||||
}
|
||||
|
||||
operator Style() const {
|
||||
return {
|
||||
.font = *font,
|
||||
.background = background,
|
||||
.foreground = foreground};
|
||||
}
|
||||
};
|
||||
|
||||
class Widget;
|
||||
|
||||
class Painter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue