def set_font_and_shorten(self):
"""
Makes the font slightly smaller on mobile
by using "Body1" rather than "Button" style.
Also shorten content size using ellipsis.
"""
content = self.ids.content
content.font_style = 'Body1'
content.shorten = True
def on_parent_size(instance, size):
# see BaseRectangularButton.width definition
button_margin = dp(32)
parent_width = instance.width
# TODO: the new size should be a min() of
# parent_width and actual content size
content.width = parent_width - button_margin
self.parent.bind(size=on_parent_size)
# call it once manually, refs:
# https://github.com/AndreMiras/PyWallet/issues/74
on_parent_size(self.parent, None)
评论列表
文章目录