1
0
forked from me/IronOS

Only play navigation animation when menus changed

This commit is contained in:
Patrick Horlebein
2020-04-06 17:39:05 +02:00
parent ec6140317c
commit bbb724e8f0

View File

@@ -823,6 +823,8 @@ void gui_Menu(const menuitem *menu) {
int16_t lastOffset = -1;
bool lcdRefresh = true;
ButtonState lastButtonState = BUTTON_NONE;
static bool enterGUIMenu = true;
enterGUIMenu = true;
if (menu[currentScreen].draw.func != NULL) {
uint8_t secondFrameBuffer[OLED_WIDTH * 2];
@@ -882,14 +884,18 @@ void gui_Menu(const menuitem *menu) {
// increment
if (descriptionStart == 0) {
if (menu[currentScreen].incrementHandler.func != NULL) {
enterGUIMenu = false;
menu[currentScreen].incrementHandler.func();
// MARK: Might jump in submenu here
OLED::use_second_buffer();
OLED::setFont(0);
OLED::setCursor(0, 0);
OLED::clearScreen();
menu[currentScreen].draw.func();
OLED::presentSecondScreenBufferAnimatedBack();
if (enterGUIMenu) {
uint8_t secondFrameBuffer[OLED_WIDTH * 2];
OLED::set_framebuffer(secondFrameBuffer);
OLED::setFont(0);
OLED::setCursor(0, 0);
OLED::clearScreen();
menu[currentScreen].draw.func();
OLED::presentSecondScreenBufferAnimatedBack();
}
} else {
earlyExit = true;
}