From 4228ae54c6c175c442b777764b90191b1baded96 Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 14 Jun 2023 12:25:39 -0400 Subject: [PATCH] Update paper keyboard steps for number controls, see #315 --- .../view/prototype/QuadrilateralInputPreferencesNode.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/quadrilateral/view/prototype/QuadrilateralInputPreferencesNode.ts b/js/quadrilateral/view/prototype/QuadrilateralInputPreferencesNode.ts index 754591c..5778e4c 100644 --- a/js/quadrilateral/view/prototype/QuadrilateralInputPreferencesNode.ts +++ b/js/quadrilateral/view/prototype/QuadrilateralInputPreferencesNode.ts @@ -93,7 +93,7 @@ export default class QuadrilateralInputPreferencesNode extends VBox { 'Adjust length of time before a new value from input device is accepted and updated in simulation.', tangibleOptionsModel.bluetoothUpdateIntervalProperty, { numberDisplayOptions: { - decimalPlaces: 1 + decimalPlaces: 2 }, delta: 0.1, createObjectResponsePatternString: value => value === 1 ? '{{value}} second' : '{{value}} seconds' @@ -122,13 +122,14 @@ export default class QuadrilateralInputPreferencesNode extends VBox { class TangiblePropertyNumberControl extends VBox { public constructor( label: string, description: string, property: NumberProperty, providedOptions?: TangiblePropertyNumberControlOptions ) { const propertyRange = property.range; + const minorTickSpacing = propertyRange.getLength() / 10; const options = optionize()( { delta: propertyRange.min, titleNodeOptions: PreferencesDialog.PANEL_SECTION_CONTENT_OPTIONS, layoutFunction: NumberControl.createLayoutFunction1( { align: 'left' } ), sliderOptions: { - minorTickSpacing: propertyRange.getLength() / 10, + minorTickSpacing: minorTickSpacing, minorTickStroke: 'black', majorTicks: [ { @@ -147,7 +148,8 @@ class TangiblePropertyNumberControl extends VBox { // pdom labelTagName: 'label', - labelContent: label + labelContent: label, + keyboardStep: minorTickSpacing }, // voicing