uqbar-project/arena

ColumnLayout and Horizontal layout do not make the items larger to fit to its size

Closed this issue · 3 comments

Columnlayout, no autoajusta el ancho de los controles que tiene dentro. Ej label.

En swt existe un parámetro para indicarle que haga todas las columnas del mismo tamañao, y eso "estira" los controles internos. Se llama "makesamewidth", o algo así.

The problem here is that if I create a screen with a "label-control" structure, and for example I have a Label whose initial value is just one digit, like "A", but the model changes because of some interaction and this gets a longer value like "ABCDEFG", then the label will just show "A", because it was sized for the initial content, and not resized after.

The only layout that we have that stretches controls is the Vertical Layout.

En el trait Layoutable.scala se modificó el segundo parámetro del constructor, en lugar de false a true

def setLayoutInColumns(columnCount: Int) = setLayout(new GridLayout(columnCount, true))

Ver ejemplo WidgetApplication/EventoWindow (SVN, próximo a subirse)

Para el caso del HorizontalLayout no tiene sentido hablar de "mismo tamaño" porque todos se ubican en una fila sola.