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:
E.T.
2026-03-02 12:35:45 +01:00
committed by GitHub
parent 6b663894b0
commit f489d43259
3 changed files with 46 additions and 17 deletions
+3 -1
View File
@@ -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 */