From 7e3782868cfc685bc253774bc57ef310127ef742 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Wed, 9 Sep 2026 11:24:18 +0200 Subject: [PATCH] quickscreen: fix icon x-position off-by-one Top, bottom, and right icons were displayed too far to the left. Apparently a long-standing issue. Icon width is 7, so subtract 7/2 = 3 pixels, instead of 4, from calculated center, and only 7 pixels, instead of 8, from the right vp edge. Change-Id: I8440a4fef4778a66d56117a05b3fe4c36ac8dadd --- apps/gui/quickscreen.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index cfd70ebe8e..a04c4bb2cd 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c @@ -42,6 +42,8 @@ text and icons, or between text and parent boundaries. */ #define MARGIN 10 #define CENTER_ICONAREA_SIZE (MARGIN + 8*2) +#define QS_ICON_WIDTH 7 +#define QS_ICON_HEIGHT 8 #define FOR_QS_ITEMS(i) for (int i = 0; i < QUICKSCREEN_ITEM_COUNT; i++) @@ -249,24 +251,33 @@ static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen) } /* icons */ - if (parent->width > CENTER_ICONAREA_SIZE && vp_icons->height >= 8) + if (parent->width > CENTER_ICONAREA_SIZE && vp_icons->height >= QS_ICON_HEIGHT) { display->set_viewport(vp_icons); - if (qs->items[QUICKSCREEN_TOP]) - display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], - (vp_icons->width/2) - 4, 0, 7, 8); - - if (qs->items[QUICKSCREEN_RIGHT]) - display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], - vp_icons->width - 8, (vp_icons->height/2) - 4, 7, 8); if (qs->items[QUICKSCREEN_LEFT]) display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], - 0, (vp_icons->height/2) - 4, 7, 8); + 0, + vp_icons->height/2 - QS_ICON_HEIGHT/2, + QS_ICON_WIDTH, QS_ICON_HEIGHT); + + if (qs->items[QUICKSCREEN_RIGHT]) + display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], + vp_icons->width - QS_ICON_WIDTH, + vp_icons->height/2 - QS_ICON_HEIGHT/2, + QS_ICON_WIDTH, QS_ICON_HEIGHT); + + if (qs->items[QUICKSCREEN_TOP]) + display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], + vp_icons->width/2 - QS_ICON_WIDTH/2, + 0, + QS_ICON_WIDTH, QS_ICON_HEIGHT); if (qs->items[QUICKSCREEN_BOTTOM]) display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], - (vp_icons->width/2) - 4, vp_icons->height - 8, 7, 8); + vp_icons->width/2 - QS_ICON_WIDTH/2, + vp_icons->height - QS_ICON_HEIGHT, + QS_ICON_WIDTH, QS_ICON_HEIGHT); } skin_mark_dirty(screen);