|
@@ -6,7 +6,8 @@ import { GeneralPropertyTabComponent } from './genericNodePropertyComponent';
|
|
import { TextLineComponent } from '../../sharedComponents/textLineComponent';
|
|
import { TextLineComponent } from '../../sharedComponents/textLineComponent';
|
|
import { TextInputLineComponent } from '../../sharedComponents/textInputLineComponent';
|
|
import { TextInputLineComponent } from '../../sharedComponents/textInputLineComponent';
|
|
import { NumericInputComponent } from '../../sharedComponents/numericInputComponent';
|
|
import { NumericInputComponent } from '../../sharedComponents/numericInputComponent';
|
|
-import { SketchPicker } from 'react-color';
|
|
|
|
|
|
+import { Color3, Color4 } from 'babylonjs';
|
|
|
|
+import { ColorPickerLineComponent } from '../../sharedComponents/colorPickerComponent';
|
|
|
|
|
|
export class ButtonPropertyTabComponent extends React.Component<IPropertyComponentProps> {
|
|
export class ButtonPropertyTabComponent extends React.Component<IPropertyComponentProps> {
|
|
constructor(props: IPropertyComponentProps) {
|
|
constructor(props: IPropertyComponentProps) {
|
|
@@ -15,6 +16,11 @@ export class ButtonPropertyTabComponent extends React.Component<IPropertyCompone
|
|
}
|
|
}
|
|
|
|
|
|
private button : BABYLON.GUI.Button;
|
|
private button : BABYLON.GUI.Button;
|
|
|
|
+
|
|
|
|
+ getColorString()
|
|
|
|
+ {
|
|
|
|
+ return Color4.FromHexString(this.button.background);
|
|
|
|
+ }
|
|
|
|
|
|
render() {
|
|
render() {
|
|
return (
|
|
return (
|
|
@@ -38,11 +44,11 @@ export class ButtonPropertyTabComponent extends React.Component<IPropertyCompone
|
|
}}>
|
|
}}>
|
|
</NumericInputComponent>
|
|
</NumericInputComponent>
|
|
<TextLineComponent label="Background Color" value={this.button.background} />
|
|
<TextLineComponent label="Background Color" value={this.button.background} />
|
|
- <SketchPicker
|
|
|
|
- color={ this.button.background }
|
|
|
|
- onChangeComplete={evt =>{
|
|
|
|
- this.button.background = evt.hex;
|
|
|
|
- }}/>
|
|
|
|
|
|
+ <ColorPickerLineComponent value={this.getColorString()} globalState={this.props.globalState}
|
|
|
|
+ onColorChanged={evt => {
|
|
|
|
+ this.button.background = evt;
|
|
|
|
+ }}>
|
|
|
|
+ </ColorPickerLineComponent>
|
|
</LineContainerComponent>
|
|
</LineContainerComponent>
|
|
</>
|
|
</>
|
|
);
|
|
);
|