diff options
-rw-r--r-- | uisimulator/screensaver.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/uisimulator/screensaver.c b/uisimulator/screensaver.c index 644bcfe8c0..d80a464c21 100644 --- a/uisimulator/screensaver.c +++ b/uisimulator/screensaver.c | |||
@@ -92,6 +92,7 @@ void ss_loop(void) | |||
92 | void screensaver(void) | 92 | void screensaver(void) |
93 | { | 93 | { |
94 | char w, h; | 94 | char w, h; |
95 | char *off = "[Off] to stop"; | ||
95 | int len = strlen(SS_TITLE); | 96 | int len = strlen(SS_TITLE); |
96 | 97 | ||
97 | lcd_fontsize(SS_TITLE_FONT, &w, &h); | 98 | lcd_fontsize(SS_TITLE_FONT, &w, &h); |
@@ -108,10 +109,28 @@ void screensaver(void) | |||
108 | else | 109 | else |
109 | h /= 2; | 110 | h /= 2; |
110 | 111 | ||
111 | lcd_puts(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, | 112 | lcd_clearrect(0, 0, LCD_WIDTH, LCD_HEIGHT); |
112 | SS_TITLE, SS_TITLE_FONT); | 113 | lcd_puts(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE, SS_TITLE_FONT); |
114 | |||
115 | len = strlen(off); | ||
116 | lcd_fontsize(0, &w, &h); | ||
117 | |||
118 | /* Get horizontel centering for text */ | ||
119 | len *= w; | ||
120 | if (len%2 != 0) | ||
121 | len = ((len+1)/2)+(w/2); | ||
122 | else | ||
123 | len /= 2; | ||
124 | |||
125 | if (h%2 != 0) | ||
126 | h = (h/2)+1; | ||
127 | else | ||
128 | h /= 2; | ||
129 | |||
130 | lcd_puts(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off, 0); | ||
113 | 131 | ||
114 | lcd_update(); | 132 | lcd_update(); |
133 | sleep(150); | ||
115 | ss_loop(); | 134 | ss_loop(); |
116 | } | 135 | } |
117 | 136 | ||