Commit 63818f75 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

Trying to add tracking icon, not successful yet

parent 7bfeeb98
...@@ -39,7 +39,9 @@ enum event_type { ...@@ -39,7 +39,9 @@ enum event_type {
RTC_TICK, RTC_TICK,
BATTERY_STATUS, BATTERY_STATUS,
GPS_TICK, GPS_TICK,
GPS_OFF GPS_OFF,
GPS_TRACK_ON,
GPS_TRACK_OFF
}; };
/** /**
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include "../settings/settings.h" #include "../settings/settings.h"
static const unsigned int GPS_POS = 0;
static const unsigned int TRACK_POS = 36;
static const unsigned int BATTERY_POS = 111; static const unsigned int BATTERY_POS = 111;
static const unsigned int BATTERY_BARS = 10; static const unsigned int BATTERY_BARS = 10;
...@@ -46,6 +48,8 @@ static bool charging; ...@@ -46,6 +48,8 @@ static bool charging;
static struct rle_bitmap gps_ico; static struct rle_bitmap gps_ico;
static int gps_ico_blink = 0; static int gps_ico_blink = 0;
static struct rle_bitmap track_ico;
static void status_bar_event(struct ui_widget *w, const struct event *evt) static void status_bar_event(struct ui_widget *w, const struct event *evt)
{ {
switch(evt->type) { switch(evt->type) {
...@@ -62,11 +66,24 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt) ...@@ -62,11 +66,24 @@ static void status_bar_event(struct ui_widget *w, const struct event *evt)
memset(&gps_ico, 0, sizeof(struct rle_bitmap)); memset(&gps_ico, 0, sizeof(struct rle_bitmap));
} }
} }
if (setting_get(&setting_tracking))
memset(&track_ico, &tracking, sizeof(struct rle_bitmap));
else
memset(&track_ico, 0, sizeof(struct rle_bitmap));
w->flags |= WF_DIRTY; w->flags |= WF_DIRTY;
break; break;
case GPS_OFF: // case GPS_OFF:
memset(&gps_ico, 0, sizeof(struct rle_bitmap)); // memset(&gps_ico, 0, sizeof(struct rle_bitmap));
// w->flags |= WF_DIRTY;
// break;
//
// case GPS_TRACK_ON:
// w->flags |= WF_DIRTY;
// break;
case GPS_TRACK_OFF:
memset(&track_ico, 0, sizeof(struct rle_bitmap));
w->flags |= WF_DIRTY; w->flags |= WF_DIRTY;
break; break;
...@@ -90,7 +107,8 @@ static void status_bar_redraw(struct ui_widget *w) ...@@ -90,7 +107,8 @@ static void status_bar_redraw(struct ui_widget *w)
/*gfx_round_box(&w->dc, 30, -10, 127 - 30, 10, 9, COLOR_BLACK);*/ /*gfx_round_box(&w->dc, 30, -10, 127 - 30, 10, 9, COLOR_BLACK);*/
/*gfx_centered_text(&w->dc, &font_helv11, 0, "Home", 1);*/ /*gfx_centered_text(&w->dc, &font_helv11, 0, "Home", 1);*/
gfx_draw_bitmap(&w->dc, 0, 0, &gps_ico); gfx_draw_bitmap(&w->dc, GPS_POS, 0, &gps_ico);
gfx_draw_bitmap(&w->dc, TRACK_POS, 0, &track_ico);
if(charging) { if(charging) {
gfx_draw_bitmap(&w->dc, BATTERY_POS, 0, &battery_charging); gfx_draw_bitmap(&w->dc, BATTERY_POS, 0, &battery_charging);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment