-
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
Should labels in carousel be instrumented? #869
Comments
2/24/22 design meeting, we would like to make the strings in the carousel customizable. Additionally, the |
Patch with current status: Index: js/view/CircuitElementToolNode.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/view/CircuitElementToolNode.ts b/js/view/CircuitElementToolNode.ts
--- a/js/view/CircuitElementToolNode.ts (revision e04cc3b4724ea7486dfbe46ad27e4edb6b01e192)
+++ b/js/view/CircuitElementToolNode.ts (date 1646872159589)
@@ -45,14 +45,21 @@
constructor( labelText: string, showLabelsProperty: Property<boolean>, viewTypeProperty: Property<CircuitElementViewType>,
circuit: Circuit, globalToCircuitLayerNodePoint: ( v: Vector2 ) => Vector2, iconNode: Node, maxNumber: number,
count: () => number, createElement: ( v: Vector2 ) => CircuitElement, providedOptions?: any ) {
- const labelNode = new Text( labelText, { fontSize: 12, maxWidth: TOOLBOX_ICON_WIDTH } );
- showLabelsProperty.linkAttribute( labelNode, 'visible' );
+
+ let labelNode: Node | any = null;
+ if ( labelText.length > 0 ) {
+ labelNode = new Text( labelText, {
+ fontSize: 12, maxWidth: TOOLBOX_ICON_WIDTH,
+ tandem: providedOptions.tandem.createTandem( 'label' )
+ } );
+ showLabelsProperty.linkAttribute( labelNode, 'visible' );
+ }
providedOptions = merge( {
spacing: 2, // Spacing between the icon and the text
cursor: 'pointer',
// hack because the series ammeter tool node has text rendered separately (joined with probe ammeter)
- children: labelText.length > 0 ? [ iconNode, labelNode ] : [ iconNode ],
+ children: labelNode ? [ iconNode, labelNode ] : [ iconNode ],
// Expand touch area around text, see https://github.com/phetsims/circuit-construction-kit-dc/issues/82
touchAreaExpansionLeft: 0, |
Implemented above (and made visibleProperty readonly). Ready for review. |
Thanks @samreid. I'm not sure where these changes fell in relation to the changes made in phetsims/chipper#1302. However, reviewing master, each carousel item has a link back to the appropriate |
The labels in the toolbox are instrumented and clients can customize the strings.
Should we do the same for the labels in the carousel?
The text was updated successfully, but these errors were encountered: