Add one more line to text viewer (#7528)
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#define drawFieldLabel(x, y, str) lcdDrawTextAlignedLeft(y, str)
|
||||
|
||||
#define NUM_BODY_LINES (LCD_LINES-1)
|
||||
#define TEXT_VIEWER_LINES NUM_BODY_LINES
|
||||
#define MENU_HEADER_HEIGHT FH
|
||||
|
||||
#define CURVE_SIDE_WIDTH (LCD_H/2)
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#define DEFAULT_SCROLLBAR_X (LCD_W-1)
|
||||
#define NUM_BODY_LINES (LCD_LINES-1)
|
||||
#define TEXT_VIEWER_LINES NUM_BODY_LINES
|
||||
#define MENU_HEADER_HEIGHT FH
|
||||
|
||||
#define MODEL_BITMAP_WIDTH 64
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
#define FH 20
|
||||
#define NUM_BODY_LINES (MENU_BODY_HEIGHT / FH)
|
||||
#define TEXT_VIEWER_LINES ((MENU_FOOTER_TOP-MENU_HEADER_HEIGHT) / FH)
|
||||
|
||||
#define INVERT_HORZ_MARGIN 2
|
||||
#define INVERT_VERT_MARGIN 1
|
||||
|
||||
@@ -42,7 +42,7 @@ bool menuTextView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_RIGHT:
|
||||
if (menuVerticalOffset + NUM_BODY_LINES >= lines_count)
|
||||
if (menuVerticalOffset + TEXT_VIEWER_LINES >= lines_count)
|
||||
break;
|
||||
else
|
||||
++menuVerticalOffset;
|
||||
@@ -55,11 +55,11 @@ bool menuTextView(event_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
lcd->drawTextMaxWidth(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + i * FH, reusableBuffer.viewText.lines[i], 0, LCD_W - 2 * MENUS_MARGIN_LEFT);
|
||||
for (int i = 0; i < TEXT_VIEWER_LINES; i++) {
|
||||
lcd->drawTextMaxWidth(MENUS_MARGIN_LEFT, MENU_HEADER_HEIGHT + i * FH, reusableBuffer.viewText.lines[i], 0, LCD_W - 2 * MENUS_MARGIN_LEFT);
|
||||
}
|
||||
|
||||
drawVerticalScrollbar(LCD_W-5, 50, 195, menuVerticalOffset, lines_count, NUM_BODY_LINES);
|
||||
drawVerticalScrollbar(LCD_W-5, 50, 195, menuVerticalOffset, lines_count, TEXT_VIEWER_LINES);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user