summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-26 12:36:25 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-26 19:52:40 +0000
commit804a49886a842495c6bb049c229d924230b85b26 (patch)
tree3a6d61c3e8ea1f7414a452ed51d5b267cc06790b /apps
parent299c2370756baeac5ca458859ae7c64ca462f8c8 (diff)
downloadrockbox-804a49886a842495c6bb049c229d924230b85b26.tar.gz
rockbox-804a49886a842495c6bb049c229d924230b85b26.tar.bz2
rockbox-804a49886a842495c6bb049c229d924230b85b26.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/statusbar-skinned.c1
-rw-r--r--apps/gui/statusbar.c32
-rw-r--r--apps/gui/statusbar.h4
-rw-r--r--apps/recorder/icons.h11
-rw-r--r--apps/recorder/peakmeter.c2
5 files changed, 26 insertions, 24 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index c4cc37d539..f8e06c2b5d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -38,6 +38,7 @@
#include "debug.h"
#include "font.h"
#include "icon.h"
+#include "icons.h"
#include "option_select.h"
#ifdef HAVE_TOUCHSCREEN
#include "sound.h"
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 708624b23e..66297826c0 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -49,7 +49,7 @@
but still needed for compatibility with old system */
#define ICONS_SPACING 2
#define STATUSBAR_BATTERY_X_POS 0*ICONS_SPACING
-#define STATUSBAR_BATTERY_WIDTH 18
+#define STATUSBAR_BATTERY_WIDTH (2+(2*SYSFONT_WIDTH))
#define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \
ICONS_SPACING
@@ -58,7 +58,7 @@
STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \
2*ICONS_SPACING
-#define STATUSBAR_VOLUME_WIDTH 16
+#define STATUSBAR_VOLUME_WIDTH (2+(2*SYSFONT_WIDTH))
#define STATUSBAR_ENCODER_X_POS STATUSBAR_X_POS + \
STATUSBAR_BATTERY_WIDTH + \
STATUSBAR_PLUG_WIDTH + \
@@ -281,7 +281,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
display->mono_bitmap(bitmap_icons_7x8[Icon_USBPlug],
STATUSBAR_PLUG_X_POS,
STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
#endif /* HAVE_USB_POWER */
#if CONFIG_CHARGING
#ifdef HAVE_USB_POWER
@@ -292,7 +292,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
display->mono_bitmap(bitmap_icons_7x8[Icon_Plug],
STATUSBAR_PLUG_X_POS,
STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
#endif /* CONFIG_CHARGING */
#ifdef HAVE_RECORDING
/* turn off volume display in recording screen */
@@ -453,7 +453,7 @@ static bool gui_statusbar_icon_volume(struct gui_statusbar * bar, int volume)
if (volume == minvol) {
display->mono_bitmap(bitmap_icons_7x8[Icon_Mute],
STATUSBAR_VOLUME_X_POS + STATUSBAR_VOLUME_WIDTH / 2 - 4,
- STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT);
+ STATUSBAR_Y_POS, 7, SB_ICON_HEIGHT);
}
else {
/* We want to redraw the icon later on */
@@ -505,7 +505,7 @@ static void gui_statusbar_icon_play_state(struct screen * display, int state)
{
display->mono_bitmap(bitmap_icons_7x8[state], STATUSBAR_PLAY_STATE_X_POS,
STATUSBAR_Y_POS, STATUSBAR_PLAY_STATE_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
}
/*
@@ -515,7 +515,7 @@ static void gui_statusbar_icon_play_mode(struct screen * display, int mode)
{
display->mono_bitmap(bitmap_icons_7x8[mode], STATUSBAR_PLAY_MODE_X_POS,
STATUSBAR_Y_POS, STATUSBAR_PLAY_MODE_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
}
/*
@@ -525,7 +525,7 @@ static void gui_statusbar_icon_shuffle(struct screen * display)
{
display->mono_bitmap(bitmap_icons_7x8[Icon_Shuffle],
STATUSBAR_SHUFFLE_X_POS, STATUSBAR_Y_POS,
- STATUSBAR_SHUFFLE_WIDTH, STATUSBAR_HEIGHT);
+ STATUSBAR_SHUFFLE_WIDTH, SB_ICON_HEIGHT);
}
/*
@@ -535,7 +535,7 @@ static void gui_statusbar_icon_lock(struct screen * display)
{
display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Main],
STATUSBAR_LOCKM_X_POS, STATUSBAR_Y_POS,
- STATUSBAR_LOCKM_WIDTH, STATUSBAR_HEIGHT);
+ STATUSBAR_LOCKM_WIDTH, SB_ICON_HEIGHT);
}
#ifdef HAS_REMOTE_BUTTON_HOLD
@@ -546,7 +546,7 @@ static void gui_statusbar_icon_lock_remote(struct screen * display)
{
display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Remote],
STATUSBAR_LOCKR_X_POS, STATUSBAR_Y_POS,
- STATUSBAR_LOCKR_WIDTH, STATUSBAR_HEIGHT);
+ STATUSBAR_LOCKR_WIDTH, SB_ICON_HEIGHT);
}
#endif
@@ -559,7 +559,7 @@ static void gui_statusbar_led(struct screen * display)
display->mono_bitmap(bitmap_icon_disk,
STATUSBAR_DISK_X_POS(display->getwidth()),
STATUSBAR_Y_POS, STATUSBAR_DISK_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
}
#endif
@@ -609,7 +609,7 @@ static int write_bitmap_number(struct screen * display, int value,
for (ptr = buf; *ptr != '\0'; ptr++, x += BM_GLYPH_WIDTH)
display->mono_bitmap(bitmap_glyphs_4x8[*ptr - '0'], x, y,
- BM_GLYPH_WIDTH, STATUSBAR_HEIGHT);
+ BM_GLYPH_WIDTH, SB_ICON_HEIGHT);
return x;
}
@@ -649,7 +649,7 @@ static void gui_statusbar_write_format_info(struct screen * display)
/* Show bitmap - clipping right edge if needed */
display->mono_bitmap_part(bm, 0, 0, STATUSBAR_ENCODER_WIDTH,
- xpos, STATUSBAR_Y_POS, width, STATUSBAR_HEIGHT);
+ xpos, STATUSBAR_Y_POS, width, SB_ICON_HEIGHT);
if (rec_format == REC_FORMAT_MPA_L3)
{
@@ -688,7 +688,7 @@ static void gui_statusbar_write_samplerate_info(struct screen * display)
/* write the 'k' */
display->mono_bitmap(bitmap_glyphs_4x8[Glyph_4x8_k], xpos,
STATUSBAR_Y_POS, BM_GLYPH_WIDTH,
- STATUSBAR_HEIGHT);
+ SB_ICON_HEIGHT);
}
static void gui_statusbar_icon_recording_info(struct screen * display)
@@ -704,13 +704,13 @@ static void gui_statusbar_icon_recording_info(struct screen * display)
{
display->mono_bitmap(bitmap_icons_5x8[Icon_Mono],
STATUSBAR_RECCHANNELS_X_POS , STATUSBAR_Y_POS,
- STATUSBAR_RECCHANNELS_WIDTH, STATUSBAR_HEIGHT);
+ STATUSBAR_RECCHANNELS_WIDTH, SB_ICON_HEIGHT);
}
else
{
display->mono_bitmap(bitmap_icons_5x8[Icon_Stereo],
STATUSBAR_RECCHANNELS_X_POS, STATUSBAR_Y_POS,
- STATUSBAR_RECCHANNELS_WIDTH, STATUSBAR_HEIGHT);
+ STATUSBAR_RECCHANNELS_WIDTH, SB_ICON_HEIGHT);
}
}
#endif /* HAVE_RECORDING */
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 45bd0c6ee1..a676c7b143 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -28,10 +28,6 @@
#include "screen_access.h"
#include "events.h"
-#define STATUSBAR_X_POS 0
-#define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
-#define STATUSBAR_HEIGHT 8
-
struct status_info {
int battlevel;
int batt_charge_step;
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