From 2868d6ef78547998aa0959d0f0cbb10956e2c622 Mon Sep 17 00:00:00 2001 From: David Lenk Date: Tue, 11 Aug 2015 13:45:35 +0200 Subject: [PATCH] Fix: battery bar --- appinfo.json | 2 +- src/main.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/appinfo.json b/appinfo.json index d674351..eb91772 100644 --- a/appinfo.json +++ b/appinfo.json @@ -48,7 +48,7 @@ "shortName": "circuit binary", "uuid": "4912af97-9664-425c-8cb7-2d04b40e0f8c", "versionCode": 1, - "versionLabel": "2.0", + "versionLabel": "2.1", "watchapp": { "watchface": true } diff --git a/src/main.c b/src/main.c index a27e2f0..cedd16a 100644 --- a/src/main.c +++ b/src/main.c @@ -48,7 +48,7 @@ persist settings = { .numbers = true, .vibe_h = false, .vibe_bt = false, - .show_bat = false, + .show_bat = true, //false, .day = true, .number_old = true, .bt_old = true @@ -204,11 +204,17 @@ void bt_status(GContext* ctx, bool on) { } void bat_status(GContext* ctx, BatteryChargeState charge_state) { - if(settings.show_bat){ + if(true){ //settings.show_bat //change the color graphics_context_set_fill_color(ctx, settings.day ? GColorWhite : GColorBlack); //on //draw the line - graphics_fill_rect(ctx, GRect(0, 166, (int)(144/100*charge_state.charge_percent), 10), 1, 0); + + //float var1 = (144*charge_state.charge_percent)/100; + //int var = (int)var1; + //APP_LOG(APP_LOG_LEVEL_DEBUG, "Battery Level is %d", charge_state.charge_percent); + //APP_LOG(APP_LOG_LEVEL_DEBUG, "Battery Bar hav %d", var); + + graphics_fill_rect(ctx, GRect(0, 166, (int)((144*charge_state.charge_percent)/100), 10), 1, 0); } }