From cab037f0e8c232f970af617d0dbe8d0d4760f529 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Fri, 11 Apr 2025 11:38:07 -0500 Subject: [PATCH] Improve stock display spacing and disable stock news ticker --- config/config.json | 2 +- src/stock_manager.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/config.json b/config/config.json index 01e35d13..5ba6c64a 100644 --- a/config/config.json +++ b/config/config.json @@ -54,7 +54,7 @@ "display_format": "{symbol}: ${price} ({change}%)" }, "stock_news": { - "enabled": true, + "enabled": false, "update_interval": 300, "scroll_speed": 1, "scroll_delay": 0.001, diff --git a/src/stock_manager.py b/src/stock_manager.py index 505eec3f..40d7b7a1 100644 --- a/src/stock_manager.py +++ b/src/stock_manager.py @@ -322,20 +322,22 @@ class StockManager: symbol_y = height // 4 draw.text((symbol_x, symbol_y), symbol_text, font=self.display_manager.small_font, fill=(255, 255, 255)) - # Price + # Price (smaller) price_text = f"${data['price']:.2f}" bbox = draw.textbbox((0, 0), price_text, font=self.display_manager.small_font) price_width = bbox[2] - bbox[0] + price_height = bbox[3] - bbox[1] price_x = center_x + (width // 3 - price_width) // 2 - price_y = symbol_y + symbol_height + 5 + price_y = symbol_y + symbol_height + 2 # Reduced spacing draw.text((price_x, price_y), price_text, font=self.display_manager.small_font, fill=color) - # Change + # Change (smaller) change_text = f"({data['change']:+.1f}%)" bbox = draw.textbbox((0, 0), change_text, font=self.display_manager.small_font) change_width = bbox[2] - bbox[0] + change_height = bbox[3] - bbox[1] change_x = center_x + (width // 3 - change_width) // 2 - change_y = price_y + symbol_height + 5 + change_y = price_y + price_height + 1 # Reduced spacing draw.text((change_x, change_y), change_text, font=self.display_manager.small_font, fill=color) # Draw mini chart on the right