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.

Property definitions

app $ TextView :: align=
	# 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

android :: ui $ TextView :: align=
	redef fun align=(align) do set_align_native(native, align or else 0.0)
lib/android/ui/ui.nit:246,2--71

ios :: ui $ Label :: align=
	redef fun align=(align) do native.align = align or else 0.0
lib/ios/ui/ui.nit:285,2--60

linux :: ui $ Label :: align=
	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

ios :: ui $ TextInput :: align=
	redef fun align=(align) do native.align = align or else 0.0
lib/ios/ui/ui.nit:377,2--60

ios :: ui $ Button :: align=
	redef fun align=(align) do native.title_label.align = align or else 0.0
lib/ios/ui/ui.nit:418,2--72