From d0c461cf2cd4a66937fa6548ab61f5ded95d0518 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 30 Aug 2018 18:43:00 +0100 Subject: [PATCH] DRY up the rendering of the name on the homescreen --- home_default/main.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/home_default/main.py b/home_default/main.py index 4d2f2c3..d48d40d 100644 --- a/home_default/main.py +++ b/home_default/main.py @@ -23,13 +23,8 @@ ugfx.clear() #ugfx.set_default_font(ugfx.FONT_MEDIUM_BOLD) ugfx.Label(0, 20, ugfx.width(), 40, "TiLDA Mk4") # , justification=ugfx.Label.CENTERTOP -# name -if name(): - #ugfx.set_default_font(ugfx.FONT_NAME) - ugfx.Label(0, 60, ugfx.width(), 40, name()) # , justification=ugfx.Label.CENTERTOP -else: - #ugfx.set_default_font(ugfx.FONT_MEDIUM) - ugfx.Label(0, 60, ugfx.width(), 40, "Set your name in the settings app") # , justification=ugfx.Label.CENTERTOP +#ugfx.set_default_font(ugfx.FONT_NAME) +ugfx.Label(0, 60, ugfx.width(), 40, name("Set your name in the settings app")) # , justification=ugfx.Label.CENTERTOP # info ugfx.Label(0, 200, ugfx.width(), 40, "Press MENU") # , justification=ugfx.Label.CENTERTOP @@ -41,5 +36,3 @@ status = ugfx.Label(0, 130, ugfx.width(), 40, "") # , justification=ugfx.Label.C while True: status.text("wifi: %s%%\nbattery: %s%%" % (int(wifi_strength() * 100), int(battery() * 100))) sleep_or_exit(0.5) - -