-
-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable animation between home and soldering screens if detailed view is set for both modes (probably a finally proper fix for #2076) #2102
Conversation
@discip, please, test this once you have time. I may be wrong but as far as I finally understand this is the exact fix that you were talking about. |
I tested this myself before making PR, but it seems it works and doesn't break anything else, hopefully. |
source/Core/Threads/GUIThread.cpp
Outdated
|
||
bool detailedView = getSettingValue(SettingsOptions::DetailedIDLE) && getSettingValue(SettingsOptions::DetailedSoldering); | ||
if (detailedView && | ||
((newMode == OperatingMode::HomeScreen && context.previousMode == OperatingMode::Soldering) || (newMode == OperatingMode::Soldering && context.previousMode == OperatingMode::HomeScreen))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ralim, just for fun: at first, right after looking for enum values of OperatingMode
, I was seriously thinking about something like newMode + context.previousMode == 1
, but then I thought that it's better to have a long line, than the twisted brain. :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, yeah those optimisations have bitten me in the past though. Let the compiler make them 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out loud here, would it be more logical to do these checks in the logic for the detailed
mode files; and just have them pick which transitionMode
to set on the context
?
That way we keep all their logic grouped and don't have magic overrides?
I thought that since we are handling animation here to tweak the animation behavior, then one line of basic logic checks all together in one place as closer to the main animation logic routine as possible would be more clear, short & simple, than stuffing different checks to different parts of code. Like in case with And considering the name of the directory with mentioned files - Or probably I was confused by you mentioning |
Ah sorry, you did what I intended, not what I said. Oops. You correctly figured what I meant, as in to put it in the logic for those views rather than a global override. |
I did confuse file names indeed, pardon me. However, for the sake of argument, to illustrate my main point here: one line of code with checks (and comment) in one place VS alternative solution in the latest commit with multiple scattered lines of code across functions in Is this your suggestion? But why? We have such a perfect place in |
You did what I meant so don't apologies.
Yeah this is a very classic question. The idea I'm going for here to keep the logic and concerns separate. In that, the main gui dispatch code should know only the absolute bare minimum about each screen and what its for. Mostly its job is to just handle calling the logic(), and get the stuff put on screen. Where as the "special logic" that can change per screen I'm trying to encapsulate into the UI/logic folder. That way if your looking for anything that involves "the home screen" its really only one place to go looking. This means I'm leaning more on the compiler to not be dumb and do a reasonable job minifying the generated code. But over time I've found its better at that, than people are at learning where all the code goes. So if you came to the code base having never seen it before, and you were looking for how the device acts when you do something on the home screen, I'm hoping that by putting it there its more obvious where to find it. Rather than finding code that contradicts what your seeing and you then have to start finding all references in the code base to find out where its overridden. If that makes sense; always keen for feedback, especially as I know this is a tradeoff around potential-for-optimisation vs human-maintainability. |
Most likely, this will happen in the evening. |
Please, take your time and let me know about the results, but don't merge it yet. Thanks. |
@ia Yeah, that’s exactly what I was hoping for back then. After all this time I got used to the way it currently works! 😃 In my opinion, this is not really necessary. However, feel free to do what you think is best. 😊 One more thought on that one: |
@discip, thanks for testing!
Thanks. Much appreciated as always.
Yeah, I know, it happens. :)
Yes-yes, I got it. But it was you who described the problem more clearly, than the original reporter.
But I think you both were right! That double-effect of side-scroll between home/idle and soldering, when both detailed modes are enabled, is more like a little ux bug, than feature. I'm glad we all came to the compromise. P.S. I really like you, guys. :) @Ralim, thank you as always for your very elaborative response explaining your perspective. I promise I will find some time to share my personal subjective opinion about the points you brought, but this weekend and the next week will be very busy for me, so I will be trying to keep up as harder as can, but probably very sporadically. |
Never a rush; and discussions are always welcome (you are welcome to tell me I'm wrong too 🙃 ) Thank you for taking this on:) |
What kind of change does this PR introduce?
Disable animation between home and soldering screens if detailed view is set for both modes.
What is the current behavior?
What is the new behavior (if this is a feature change)?
Other information: