misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2019-10-14 19:32:40 +02:00
parent 9625cf1122
commit 9f66d7ab96
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E

View File

@ -44,9 +44,9 @@ def papirus(config, layout):
layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) 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['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1)
layout['status'] = { layout['status'] = {
'pos': (int(layout['width'] / 2) - 15, int(layout['height'] * .15)), 'pos': (85, int(layout['height'] * .15)),
'font': fonts.Medium, 'font': fonts.Medium,
'max': (layout['width'] - layout['status']['pos'][0]) // 6 'max': (layout['width'] - 100) // 6
} }
return layout return layout
@ -69,9 +69,9 @@ def oledhat(config, layout):
layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) 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['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1)
layout['status'] = { layout['status'] = {
'pos': (int(layout['width'] / 2) - 15, int(layout['height'] * .15)), 'pos': (85, int(layout['height'] * .15)),
'font': fonts.Medium, 'font': fonts.Medium,
'max': (layout['width'] - layout['status']['pos'][0]) // 6 'max': (layout['width'] - 100) // 6
} }
return layout return layout
@ -95,7 +95,6 @@ def waveshare(config, layout):
layout['shakes'] = (0, layout['height'] - int(layout['height'] * .12) + 1) 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['mode'] = layout['mode'] = (layout['width'] - 25, layout['height'] - int(layout['height'] * .12) + 1)
else: else:
fonts.setup(10, 8, 10, 25) fonts.setup(10, 8, 10, 25)
@ -118,7 +117,7 @@ def waveshare(config, layout):
layout['status'] = { layout['status'] = {
'pos': (125, 20), 'pos': (125, 20),
'font': fonts.Medium, 'font': fonts.Medium,
'max': (layout['width'] - layout['status']['pos'][0]) // 6 'max': (layout['width'] - 125) // 6
} }
return layout return layout