Use 0.0 to align left (the default), 0.5 to align in the center and 1.0 to align on the right.
Implementation varies per platform, and some controls may be unaffected
depending on the customization options of each platform.
For consistent results, it is recommended to use only on instances
of Label
and size
should be either 0.0, 0.5 or 1.0.
# Align the text horizontally
#
# Use 0.0 to align left (the default), 0.5 to align in the center and
# 1.0 to align on the right.
#
# Implementation varies per platform, and some controls may be unaffected
# depending on the customization options of each platform.
# For consistent results, it is recommended to use only on instances
# of `Label` and `size` should be either 0.0, 0.5 or 1.0.
fun align=(align: nullable Float) is autoinit do end
lib/app/ui.nit:248,2--257,53
redef fun align=(align)
do
align = align or else 0.0
# Set whole label alignement
native.set_alignment(align, 0.5)
# Set multiline justification
native.justify = if align == 0.5 then
new GtkJustification.center
else if align < 0.5 then
new GtkJustification.left
else#if align > 0.5 then
new GtkJustification.right
end
lib/linux/ui.nit:297,2--311,4