quickscreen: fix MIN_LINES off-by-one

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit be62759005e1c2d343a02e9b39a2efa67b424f43
Author: Christian Soffke <[email protected]>
Date:   Sun Aug 16 15:08:13 2026 +0200

    quickscreen: fix MIN_LINES off-by-one
    
    Appears to be a regression introduced in e454a39, where
    MIN_LINES was increased from 4 to 5, along with changing
    nb_lines <= MIN_LINES to nb_lines < MIN_LINES
    
    The top and bottom sections are supposed to switch
    from 2 to 1 lines if there are fewer available lines
    than MIN_LINES.
    
    Each of the three vertical section uses two lines,
    resulting in overlapping viewports, if there are exactly
    5 available lines.
    
    Icons mentioned in the comment don't really play into
    that.
    
    Change-Id: I3a0e921d9f53a490fece0ce59457feaf84a80d3b

diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index bc245dd80a..535ba23409 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -41,9 +41,9 @@
 #include "appevents.h"
 #include "statusbar-skinned.h"
 
- /* 1 top, 1 bottom, 2 on either side, 1 for the icons
-  * if enough space, top and bottom have 2 lines */
-#define MIN_LINES 5
+ /* 2 lines for each of the three vertical sections (top/middle/bottom).
+    If less space is available, the top and bottom each lose a line. */
+#define MIN_LINES (3*2)
 #define MAX_NEEDED_LINES 10
  /* pixels between the 2 center items minimum or between text and icons,
   * and between text and parent boundaries */
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.