-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[WIP] New Edit Screen for TFT_COLOR_UI + TOUCH #25649
base: bugfix-2.1.x
Are you sure you want to change the base?
[WIP] New Edit Screen for TFT_COLOR_UI + TOUCH #25649
Conversation
Fully implemented increment edit screen Basic implementation of keypad using numbers to store the value
Keypad is full featured with some bugs, which are commented in code Only for 320x240 Landscape so far
…-with-more-controls
…-with-more-controls
…ukasradek/Marlin into Edit-screen-with-more-controls
Add conditional directive for touch.h
f1cab04
to
9b92dfa
Compare
Can you make this change optional? The current method allows you to drag a slider to easily change temperature or fan speed (along with a ➕ & ➖and a ✔️ to confirm for finer adjustments) which already works really well, even on a 3.5” TFT. |
It is fully backward compatible, that was my main goal. I like the slider as well. The issue I had with it was that it was hard to touch the right spot - because there was no scale and because the granularity is simply not high enough. So ➕➖ adjustment was always needed one unit at a time. The slider still works as before, but on top of that there is min/max to show scale and allow one touch min/max values. So from usability standpoint there should be no reason to prefer the current version. |
There is no config option in this PR to disable these new changes.
Have you tried tapping + holding + dragging the slider? This will allow you to set your desired temperature accurately.
I prefer the old/current version because it's a cleaner UI for those screens (hence the ask to make this change optional). |
Fully backward compatible feature-wise. However as mentioned, it can be easily adapted to be configurable. I am not overriding the original code (ui.encoderPosition mechanism for example) but building on top of it mostly.
Sure, I tried and I am using it that way. But on 3D printers, touchscreens are usually low quaility (resistive, small,..)... meaning the finger doesn't slide that well, the screen / Marlin also isn't that responsive either (ie. vs. phones) and in case of hotend temp, there is 280 (or more) units crammed into like 6 centimeters of the slider (5 per milimeter). I have the 3.5" (so you can be sure I will test it properly for those sizes 🙂) and my current process is.
The upgrades to the slider screen make it a bit easier and precise and with
In the same way setting min or max value just using the slider also isn't that easy since you would have to tap the exact edge of the touch area.
I look at it as a tool, so usable is more important than clean for me... but that sure can be up to the user, how he configures it 🙂. |
de391db
to
0f34163
Compare
Actually setting min or max value is super easy as you do not need to tap at the exact edge location. |
First of all... is there a need to raise counterarguments. Are there any downsides to my solution or are we just argumenting for no reason? 🙂 I have come from the default TronXY chitu firmware, which is a far cry from Marlin. But there were some things I really miss in COLOR_UI. One of them being the feature that you can click the edit item icon (e.g. heatbed) and it will reset to 0 or set to reasonable value (70 in case of heatbed). Simple and elegant way to quickly switch to practical values. |
Yes. I had a basic request to make your changes optional since the current temperature settings menu has a simplified UI and tapping + dragging works well, even on 2.4" screens as jmz52 stated. |
And I have replied you will have it 😉. |
It was an explanation how the slider works. Slider was specifically designed in a way that allows reliably set min and max values by dragging slider over the edge. As for feedback:
|
For me, only issue with slider is that tick is a bit too fast, i always overshoot couple degrees while holding buttons. |
Marlin/src/libs/numtostr.cpp
Outdated
int8_t intEnd = 7; | ||
uint8_t dig = 0; | ||
uint32_t div = 1; | ||
for (;intEnd >= 0 && (((float)intVal / div) >= 1 || ((float)decimal / div) >= 1);intEnd--) { |
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.
Save a few cycles by skipping cast and division since…
((float)intVal / div) >= 1
==(intVal >= div)
((float)decimal / div) >= 1
==(decimal >= div)
As I mentioned above.
Furthermore I guess this UI will be turned on by a flag in Configuration(_adv).h that will be inside
I do not anticipate a problem, but I will make sure it works.
There is no proposed change in precision. The precision is strictly given by the |
@jmz52 , It would be helpful to display min, and max values anyway. The min and max could be made clickable, so users could select "100% fan" in a single click rather than unreliable swiping. Could you please list more cases when you think sliders are helpful? For instance:
@lukasradek , have you considered implementing several +- buttons like in #26230 ? I guess it would make tuning easier: +-1, +-0.1, ... would be a single click only, and users won't need to remember if they are in "+-10" or "+-1" mode. Have you considered adding "cancel" button, so users could cancel the edit without saving changes? |
Hello @vlsi , yes, I agree with most of your suggestions and they have been considered. |
c624e13
to
e6f1b07
Compare
9c65146
to
4f65466
Compare
c792921
to
37fb26b
Compare
37d77d6
to
aa44542
Compare
1bfb3ab
to
85b1bf9
Compare
85b1bf9
to
f458f87
Compare
I did my best to adapt the code to the updated unified Color UI layout, but a few things have changed in our methods, so new keypad button code will be needed. The bonus is that the new code can apply to all screen sizes. Note that for larger screen sizes we could implement G-code entry and other fancy key inputs. Touch behavior could use some adjustment. Touches on screens that have persistent sensing should highlight a button/menu item, and then only activate when the touch ends. This could help prevent hitting nearby items by mistake. |
Description
While the clever people implement cutting edge features into Marlin, UI is sometimes being left behind.
So that's where the dumb folks step in... and so I decided to improve Edit Screens a bit 😉.
It is still work in progress but the main UI goals are:
I also added a few codebase goals after I looked into the code:
CALLBACK
type touch control (there was actually atodo
for something like that in the code 🙂) and adding some higher level methods to draw nicer buttons.As mentioned... this is a Work In Progress, the code is messy, there are a few bugs (that I know of) and as of posting this it works only on 320x240 landscape.
Feedback is welcome!
Requirements & Config
TFT_COLOR_UI - 320x240 Landscape
Touchscreen
Other than that, standard config will suffice.
Benefits
Better usability. A bit nicer.
Eye candy
(although a bit sour)