mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-05 06:19:03 +00:00
Auto update ext apps (#3046)
* first naive impl * Unregister sdcard notification * btngrid reload_items fixed * format-code * Avoid some unnecessary updates * clear empty space after removing items * Fix displaying sdcard error after inserting card while running * format code * Eliminate multiple update_items() calls from on_populate() And call it only once after on_populate() * update_items() only once when showing btngrid * normalize offset when menu item count decreases
This commit is contained in:
@@ -71,7 +71,7 @@ class BtnGridView : public View {
|
||||
bool show_arrows{true}; // flag used to hide arrows in main menu
|
||||
void show_arrows_enabled(bool enabled);
|
||||
|
||||
bool set_highlighted(int32_t new_value);
|
||||
bool set_highlighted(int32_t new_value, bool force_update = false);
|
||||
uint32_t highlighted_index();
|
||||
|
||||
void set_parent_rect(const Rect new_parent_rect) override;
|
||||
@@ -88,6 +88,7 @@ class BtnGridView : public View {
|
||||
bool on_encoder(const EncoderEvent event) override;
|
||||
bool blacklisted_app(GridItem new_item);
|
||||
|
||||
void reload_items();
|
||||
void update_items();
|
||||
void set_btn_height_fixed(uint8_t h) {
|
||||
button_h = h;
|
||||
@@ -116,6 +117,7 @@ class BtnGridView : public View {
|
||||
size_t displayed_max{0};
|
||||
size_t highlighted_item{0};
|
||||
size_t offset{0};
|
||||
SignalToken sd_card_status_signal_token{};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
||||
Reference in New Issue
Block a user