mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 12:23:06 +02:00
Alternative solution with more code lines in different functions
This commit is contained in:
@@ -161,13 +161,6 @@ void guiRenderLoop(void) {
|
||||
currentOperatingMode = newMode;
|
||||
}
|
||||
|
||||
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
|
||||
if (detailedView &&
|
||||
((newMode == OperatingMode::HomeScreen && context.previousMode == OperatingMode::Soldering) || (newMode == OperatingMode::Soldering && context.previousMode == OperatingMode::HomeScreen))) {
|
||||
// Exclude side-slide-scroll animation if we do transition between soldering/home back and forth while detailed view setting for both modes is set
|
||||
return OLED::refresh();
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user