Skip to content

Commit

Permalink
Stash
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Nov 12, 2023
1 parent 9fe7a3c commit db630b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions wideboy/scenes/default/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def setup(self):

GRID_ENTITY_ALPHA = 220
GRID_ENTITY_TITLE_BRIGHTNESS = 96
GRID_ENTITY_WIDTH = 64
GRID_ENTITY_START_X = 256
GRID_ENTITY_WIDTH = 72
GRID_ENTITY_START_X = self.width - 560
GRID_ENTITY_MARGIN_X = 0

GRID_ENTITY_COLORS = [
Expand Down Expand Up @@ -243,7 +243,7 @@ def setup(self):
self.hass_grid_network = HomeAssistantEntityGridSprite(
self,
Rect(grid_entity_cx, 0, GRID_ENTITY_WIDTH, 64),
title="Network",
title="Net",
cells=hass_grid_network_entities,
accent_color=GRID_ENTITY_COLORS[grid_entity_color_idx],
alpha=GRID_ENTITY_ALPHA,
Expand Down
14 changes: 7 additions & 7 deletions wideboy/sprites/homeassistant/entity_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HomeAssistantEntityGridTile:
label_color_fg: Color = Color(255, 255, 255, 255)
label_color_outline: Color = Color(0, 0, 0, 255)
label_font: str = "fonts/bitstream-vera.ttf"
label_font_size: int = 11
label_font_size: int = 12
progress: float = 1.0

def process(self, state) -> None:
Expand All @@ -42,8 +42,8 @@ def process(self, state) -> None:
class HomeAssistantEntityGridSprite(BaseSprite):
rect: Rect
image: Surface
row_height: int = 12
title_width: int = 11
row_height: int = 14
title_width: int = 13

def __init__(
self,
Expand All @@ -54,7 +54,7 @@ def __init__(
alpha: int = 192,
accent_color: Color = Color(255, 0, 0, 255),
font_name: str = "fonts/bitstream-vera.ttf",
font_size: int = 10,
font_size: int = 12,
) -> None:
super().__init__(scene, rect)
self.title = title
Expand Down Expand Up @@ -93,7 +93,7 @@ def render(self) -> None:
color_outline=Color(0, 0, 0, 255),
)
self.image.blit(pygame.transform.rotate(title_surface, 90), (cx - 2, cy + 1))
cx += self.title_width
cx += self.title_width + 1
for cell_idx, cell in enumerate(self.cells):
cell.process(self.scene.hass.state)
if not cell.visible:
Expand Down Expand Up @@ -139,7 +139,7 @@ def render_hass_tile_cell(size: Tuple[int, int], cell: HomeAssistantEntityGridTi
((size[0] - icon_width) * cell.progress, size[1]), SRCALPHA
)
label_background_surface.fill(cell.label_color_bg)
surface.blit(label_background_surface, (cx, cy))
surface.blit(label_background_surface, (cx + 3, cy))
label_surface = render_text(
cell.label,
font_filename=cell.label_font,
Expand All @@ -152,6 +152,6 @@ def render_hass_tile_cell(size: Tuple[int, int], cell: HomeAssistantEntityGridTi
elif cell.label_align == "center":
label_x = cx + (label_surface.get_rect().width // 2)
else:
label_x = cx + 1
label_x = cx + 4
surface.blit(label_surface, (label_x, -2))
return surface

0 comments on commit db630b7

Please sign in to comment.