mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-24 16:39:04 +00:00
Make Widget flags private, expose via methods.
This commit is contained in:
@@ -129,7 +129,7 @@ public:
|
||||
Entries& recent
|
||||
) : recent { recent }
|
||||
{
|
||||
flags.focusable = true;
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
void paint(Painter& painter) override {
|
||||
|
||||
@@ -32,17 +32,19 @@ void MenuItemView::select() {
|
||||
}
|
||||
|
||||
void MenuItemView::highlight() {
|
||||
set_highlight(true);
|
||||
set_highlighted(true);
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void MenuItemView::unhighlight() {
|
||||
set_highlight(false);
|
||||
set_highlighted(false);
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void MenuItemView::paint(Painter& painter) {
|
||||
const auto r = screen_rect();
|
||||
|
||||
const auto paint_style = (flags.highlighted && parent()->has_focus()) ? style().invert() : style();
|
||||
const auto paint_style = (highlighted() && parent()->has_focus()) ? style().invert() : style();
|
||||
|
||||
const auto font_height = paint_style.font.line_height();
|
||||
|
||||
@@ -58,11 +60,6 @@ void MenuItemView::paint(Painter& painter) {
|
||||
);
|
||||
}
|
||||
|
||||
void MenuItemView::set_highlight(const bool value) {
|
||||
flags.highlighted = value;
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
/* MenuView **************************************************************/
|
||||
|
||||
MenuView::~MenuView() {
|
||||
|
||||
@@ -53,8 +53,6 @@ public:
|
||||
|
||||
private:
|
||||
const MenuItem item;
|
||||
|
||||
void set_highlight(const bool value);
|
||||
};
|
||||
|
||||
class MenuView : public View {
|
||||
@@ -62,7 +60,7 @@ public:
|
||||
std::function<void(void)> on_left;
|
||||
|
||||
MenuView() {
|
||||
flags.focusable = true;
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
~MenuView();
|
||||
|
||||
@@ -38,7 +38,7 @@ FrequencyField::FrequencyField(
|
||||
length_ { 11 },
|
||||
range(rf::tuning_range)
|
||||
{
|
||||
flags.focusable = true;
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
rf::Frequency FrequencyField::value() const {
|
||||
|
||||
Reference in New Issue
Block a user