summaryrefslogtreecommitdiff
path: root/apps/recorder/icons.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/icons.c')
-rw-r--r--apps/recorder/icons.c53
1 files changed, 36 insertions, 17 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index adcfda5255..f394b2bd31 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -152,22 +152,38 @@ void statusbar_icon_battery(int percent, bool charging)
152{ 152{
153 int i; 153 int i;
154 int fill; 154 int fill;
155 char buffer[5];
156 unsigned int width, height;
157
158 /* fill battery */
159 fill=percent;
160 if (fill < 0)
161 fill = 0;
162 if (fill > 100)
163 fill = 100;
164
165 if (global_settings.battery_type) {
166
167 /* Numeric display */
168 snprintf(buffer, sizeof(buffer), "%3d", percent);
169 lcd_setfont(FONT_SYSFIXED);
170 lcd_getstringsize(buffer, &width, &height);
171 if (height <= STATUSBAR_HEIGHT)
172 lcd_putsxy(ICON_BATTERY_X_POS + ICON_BATTERY_WIDTH / 2 -
173 width/2, STATUSBAR_Y_POS, buffer);
174 lcd_setfont(FONT_UI);
155 175
156 /* draw battery */ 176 } else {
157 lcd_drawrect(ICON_BATTERY_X_POS, STATUSBAR_Y_POS, 17, 7);
158 for (i=2; i < 5; i++)
159 lcd_drawpixel(ICON_BATTERY_X_POS + 17, STATUSBAR_Y_POS + i);
160
161 /* fill battery */
162 fill=percent;
163 if (fill < 0)
164 fill = 0;
165 if (fill > 100)
166 fill = 100;
167 177
168 fill = fill * 15 / 100; 178 /* draw battery */
179 lcd_drawrect(ICON_BATTERY_X_POS, STATUSBAR_Y_POS, 17, 7);
180 for (i=2; i < 5; i++)
181 lcd_drawpixel(ICON_BATTERY_X_POS + 17, STATUSBAR_Y_POS + i);
169 182
170 lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5); 183 fill = fill * 15 / 100;
184
185 lcd_fillrect(ICON_BATTERY_X_POS + 1, STATUSBAR_Y_POS + 1, fill, 5);
186 }
171 187
172 /* draw power plug if charging */ 188 /* draw power plug if charging */
173 if (charging) 189 if (charging)
@@ -207,8 +223,11 @@ void statusbar_icon_volume(int percent)
207 switch_tick = current_tick + HZ; 223 switch_tick = current_tick + HZ;
208 last_volume = volume; 224 last_volume = volume;
209 } 225 }
210 /* display volume lever numerical? */ 226
211 if (TIME_BEFORE(current_tick,switch_tick)) { 227 /* display volume level numerical? */
228 if (global_settings.volume_type ||
229 TIME_BEFORE(current_tick,switch_tick))
230 {
212 snprintf(buffer, sizeof(buffer), "%2d", percent); 231 snprintf(buffer, sizeof(buffer), "%2d", percent);
213 lcd_setfont(FONT_SYSFIXED); 232 lcd_setfont(FONT_SYSFIXED);
214 lcd_getstringsize(buffer, &width, &height); 233 lcd_getstringsize(buffer, &width, &height);
@@ -216,8 +235,8 @@ void statusbar_icon_volume(int percent)
216 lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 - 235 lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 -
217 width/2, STATUSBAR_Y_POS, buffer); 236 width/2, STATUSBAR_Y_POS, buffer);
218 lcd_setfont(FONT_UI); 237 lcd_setfont(FONT_UI);
219 } 238 } else {
220 else { /* display volume bar */ 239 /* display volume bar */
221 volume = volume * 14 / 100; 240 volume = volume * 14 / 100;
222 for(i=0; i < volume; i++) { 241 for(i=0; i < volume; i++) {
223 if(i%2 == 0) 242 if(i%2 == 0)