diff --git a/src/c/clock_area.c b/src/c/clock_area.c index 2137b48..d8e35b9 100755 --- a/src/c/clock_area.c +++ b/src/c/clock_area.c @@ -25,6 +25,8 @@ static GFont am_pm_font; static GRect screen_rect; #endif +static uint8_t prev_clockFontId; + // "private" functions static void update_original_clock_area_layer(Layer *l, GContext* ctx, FContext* fctx) { // check layer bounds @@ -287,10 +289,12 @@ void ClockArea_init(Window* window) { clock_area_layer = layer_create(bounds); layer_add_child(window_get_root_layer(window), clock_area_layer); layer_set_update_proc(clock_area_layer, update_clock_area_layer); + + prev_clockFontId = FONT_SETTING_UNSET; } void ClockArea_ffont_destroy(void) { - switch(globalSettings.prev_clockFontId) { + switch(prev_clockFontId) { case FONT_SETTING_DEFAULT: case FONT_SETTING_BOLD: case FONT_SETTING_LECO: @@ -324,8 +328,8 @@ void ClockArea_update_fonts(void) { } #endif - if(globalSettings.prev_clockFontId != globalSettings.clockFontId) { - if(globalSettings.prev_clockFontId != FONT_SETTING_UNSET) { + if(prev_clockFontId != globalSettings.clockFontId) { + if(prev_clockFontId != FONT_SETTING_UNSET) { ClockArea_ffont_destroy(); } @@ -372,6 +376,6 @@ void ClockArea_update_fonts(void) { colon_font = leco; break; } - globalSettings.prev_clockFontId = globalSettings.clockFontId; + prev_clockFontId = globalSettings.clockFontId; } } diff --git a/src/c/settings.c b/src/c/settings.c index d883157..b022f96 100755 --- a/src/c/settings.c +++ b/src/c/settings.c @@ -142,7 +142,6 @@ void Settings_updateDynamicSettings(void) { globalSettings.enableAutoBatteryWidget = true; globalSettings.enableBeats = false; globalSettings.enableAltTimeZone = false; - globalSettings.prev_clockFontId = FONT_SETTING_UNSET; for(int i = 0; i < 4; i++) { // if there are any weather widgets, enable weather checking diff --git a/src/c/settings.h b/src/c/settings.h index b39bcaa..505d48a 100755 --- a/src/c/settings.h +++ b/src/c/settings.h @@ -41,7 +41,6 @@ typedef struct { uint8_t languageId; bool showLeadingZero; uint8_t clockFontId; - uint8_t prev_clockFontId; // vibration settings bool btVibe; @@ -52,7 +51,7 @@ typedef struct { BarLocationType sidebarLocation; bool useLargeFonts; bool activateDisconnectIcon; - + // metric or imperial unit bool useMetric;