Skip to content

Commit 42aeee1

Browse files
committed
Alternative solution with more code lines in different functions
1 parent 11d9f1a commit 42aeee1

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

source/Core/Threads/GUIThread.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,6 @@ void guiRenderLoop(void) {
161161
currentOperatingMode = newMode;
162162
}
163163

164-
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
165-
if (detailedView &&
166-
((newMode == OperatingMode::HomeScreen && context.previousMode == OperatingMode::Soldering) || (newMode == OperatingMode::Soldering && context.previousMode == OperatingMode::HomeScreen))) {
167-
// Exclude side-slide-scroll animation if we do transition between soldering/home back and forth while detailed view setting for both modes is set
168-
return OLED::refresh();
169-
}
170-
171164
// 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
172165
if (context.transitionMode != TransitionAnimation::None) {
173166
OLED::useSecondaryFramebuffer(true);

source/Core/Threads/UI/logic/HomeScreen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ OperatingMode handleHomeButtons(const ButtonState buttons, guiContext *cxt) {
3737
break;
3838
case BUTTON_F_SHORT:
3939
if (!isTipDisconnected()) {
40-
cxt->transitionMode = TransitionAnimation::Left;
40+
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
41+
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Left;
4142
return OperatingMode::Soldering;
4243
}
4344
break;

source/Core/Threads/UI/logic/Soldering.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
4747
}
4848
return OperatingMode::Soldering;
4949
}
50+
51+
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
5052
// otherwise we are unlocked
5153
switch (buttons) {
5254
case BUTTON_NONE:
@@ -56,7 +58,7 @@ OperatingMode handleSolderingButtons(const ButtonState buttons, guiContext *cxt)
5658
case BUTTON_BOTH:
5759
/*Fall through*/
5860
case BUTTON_B_LONG:
59-
cxt->transitionMode = TransitionAnimation::Right;
61+
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
6062
return OperatingMode::HomeScreen;
6163
case BUTTON_F_LONG:
6264
// if boost mode is enabled turn it on
@@ -142,18 +144,20 @@ OperatingMode gui_solderingMode(const ButtonState buttons, guiContext *cxt) {
142144
} else {
143145
ui_draw_soldering_basic_status(cxt->scratch_state.state2);
144146
}
147+
148+
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering);
145149
// Check if we should bail due to undervoltage for example
146150
if (checkExitSoldering()) {
147151
setBuzzer(false);
148-
cxt->transitionMode = TransitionAnimation::Right;
152+
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
149153
return OperatingMode::HomeScreen;
150154
}
151155
#ifdef NO_SLEEP_MODE
152156

153157
if (shouldShutdown()) {
154158
// shutdown
155159
currentTempTargetDegC = 0;
156-
cxt->transitionMode = TransitionAnimation::Right;
160+
cxt->transitionMode = detailedView ? TransitionAnimation::None : TransitionAnimation::Right;
157161
return OperatingMode::HomeScreen;
158162
}
159163
#endif

0 commit comments

Comments
 (0)