From da68da4fe261e05197de027462cc2c7d485197f4 Mon Sep 17 00:00:00 2001 From: Peter Marquardt Date: Sat, 16 Jan 2016 23:36:12 +0100 Subject: [PATCH] bugfixes for Aplite related to high contrast mode --- appinfo.json | 2 +- src/squared.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/appinfo.json b/appinfo.json index f6e039c..cd41ba0 100644 --- a/appinfo.json +++ b/appinfo.json @@ -36,7 +36,7 @@ "chalk" ], "uuid": "793bab03-9464-48a2-b63f-3f779c473db8", - "versionLabel": "4.6", + "versionLabel": "4.7", "watchapp": { "watchface": true } diff --git a/src/squared.c b/src/squared.c index c5426f4..7be7a58 100644 --- a/src/squared.c +++ b/src/squared.c @@ -59,7 +59,7 @@ enum { #define US_DATE (!curPrefs.eu_date) // true == MM/DD, false == DD/MM #define CENTER_DATE (curPrefs.center) #define DISCONNECT_VIBRATION (curPrefs.btvibe) -#define CONTRAST_WHILE_CHARGING (curPrefs.contrast) +#define CONTRAST_WHILE_CHARGING PBL_IF_BW_ELSE(false, (curPrefs.contrast)) #define LIGHT_WHILE_CHARGING (curPrefs.backlight) #define DISABLE_ANIM (curPrefs.nightsaver) #define DISABLE_ANIM_START_TIME (curPrefs.ns_start) @@ -662,6 +662,7 @@ static void teardownUI() { } static void battery_handler(BatteryChargeState charge_state) { + #if defined(PBL_COLOR) if (CONTRAST_WHILE_CHARGING) { previous_contrastmode = contrastmode; if (charge_state.is_plugged) { @@ -674,6 +675,7 @@ static void battery_handler(BatteryChargeState charge_state) { setupUI(); } } + #endif if (LIGHT_WHILE_CHARGING) { if (charge_state.is_plugged) { light_enable(true); @@ -759,6 +761,7 @@ static void in_received_handler(DictionaryIterator *iter, void *context) { } persist_write_data(PREFERENCES_KEY, &curPrefs, sizeof(curPrefs)); vibes_short_pulse(); + #if defined(PBL_COLOR) if (curPrefs.contrast == false) { contrastmode = false; previous_contrastmode = false; @@ -769,6 +772,7 @@ static void in_received_handler(DictionaryIterator *iter, void *context) { previous_contrastmode = true; } } + #endif if (curPrefs.backlight == false) { light_enable(false); } else { @@ -832,12 +836,14 @@ static void init() { BatteryChargeState charge_state = battery_state_service_peek(); if (charge_state.is_plugged) { + #if defined(PBL_COLOR) if (CONTRAST_WHILE_CHARGING) { previous_contrastmode = true; contrastmode = true; teardownUI(); setupUI(); } + #endif if (LIGHT_WHILE_CHARGING) { light_enable(true); }