From 9f66d7ab966d4a27c613f45cf16ece0cc7b813fb Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Mon, 14 Oct 2019 19:32:40 +0200 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- pwnagotchi/ui/layout.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pwnagotchi/ui/layout.py b/pwnagotchi/ui/layout.py index d8c7e9b..c492441 100644 --- a/pwnagotchi/ui/layout.py +++ b/pwnagotchi/ui/layout.py @@ -44,9 +44,9 @@ def papirus(config, layout): layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) layout['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1) layout['status'] = { - 'pos': (int(layout['width'] / 2) - 15, int(layout['height'] * .15)), + 'pos': (85, int(layout['height'] * .15)), 'font': fonts.Medium, - 'max': (layout['width'] - layout['status']['pos'][0]) // 6 + 'max': (layout['width'] - 100) // 6 } return layout @@ -69,9 +69,9 @@ def oledhat(config, layout): layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) layout['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1) layout['status'] = { - 'pos': (int(layout['width'] / 2) - 15, int(layout['height'] * .15)), + 'pos': (85, int(layout['height'] * .15)), 'font': fonts.Medium, - 'max': (layout['width'] - layout['status']['pos'][0]) // 6 + 'max': (layout['width'] - 100) // 6 } return layout @@ -95,7 +95,6 @@ def waveshare(config, layout): layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) layout['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1) - else: fonts.setup(10, 8, 10, 25) @@ -118,7 +117,7 @@ def waveshare(config, layout): layout['status'] = { 'pos': (125, 20), 'font': fonts.Medium, - 'max': (layout['width'] - layout['status']['pos'][0]) // 6 + 'max': (layout['width'] - 125) // 6 } return layout