Merge pull request #2102 from ia/soldering-home-no-slide

Disable animation between home and soldering screens if detailed view is set for both modes (probably a finally proper fix for #2076)
This commit is contained in:
Ivan Zorin
2025-03-09 04:15:05 +03:00
committed by GitHub
3 changed files with 10 additions and 4 deletions

View File

@@ -160,6 +160,7 @@ void guiRenderLoop(void) {
memset(&context.scratch_state, 0, sizeof(context.scratch_state));
currentOperatingMode = newMode;
}
// If the transition marker is set, we need to make the next draw occur to the secondary buffer so we have something to transition to
if (context.transitionMode != TransitionAnimation::None) {
OLED::useSecondaryFramebuffer(true);

View File

@@ -37,7 +37,8 @@ OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
break;
case BUTTON_F_SHORT:
if (!isTipDisconnected()) {
cxt->transitionMode = TransitionAnimation::Left;
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Left;
return OperatingMode::Soldering;
}
break;

View File

@@ -47,6 +47,8 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
}
return OperatingMode::Soldering;
}
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
// otherwise we are unlocked
switch (buttons) {
case BUTTON_NONE:
@@ -56,7 +58,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
case BUTTON_BOTH:
/*Fall through*/
case BUTTON_B_LONG:
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
case BUTTON_F_LONG:
// if boost mode is enabled turn it on
@@ -142,10 +144,12 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
} else {
ui_draw_soldering_basic_status(cxt->scratch_state.state2);
}
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
// Check if we should bail due to undervoltage for example
if (checkExitSoldering()) {
setBuzzer(false);
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
}
#ifdef NO_SLEEP_MODE
@@ -153,7 +157,7 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
if (shouldShutdown()) {
// shutdown
currentTempTargetDegC = 0;
cxt->transitionMode = TransitionAnimation::Right;
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
return OperatingMode::HomeScreen;
}
#endif