summaryrefslogtreecommitdiffstats
path: root/apps/gui/viewport.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r--apps/gui/viewport.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 52704d9f69..fbbd4eab5a 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -37,12 +37,24 @@
+#ifdef HAVE_LCD_COLOR
#define LINE_SEL_FROM_SETTINGS(vp) \
do { \
vp->lss_pattern = global_settings.lss_color; \
vp->lse_pattern = global_settings.lse_color; \
vp->lst_pattern = global_settings.lst_color; \
} while (0)
+#else
+#define LINE_SEL_FROM_SETTINGS(vp)
+#endif
+
+#ifdef HAVE_LCD_COLOR
+#define FG_FALLBACK global_settings.fg_color
+#define BG_FALLBACK global_settings.bg_color
+#else
+#define FG_FALLBACK LCD_DEFAULT_FG
+#define BG_FALLBACK LCD_DEFAULT_FG
+#endif
static int statusbar_enabled = 0;
@@ -89,20 +101,17 @@ void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
#endif
vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0);
+#if LCD_DEPTH > 1
#ifdef HAVE_REMOTE_LCD
/* We only need this test if there is a remote LCD */
if (screen == SCREEN_MAIN)
#endif
{
-#ifdef HAVE_LCD_COLOR
- vp->fg_pattern = global_settings.fg_color;
- vp->bg_pattern = global_settings.bg_color;
+ vp->fg_pattern = FG_FALLBACK;
+ vp->bg_pattern = BG_FALLBACK;
LINE_SEL_FROM_SETTINGS(vp);
-#elif LCD_DEPTH > 1
- vp->fg_pattern = LCD_DEFAULT_FG;
- vp->bg_pattern = LCD_DEFAULT_BG;
-#endif
}
+#endif
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
if (screen == SCREEN_REMOTE)
@@ -159,6 +168,7 @@ void viewportmanager_statusbar_changed(void* data)
viewportmanager_set_statusbar(statusbar_enabled);
}
+#ifdef HAVE_LCD_BITMAP
const char* viewport_parse_viewport(struct viewport *vp,
enum screen_type screen,
const char *bufptr,
@@ -219,15 +229,15 @@ const char* viewport_parse_viewport(struct viewport *vp,
if (!LIST_VALUE_PARSED(set, PL_HEIGHT))
vp->height = screens[screen].lcdheight - vp->y;
-#if (LCD_DEPTH > 1)
+#if LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1
if (!LIST_VALUE_PARSED(set, PL_FG))
- vp->fg_pattern = global_settings.fg_color;
+ vp->fg_pattern = FG_FALLBACK;
if (!LIST_VALUE_PARSED(set, PL_BG))
- vp->bg_pattern = global_settings.bg_color;
-#endif
-#ifdef HAVE_LCD_COLOR
+ vp->bg_pattern = BG_FALLBACK;
+#endif /* LCD_DEPTH > 1 || LCD_REMOTE_DEPTH > 1 */
+
LINE_SEL_FROM_SETTINGS(vp);
-#endif
+
/* Validate the viewport dimensions - we know that the numbers are
non-negative integers, ignore bars and assume the viewport takes them
* into account */
@@ -249,3 +259,5 @@ const char* viewport_parse_viewport(struct viewport *vp,
return ptr;
}
+
+#endif /* HAVE_LCD_BITMAP */