dlangui
dlangui copied to clipboard
How to align widget
Hi,
How to align the "send" button on the right side of the "MDI" groupbox ? All my attempts have been unsuccessful ! Thanks.
GroupBox {
text: "MDI"
TextWidget {text: "Manual Command"}
EditLine {layoutWidth: 350}
HorizontalLayout {
Button {text: "Send"}
}
}
Hi! I would suggest creating an empty widget that takes all the extra space, eg:
GroupBox {
maxWidth: 500px
text: "MDI"
TextWidget {text: "Manual Command"}
EditLine {layoutWidth: 350}
HorizontalLayout {
VerticalLayout { layoutWidth: fill; minWidth: 10% }
Button {text: "Send"}
}
}
Note the extra "maxWidth" in the GroupBox. Without it, the widget becomes very long for some reason
You have enabled me to find another solution :
GroupBox {
text: "MDI"
TextWidget {text: "Manual Command"}
EditLine {layoutWidth: 350}
HorizontalLayout {
HSpacer {layoutWidth: fill; minWidth: 350 }
Button {text: "Send"}
}
}
I think the best solution is :
GroupBox {
text: "MDI"
TextWidget {text: "Manual Command"}
EditLine {layoutWidth: 350}
HorizontalLayout {
layoutWidth: fill
HSpacer {layoutWidth: fill }
Button {text: "Send"}
}
}
This solution do not modify the "EditLine" dimension.