mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
Improve stock display spacing and disable stock news ticker
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
"display_format": "{symbol}: ${price} ({change}%)"
|
"display_format": "{symbol}: ${price} ({change}%)"
|
||||||
},
|
},
|
||||||
"stock_news": {
|
"stock_news": {
|
||||||
"enabled": true,
|
"enabled": false,
|
||||||
"update_interval": 300,
|
"update_interval": 300,
|
||||||
"scroll_speed": 1,
|
"scroll_speed": 1,
|
||||||
"scroll_delay": 0.001,
|
"scroll_delay": 0.001,
|
||||||
|
|||||||
@@ -322,20 +322,22 @@ class StockManager:
|
|||||||
symbol_y = height // 4
|
symbol_y = height // 4
|
||||||
draw.text((symbol_x, symbol_y), symbol_text, font=self.display_manager.small_font, fill=(255, 255, 255))
|
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}"
|
price_text = f"${data['price']:.2f}"
|
||||||
bbox = draw.textbbox((0, 0), price_text, font=self.display_manager.small_font)
|
bbox = draw.textbbox((0, 0), price_text, font=self.display_manager.small_font)
|
||||||
price_width = bbox[2] - bbox[0]
|
price_width = bbox[2] - bbox[0]
|
||||||
|
price_height = bbox[3] - bbox[1]
|
||||||
price_x = center_x + (width // 3 - price_width) // 2
|
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)
|
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}%)"
|
change_text = f"({data['change']:+.1f}%)"
|
||||||
bbox = draw.textbbox((0, 0), change_text, font=self.display_manager.small_font)
|
bbox = draw.textbbox((0, 0), change_text, font=self.display_manager.small_font)
|
||||||
change_width = bbox[2] - bbox[0]
|
change_width = bbox[2] - bbox[0]
|
||||||
|
change_height = bbox[3] - bbox[1]
|
||||||
change_x = center_x + (width // 3 - change_width) // 2
|
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.text((change_x, change_y), change_text, font=self.display_manager.small_font, fill=color)
|
||||||
|
|
||||||
# Draw mini chart on the right
|
# Draw mini chart on the right
|
||||||
|
|||||||
Reference in New Issue
Block a user