summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/icons.c36
-rw-r--r--apps/recorder/icons.h4
2 files changed, 35 insertions, 5 deletions
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index e094a12400..bac719e0f1 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -209,6 +209,10 @@ void statusbar_icon_volume(int percent)
int volume;
int step=0;
char buffer[4];
+ unsigned int width, height;
+#if defined(LOADABLE_FONTS)
+ unsigned char *font;
+#endif
static long switch_tick;
static int last_volume;
@@ -231,8 +235,19 @@ void statusbar_icon_volume(int percent)
/* display volume lever numerical? */
if (TIME_BEFORE(current_tick,switch_tick)) {
snprintf(buffer, sizeof(buffer), "%2d", percent);
- lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 -
- 6*strlen(buffer)/2, STATUSBAR_Y_POS, buffer, 0);
+#if defined(LCD_PROPFONTS)
+ lcd_getstringsize(buffer, 0, &width, &height);
+ width += strlen(buffer) - 1;
+#elif defined(LOADABLE_FONTS)
+ font = lcd_getcurrentldfont();
+ lcd_getstringsize(buffer, font, &width, &height);
+#else
+ width = 6*strlen(buffer);
+ height = 8;
+#endif
+ if (height <= STATUSBAR_HEIGHT)
+ lcd_putsxy(ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 -
+ width/2, STATUSBAR_Y_POS, buffer, 0);
}
else { /* display volume bar */
volume = volume * 14 / 100;
@@ -290,6 +305,10 @@ void statusbar_time(void)
{
int hour,minute;
unsigned char buffer[6];
+ unsigned int width, height;
+#if defined(LOADABLE_FONTS)
+ unsigned char *font;
+#endif
hour = rtc_read(0x03);
minute = rtc_read(0x02);
@@ -299,6 +318,17 @@ void statusbar_time(void)
hour & 0x0f,
(minute & 0xf0) >> 4,
minute & 0x0f);
- lcd_putsxy(TIME_X_POS, STATUSBAR_Y_POS, buffer, 0);
+#if defined(LCD_PROPFONTS)
+ lcd_getstringsize(buffer, 0, &width, &height);
+ width += strlen(buffer) - 1;
+#elif defined(LOADABLE_FONTS)
+ font = lcd_getcurrentldfont();
+ lcd_getstringsize(buffer, font, &width, &height);
+#else
+ width = 6*strlen(buffer);
+ height = 8;
+#endif
+ if (height <= STATUSBAR_HEIGHT)
+ lcd_putsxy(TIME_X_END - width, STATUSBAR_Y_POS, buffer, 0);
}
#endif
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index da94c2269a..ff6a011b98 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -45,7 +45,7 @@ extern unsigned char slider_bar[];
#define ICON_PLUG_X_POS STATUSBAR_X_POS+ICON_BATTERY_WIDTH+2
#define ICON_PLUG_WIDTH 7
#define ICON_VOLUME_X_POS STATUSBAR_X_POS+ICON_BATTERY_WIDTH+ICON_PLUG_WIDTH+2+2
-#define ICON_VOLUME_WIDTH 14
+#define ICON_VOLUME_WIDTH 16
#define ICON_PLAY_STATE_X_POS STATUSBAR_X_POS+ICON_BATTERY_WIDTH+ICON_PLUG_WIDTH+ICON_VOLUME_WIDTH+2+2+2
#define ICON_PLAY_STATE_WIDTH 7
#define ICON_PLAY_MODE_X_POS STATUSBAR_X_POS+ICON_BATTERY_WIDTH+ICON_PLUG_WIDTH+ICON_VOLUME_WIDTH+ICON_PLAY_STATE_WIDTH+2+2+2+2
@@ -54,7 +54,7 @@ extern unsigned char slider_bar[];
#define ICON_SHUFFLE_WIDTH 7
#define LOCK_X_POS STATUSBAR_X_POS+ICON_BATTERY_WIDTH+ICON_PLUG_WIDTH+ICON_VOLUME_WIDTH+ICON_PLAY_STATE_WIDTH+ICON_PLAY_MODE_WIDTH+ICON_SHUFFLE_WIDTH+2+2+2+2+2+2
#define LOCK_WIDTH 5
-#define TIME_X_POS STATUSBAR_WIDTH-5*6-1
+#define TIME_X_END STATUSBAR_WIDTH-1
/* Symbolic names for icons */
enum