plugins: vu_meter: enable theme for submenus

Also properly handle situation where theme is already
enabled at launch.

Change-Id: Ic7b3dcf38e77f6e9d6ef4a5512f729e47880e46c
This commit is contained in:
Christian Soffke 2025-12-26 09:27:12 +01:00
parent 17ea0bb82e
commit 06af1090bb

View file

@ -685,6 +685,8 @@ static bool vu_meter_menu(void)
{ "Very Slow", -1 },
};
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, true, NULL);
while (!menu_quit) {
switch(rb->do_menu(&menu, &selection, NULL, false))
{
@ -744,6 +746,8 @@ static bool vu_meter_menu(void)
break;
}
}
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
/* the menu uses the userfont, set it back to sysfont */
rb->lcd_setfont(FONT_SYSFIXED);
return exit;
@ -948,6 +952,9 @@ static void vu_meter_cleanup(void)
{
/* Turn on backlight timeout (revert to settings) */
backlight_use_settings();
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
}
enum plugin_status plugin_start(const void* parameter)
@ -973,6 +980,10 @@ enum plugin_status plugin_start(const void* parameter)
/* Turn off backlight timeout */
backlight_ignore_timeout();
/* undo in vu_meter_cleanup */
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, false, NULL);
while (1)
{
rb->lcd_clear_display();