Easy way to center a shortcut in Xul

Is there an easier way to center the label in Xul and then with the following?

<xul:hbox>
    <xul:spacer flex="1" />
    <xul:label id="myLabel" value="LABEL"/>
    <xul:spacer flex="1" />
</xul:hbox>
+3
source share
2 answers

Yes. Use packaging through the pack attribute .

<hbox pack="center"><label id="myLabel" value="LABEL"/></hbox.
+3
source

Two alternative ways to work with multi-line labels:

  • Use <label style="text-align: center"/>
  • Use <vbox align="center"><label/></vbox>
+1
source

Source: https://habr.com/ru/post/1780216/


All Articles