mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Only play navigation animation when menus changed
This commit is contained in:
@@ -823,6 +823,8 @@ void gui_Menu(const menuitem *menu) {
|
|||||||
int16_t lastOffset = -1;
|
int16_t lastOffset = -1;
|
||||||
bool lcdRefresh = true;
|
bool lcdRefresh = true;
|
||||||
ButtonState lastButtonState = BUTTON_NONE;
|
ButtonState lastButtonState = BUTTON_NONE;
|
||||||
|
static bool enterGUIMenu = true;
|
||||||
|
enterGUIMenu = true;
|
||||||
|
|
||||||
if (menu[currentScreen].draw.func != NULL) {
|
if (menu[currentScreen].draw.func != NULL) {
|
||||||
uint8_t secondFrameBuffer[OLED_WIDTH * 2];
|
uint8_t secondFrameBuffer[OLED_WIDTH * 2];
|
||||||
@@ -882,14 +884,18 @@ void gui_Menu(const menuitem *menu) {
|
|||||||
// increment
|
// increment
|
||||||
if (descriptionStart == 0) {
|
if (descriptionStart == 0) {
|
||||||
if (menu[currentScreen].incrementHandler.func != NULL) {
|
if (menu[currentScreen].incrementHandler.func != NULL) {
|
||||||
|
enterGUIMenu = false;
|
||||||
menu[currentScreen].incrementHandler.func();
|
menu[currentScreen].incrementHandler.func();
|
||||||
// MARK: Might jump in submenu here
|
|
||||||
OLED::use_second_buffer();
|
if (enterGUIMenu) {
|
||||||
OLED::setFont(0);
|
uint8_t secondFrameBuffer[OLED_WIDTH * 2];
|
||||||
OLED::setCursor(0, 0);
|
OLED::set_framebuffer(secondFrameBuffer);
|
||||||
OLED::clearScreen();
|
OLED::setFont(0);
|
||||||
menu[currentScreen].draw.func();
|
OLED::setCursor(0, 0);
|
||||||
OLED::presentSecondScreenBufferAnimatedBack();
|
OLED::clearScreen();
|
||||||
|
menu[currentScreen].draw.func();
|
||||||
|
OLED::presentSecondScreenBufferAnimatedBack();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
earlyExit = true;
|
earlyExit = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user