From f6be7b554bb1ed3a8387aa48c45cef94bc22517a Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Tue, 8 Apr 2025 22:21:31 -0500 Subject: [PATCH] Sizing and Spacing CHanged font sizing on chart and clock spacing --- src/clock.py | 5 +++-- src/stock_manager.py | 16 +++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/clock.py b/src/clock.py index 2ae648e4..ff70d11f 100644 --- a/src/clock.py +++ b/src/clock.py @@ -89,9 +89,10 @@ class Clock: # Get AM/PM ampm = current.strftime('%p') - # Format date with ordinal suffix + # Format date with ordinal suffix - more compact format day_suffix = self._get_ordinal_suffix(current.day) - date_str = current.strftime(f'%A, %B %-d{day_suffix}') + # Use %b for abbreviated month name and remove extra spaces + date_str = current.strftime(f'%a,%b %-d{day_suffix}') return time_str, ampm, date_str diff --git a/src/stock_manager.py b/src/stock_manager.py index 79e9c232..4e228b39 100644 --- a/src/stock_manager.py +++ b/src/stock_manager.py @@ -170,16 +170,17 @@ class StockManager: # Clear the display self.display_manager.clear() - # Draw the symbol at the top + # Draw the symbol at the top with small font self.display_manager.draw_text( symbol, - y=2, - color=(255, 255, 255) + y=1, # Moved up slightly + color=(255, 255, 255), + small_font=True # Use small font ) # Calculate chart dimensions - chart_height = 20 # Leave room for text above and below - chart_y = 8 # Start below the symbol + chart_height = 22 # Increased height since we're using smaller fonts + chart_y = 7 # Start closer to symbol due to smaller font width = self.display_manager.matrix.width # Get min and max prices for scaling @@ -208,12 +209,13 @@ class StockManager: x2, y2 = points[i + 1] self.display_manager.draw.line([x1, y1, x2, y2], fill=color, width=1) - # Draw current price at the bottom + # Draw current price at the bottom with small font price_text = f"${data['price']:.2f} ({data['change']:+.1f}%)" self.display_manager.draw_text( price_text, y=30, # Near bottom - color=color + color=color, + small_font=True # Use small font ) # Update the display