summaryrefslogtreecommitdiff
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index db69b4b128..0cdee11b8e 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -26,24 +26,30 @@
26void screen_put_iconxy(struct screen * display, int x, int y, ICON icon) 26void screen_put_iconxy(struct screen * display, int x, int y, ICON icon)
27{ 27{
28#ifdef HAVE_LCD_BITMAP 28#ifdef HAVE_LCD_BITMAP
29 if(icon==0)/* Don't display invalid icons */
30 return;
31 int xpos, ypos; 29 int xpos, ypos;
32 xpos = x*CURSOR_WIDTH; 30 xpos = x*CURSOR_WIDTH;
33 ypos = y*display->char_height + display->getymargin(); 31 ypos = y*display->char_height + display->getymargin();
32
34 if ( display->char_height > CURSOR_HEIGHT )/* center the cursor */ 33 if ( display->char_height > CURSOR_HEIGHT )/* center the cursor */
35 ypos += (display->char_height - CURSOR_HEIGHT) / 2; 34 ypos += (display->char_height - CURSOR_HEIGHT) / 2;
36 display->mono_bitmap(icon, xpos, ypos, CURSOR_WIDTH, CURSOR_HEIGHT); 35 if(icon==0)/* Don't display invalid icons */
36 screen_clear_area(display, xpos, ypos, CURSOR_WIDTH, CURSOR_HEIGHT);
37 else
38 display->mono_bitmap(icon, xpos, ypos, CURSOR_WIDTH, CURSOR_HEIGHT);
37#else 39#else
38 display->putc(x, y, icon); 40 if(icon==-1)
41 display->putc(x, y, ' ');
42 else
43 display->putc(x, y, icon);
39#endif 44#endif
40} 45}
41 46
42void screen_put_cursorxy(struct screen * display, int x, int y) 47void screen_put_cursorxy(struct screen * display, int x, int y, bool on)
43{ 48{
44#ifdef HAVE_LCD_BITMAP 49#ifdef HAVE_LCD_BITMAP
45 screen_put_iconxy(display, x, y, bitmap_icons_6x8[Icon_Cursor]); 50 screen_put_iconxy(display, x, y, on?bitmap_icons_6x8[Icon_Cursor]:0);
46#else 51#else
47 screen_put_iconxy(display, x, y, CURSOR_CHAR); 52 screen_put_iconxy(display, x, y, on?CURSOR_CHAR:-1);
48#endif 53#endif
54
49} 55}