-
Notifications
You must be signed in to change notification settings - Fork 6
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
Can MassControl be replaced by a number control? #81
Comments
I noticed this in the old code. How important is this to be a floor and not a round? valueLabel.text = StringUtils.format( pattern0Value1UnitsString, Math.floor( value ), unitsKgString ); |
First commit above, lint is passing, most features working.
I no longer recommend to do this, after testing with right-aligned it seems to better convey the change in numbers. To Do:
|
@pixelzoom said:
|
Here's how far I got by eliminating duplicated code and Reusing NumberControl: @ariel-phet is this close enough? You can test on phettest.colorado.edu to see it in action. Should we slightly round the corners of the text box? Anything else to change? EDIT: when making recommendations, please be clear whether (a) they should be changed directly in NumberControl and thus fixed everywhere NumberControl appears or (b) leave the defaults alone in NumberControl, but generalize it so it can be different for this case. |
|
Sounds good, thanks for the review.
After experimenting with both, I realized it much easier to visually understand the orders of magnitude in the "right-aligned" one, because the "kg" marker stays in the same spot and you can see the numbers bumping to the left as they go up by orders of magnitude. In the centered strategy (which I originally thought looked more appealing), this effect is washed out. But I agree we should add this as an option for potential usage in other contexts. |
Use NumberControl option
Use NumberControl option |
@pixelzoom argued that the amount of rounding should remain application specific, since it is in pixels, and he recommended to just supply the corner radius from the sim. Hence I'll proceed with that for now. |
@ariel-phet would you like to review? |
@samreid looks good to me. However, we should also check with @arouinfar since she is the lead designer for this sim. @arouinfar this looks pretty good to me but I would have two main questions unless you see other tweaks:
|
In general, things look pretty good to me @samreid @ariel-phet.
It looks fine to me, since the text at max width is centered within the readout.
At first glance it looks reasonable, though when comparing the slider track the alignment seems a bit off. I have a slight preference for aligning the tweakers to the tick marks instead.
Agreed. I think 1 or 2 px would do the trick. |
In the above commit, I reduced the tickLabelSpacing from 6 to 2, it now looks like this: @arouinfar anything else to do here? You can test in context on phettest if you wish. |
Looks good to me @samreid. |
Discovered during #78, I noticed that MassControl has 129 lines of code to render this:
Can we instead use some pre-existing number control?
The text was updated successfully, but these errors were encountered: