Update stock_manager.py

stock font size change
This commit is contained in:
Chuck
2025-04-08 22:14:04 -05:00
parent 9ea31698ab
commit 75ff4279e7

View File

@@ -285,27 +285,29 @@ class StockManager:
# Clear the display # Clear the display
self.display_manager.clear() self.display_manager.clear()
# Draw the stock symbol at the top # Draw the stock symbol at the top with regular font
self.display_manager.draw_text( self.display_manager.draw_text(
data['symbol'], data['symbol'],
y=2, # Near top y=2, # Near top
color=(255, 255, 255) # White for symbol color=(255, 255, 255) # White for symbol
) )
# Draw the price in the middle # Draw the price in the middle with small font
price_text = f"${data['price']:.2f}" price_text = f"${data['price']:.2f}"
self.display_manager.draw_text( self.display_manager.draw_text(
price_text, price_text,
y=12, # Middle y=14, # Middle
color=(0, 255, 0) if data['change'] >= 0 else (255, 0, 0) # Green for up, red for down color=(0, 255, 0) if data['change'] >= 0 else (255, 0, 0), # Green for up, red for down
small_font=True # Use small font
) )
# Draw the change percentage at the bottom # Draw the change percentage at the bottom with small font
change_text = f"({data['change']:+.1f}%)" change_text = f"({data['change']:+.1f}%)"
self.display_manager.draw_text( self.display_manager.draw_text(
change_text, change_text,
y=22, # Near bottom y=24, # Near bottom
color=(0, 255, 0) if data['change'] >= 0 else (255, 0, 0) # Green for up, red for down color=(0, 255, 0) if data['change'] >= 0 else (255, 0, 0), # Green for up, red for down
small_font=True # Use small font
) )
# Update the display # Update the display