From 804a49886a842495c6bb049c229d924230b85b26 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 26 Oct 2020 12:36:25 -0400 Subject: statusbar: Make statusbar height equal SYSFONT_HEIGHT And size elements horizaontally based on SYSFONT_WIDTH Unfortunately we need 16px icons to make 16px statusbar look right but at least it _works_ properly now. Also: all targets currently use 8-px SYSFONT, except some hosted bootloaders Change-Id: I0cdf97e6ef47ec49693ef79667b200595b4fe075 --- apps/recorder/icons.h | 11 ++++++++--- apps/recorder/peakmeter.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index 66de36bcd0..249453a943 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -103,14 +103,15 @@ extern const unsigned char bitmap_icon_disk[]; #define STATUSBAR_X_POS 0 #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ -#define STATUSBAR_HEIGHT 8 +#define STATUSBAR_HEIGHT SYSFONT_HEIGHT #define STATUSBAR_WIDTH LCD_WIDTH +#define SB_ICON_HEIGHT 8 /* ... for now */ #define ICON_BATTERY_X_POS 0 -#define ICON_BATTERY_WIDTH 18 +#define ICON_BATTERY_WIDTH (2+(2*SYSFONT_WIDTH)) #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 16 +#define ICON_VOLUME_WIDTH (2+(2*SYSFONT_WIDTH)) #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 @@ -123,5 +124,9 @@ extern const unsigned char bitmap_icon_disk[]; #define ICON_DISK_X_POS STATUSBAR_WIDTH-ICON_DISK_WIDTH #define TIME_X_END STATUSBAR_WIDTH-1 +#if defined(SYSFONT_HEIGHT) && (SB_ICON_HEIGHT > STATUSBAR_HEIGHT) +#error "Icons larger than statusbar!" +#endif + #endif /* PLUGIN */ #endif /* _ICONS_H_ */ diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index c9c0254f2a..e8e5db551a 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -1311,7 +1311,7 @@ void peak_meter_draw_trig(int xpos[], int ypos[], HORIZONTAL); screens[i].mono_bitmap(bitmap_icons_7x8[icon], ixpos[i], ypos[i], - ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT); + ICON_PLAY_STATE_WIDTH, SB_ICON_HEIGHT); } } #endif -- cgit v1.2.3