1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

widgets minimum widths and heights

This commit is contained in:
Ricardo Hernandez-Montoya 2017-03-27 18:05:19 +02:00
parent cbc413232c
commit ce40201857
2 changed files with 15 additions and 2 deletions

View file

@ -140,24 +140,35 @@ class Visualization extends Component {
if (item.name === 'Value') {
widget.simulator = this.state.simulation.models[0].simulator;
widget.signal = 0;
widget.minWidth = 70;
widget.minHeight = 20;
} else if (item.name === 'Plot') {
widget.simulator = this.state.simulation.models[0].simulator;
widget.signals = [ 0 ];
widget.time = 60;
widget.minWidth = 400;
widget.minHeight = 200;
widget.width = 400;
widget.height = 200;
} else if (item.name === 'Table') {
widget.simulator = this.state.simulation.models[0].simulator;
widget.minWidth = 300;
widget.minHeight = 200;
widget.width = 400;
widget.height = 200;
} else if (item.name === 'Label') {
widget.minWidth = 70;
widget.minHeight = 20;
} else if (item.name === 'PlotTable') {
widget.simulator = this.state.simulation.models[0].simulator;
widget.minWidth = 400;
widget.minHeight = 200;
widget.width = 500;
widget.height = 400;
widget.time = 60
} else if (item.name === 'Image') {
widget.minWidth = 100;
widget.minHeight = 100;
widget.width = 200;
widget.height = 200;
}

View file

@ -109,12 +109,14 @@ class Widget extends Component {
} else if (widget.type === 'Image') {
element = <WidgetImage widget={widget} files={this.state.files} />
}
if (this.props.editing) {
return (
<Rnd
ref={c => { this.rnd = c; }}
initial={{ x: Number(widget.x), y: Number(widget.y), width: widget.width, height: widget.height }}
minWidth={ widget.minWidth }
minHeight={ widget.minHeight }
bounds={'parent'}
className="widget"
onResizeStop={(direction, styleSize, clientSize, delta) => this.resizeStop(direction, styleSize, clientSize, delta)}