Docs and tests for new elm.Label styles

default/left
default/right
marker/left
marker/right
This commit is contained in:
Davide Andreoli 2016-08-10 19:06:50 +02:00
parent 71946bffb3
commit 23c6ffc8cf
2 changed files with 34 additions and 1 deletions

View File

@ -20,9 +20,17 @@ Available styles
================
``default``
No animation
The default style
``default/left``
Left aligned label (since 1.18)
``default/right``
Right aligned label (since 1.18)
``marker``
Centers the text in the label and makes it bold by default
``marker/left``
Like marker but left aligned (since 1.18)
``marker/right``
Like marker but right aligned (since 1.18)
``slide_long``
The entire text appears from the right of the screen and
slides until it disappears in the left of the screen(reappearing on

View File

@ -66,6 +66,31 @@ def label_clicked(obj):
vbox.pack_end(lb)
lb.show()
lb = Label(win, style="default/left", text="Left aligned style",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
vbox.pack_end(lb)
lb.show()
lb = Label(win, style="default/right", text="Right aligned style",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
vbox.pack_end(lb)
lb.show()
lb = Label(win, style="marker", text="Marker style",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
vbox.pack_end(lb)
lb.show()
lb = Label(win, style="marker/left", text="Marker left style",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
vbox.pack_end(lb)
lb.show()
lb = Label(win, style="marker/right", text="Marker right style",
size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH)
vbox.pack_end(lb)
lb.show()
sp = Separator(win, horizontal=True)
vbox.pack_end(sp)
sp.show()