-
Notifications
You must be signed in to change notification settings - Fork 11
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
Zoom buttons need magnifying glasses #620
Comments
The play area zoom buttons already have magnifying glasses, so I'll move this to the AC milestone. |
I opened phetsims/scenery-phet#647, but the play area zoom buttons look like this: Should the chart zoom buttons look identical to the play area zoom buttons? If so, what styling/coloring should we use? |
I discussed this with @pixelzoom in phetsims/scenery-phet#647 and on slack. His opinion was that the +/- buttons are already perfectly clear in context, and that adding the complexity of changing icons for the ZoomButtonGroup is unwarranted. I recommend we do one of the following (no particular order):
I'd recommend against a custom or one-off solution for this case. @arouinfar @ariel-phet @kathy-phet can you please recommend how to proceed? |
If you add the ability to use magnify glass icons, you'll also need to factor that icon out of ZoomButton. Or even better, switch to using the fontawesome icons for the magnifying glasses: https://fontawesome.com/icons/search-plus?style=solid |
Would it be OK if ZoomButtonGroup was hardcoded to use the magnifying glass icons? |
Do you mean as an option, or instead of +/- ? |
And I'm still trying to understand... If you want the ZoomButton look (magnifying glasses) why not just use a pair of ZoomButtons? That's what has been done in other sims that use "magnifying glass" zoom buttons. What's special about CCK, and why does it need to use ZoomButtonGroup? Why create a 3rd variation on zoom buttons? |
It would simplify things if we can use the same icons everywhere. But if we need flexibility, then we should make it possible/easy to specify any icon.
ZoomButtonGroup adds:
Why should this be duplicated? |
Changing the icons to magnifying glasses is not OK with me, strong pushback. The primary reason for writing ZoomButtonGroup was to provide a cleaner, more modern look to zoom buttons, similar to what's used in many web interfaces (Google maps, etc.) -- intentionally and specifically without magnifying glasses. |
If you want to add the ability to show magnifying glass icons to ZoomButtonGroup, you'll need at least 2 options:
Then you'll have the problem that some options (e.g. textOptions and fontAwesomeOptions) are ignored depending on which the type of icons displayed. Again, clunky. Another approach would be to make ZoomButtonGroup a base class, with subclasses that pass in the desired icons nodes. That would probably be preferable to complicating the ZoomButtonGroup API. |
class ZoomButtonGroup extends LayoutBox {
constructor( zoomInIcon, zoomOutIcon, zoomLevelProperty, options ) {
...
}
}
class PlusMinusZoomButtonGroup extends ZoomButtonGroup {
constructor( zoomLevelProperty, options ) {
options = merge( {
textOptions: {...}
...
}, options );
const zoomInIcon = new RectangularPushButton( {
new Text( MathSymbols.PLUS, options.textOptions )
} );
const zoomOutIcon = new RectangularPushButton( {
new Text( MathSymbols.MINUS, options .textOptions )
} );
super( zoomInIcon, zoomOutIcon, zoomLevelProperty, options );
}
}
class MagnifyingGlassZoomButtonGroup extends ZoomButtonGroup {
constructor( zoomLevelProperty, options ) {
options = merge( {
fontawesomeNodeOptions: {...}
...
}, options );
const zoomInIcon = new FontAwesomeNode( 'search-plus-solid', options.fontawesomeNodeOptions );
const zoomOutIcon = new FontAwesomeNode( 'search-minus-solid', options.fontawesomeNodeOptions );
super( zoomInIcon, zoomOutIcon, zoomLevelProperty, options );
}
} This approach also supports the "future", when PhET needs a 4th way to do zoom buttons. |
The preceding proposal #620 (comment) looks good to me, let me know if you would like me to implement it. |
If you need it now, go for it. You'll need to add the fontawesome glyphs to FontAwesomeNode.js. EDIT: I'll be happy to review. |
Before you begin... I'm still skeptical that any of this is needed. I haven't heard a response to why this is needed for CCK (+/- seems clear to me in the context of the chart), and why it's desirable to have 3 different "looks" for zoom buttons in PhET sims. |
In #620 (comment), you said:
I should also point out that these buttons will not look identical to the play area zoom buttons. They will be using fontawesome icons. And they will not be separated by space. And if you have thoughts about adding that space to ZoomButtonGroup, that's going to complicate the pointer areas, which are currently implemented based on the assumption that the there is no space between the buttons, and the pointer areas therefore need to be shifted. |
OK let's wait until we hear from designers. @kathy-phet @arouinfar or @ariel-phet the main questions are:
@pixelzoom please add other questions if I missed anything. |
I committed as @pixelzoom and I discussed. @pixelzoom do you have time to review? If not, please reassign to @ariel-phet to request another reviewer. UPDATE: After review is complete, we can open a chip-away issue to migrate from ZoomButton to ZoomButtonGroup. |
I added one more commit to use the magnifying glasses in the CCK chart. |
A bit of cleanup needed. I addressed these things in commit phetsims/scenery-phet@7e7e5bd:
Back to @samreid for review of these changes. Then feel free to close. |
I reviewed the changes and did not have further recommendations, thanks! Closing. |
From today's design meeting, "+" and "-" are overloaded in CCK, and showing those as button icons without other context will be confusing. We need the magnifying glass icons. This is for the charts and for the play area zoom buttons.
@ariel-phet also indicated the flat buttons are good.
The text was updated successfully, but these errors were encountered: