I noticed that creating a Container with the widgets constructor argument produces different label/control alignment than creating an empty Container and adding the same widgets with append().
Minimal repro:
from magicgui.widgets import Container, LineEdit, SpinBox
via_constructor = Container(
widgets=[
LineEdit(label='Name', value='Ada'),
SpinBox(label='Very long label', value=3),
]
)
via_append = Container()
via_append.append(LineEdit(label='Name', value='Ada'))
via_append.append(SpinBox(label='Very long label', value=3))
Container(widgets=[via_constructor, via_append]).show(run=True)
Expected behavior
Both containers should render with the same label/control alignment, since the widgets are equivalent and only the construction method differs.
Actual behavior
The container created with Container(widgets=[...]) renders differently from the one populated with append(). In my case, the append() version aligns labels and controls correctly, while the constructor version does not.
Environment
magicgui version: 0.10.2
backend: PySide6
OS: Windows 11
I noticed that creating a Container with the widgets constructor argument produces different label/control alignment than creating an empty Container and adding the same widgets with append().
Minimal repro:
Expected behavior
Both containers should render with the same label/control alignment, since the widgets are equivalent and only the construction method differs.
Actual behavior
The container created with Container(widgets=[...]) renders differently from the one populated with append(). In my case, the append() version aligns labels and controls correctly, while the constructor version does not.
Environment
magicgui version: 0.10.2
backend: PySide6
OS: Windows 11