From 34a8d75d7380ca33a73664ab0dec3ad469149af6 Mon Sep 17 00:00:00 2001 From: vierlijner Date: Thu, 20 Oct 2022 21:52:57 +0200 Subject: [PATCH] Parameter weatherTextColor Added the weather text color as a parameter in the settings file and to the code (weather_text_color), so the user can change it. --- settings.json | 1 + settings_320_240.json | 1 + weatherClock.py | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/settings.json b/settings.json index c020aed..9fe0525 100644 --- a/settings.json +++ b/settings.json @@ -14,6 +14,7 @@ "WeatherTextDescription": "-30", "WeatherTextData": "30", "WeatherTextVertSpacing": "40", + "WeatherTextColor": "white", "TemperatureTextVertSpacing": "-9", "TemperatureTextHorzSpacing": "11", "TemperatureTextFontSize": "11", diff --git a/settings_320_240.json b/settings_320_240.json index 06be5cc..6b66111 100644 --- a/settings_320_240.json +++ b/settings_320_240.json @@ -14,6 +14,7 @@ "WeatherTextDescription": "-10", "WeatherTextData": "10", "WeatherTextVertSpacing": "17", + "WeatherTextColor": "white", "TemperatureTextVertSpacing": "-9", "TemperatureTextHorzSpacing": "11", "TemperatureTextFontSize": "11", diff --git a/weatherClock.py b/weatherClock.py index d0c872f..98a8333 100644 --- a/weatherClock.py +++ b/weatherClock.py @@ -45,6 +45,7 @@ weather_text_description = -30 weather_text_data = 30 weather_text_vert_spacing = 40 + weather_text_color = "white" temperature_text_vert_spacing = -9 temperature_text_horz_spacing = 11 temperature_text_font_size = 11 @@ -113,7 +114,8 @@ weather_text_description = int(settings.get('WeatherTextDescription')) weather_text_data = int(settings.get('WeatherTextData')) weather_text_vert_spacing = int(settings.get('WeatherTextVertSpacing')) - temperature_text_vert_spacing = int(settings.get('TemperatureTextVertSpacing')) + weather_text_color = settings.get('WeatherTextColor') + temperature_text_vert_spacing = int(settings.get('TemperatureTextVertSpacing')) temperature_text_horz_spacing = int(settings.get('TemperatureTextHorzSpacing')) temperature_text_font_size = int(settings.get('TemperatureTextFontSize')) weather_text_description_font_size = int(settings.get('WeatherTextDataFontSize')) @@ -273,7 +275,7 @@ def get_mouse_click_coordinate(x, y): weatherText.penup() weatherText.goto(weather_text_description + global_x_shift, weather_text_vert_spacing * 3 + global_y_shift) - weatherText.color("white") + weatherText.color(weather_text_color) # day of the week weatherText.write("Day", align="right", font=("Verdana", weather_text_description_font_size, "bold"))