Lint updates

This commit is contained in:
Jk Jensen 2023-02-28 09:47:05 -08:00
parent 7a84cdd0fb
commit 3482a530e5
No known key found for this signature in database
GPG Key ID: 3AEC4983A7541FEA
2 changed files with 20 additions and 7 deletions

View File

@ -36,7 +36,7 @@ keyboard.extensions.append(rgb_ext)
oled_ext = Oled(
OledData(
entries=[
OledData.oled_text_entry(text='Kyria v1.4\nKB2040', line_spacing=0.75, inverted=True, x=0, y=0),
OledData.oled_text_entry(text='Kyria v1.4\nKB2040', line_spacing=0.75, inverted=True, x=0, y=0),
OledData.oled_text_entry(text='americ', x=128, y=0, x_anchor=1.0),
OledData.oled_text_entry(text='anfootball', x=128, y=10, x_anchor=1.0),
OledData.oled_text_entry(text='Layer: ', x=0, y=32, y_anchor=1.0),

View File

@ -25,7 +25,17 @@ class OledData:
self.data = entries
@staticmethod
def oled_text_entry(text='', x=0, y=0, x_anchor=0.0, y_anchor=0.0, direction='LTR', line_spacing=0.75, inverted=False, layer=None):
def oled_text_entry(
text='',
x=0,
y=0,
x_anchor=0.0,
y_anchor=0.0,
direction='LTR',
line_spacing=0.75,
inverted=False,
layer=None,
):
return {
0: text,
1: x,
@ -90,13 +100,16 @@ class Oled(Extension):
label.Label(
terminalio.FONT,
text=view[0],
color=0xFFFFFF if view[9] == False else 0x000000,
background_color=0x000000 if view[9] == False else 0xFFFFFF,
anchor_point=(view[5],view[6]),
anchored_position=(view[1] if view[9] == False else view[1]+1,view[2]),
color=0xFFFFFF if view[9] is False else 0x000000,
background_color=0x000000 if view[9] is False else 0xFFFFFF,
anchor_point=(view[5], view[6]),
anchored_position=(
view[1] if view[9] is False else view[1] + 1,
view[2],
),
label_direction=view[7],
line_spacing=view[8],
padding_left=0 if view[9] == False else 1,
padding_left=0 if view[9] is False else 1,
)
)
elif view[4] == OledEntryType.IMG: