aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Bargiacchi2016-08-11 17:57:03 -0500
committerDamien Bargiacchi2016-08-18 21:51:45 -0500
commit35fff61b1c0d736d090a1cd1bb4e99141cc88ad8 (patch)
treefb8d33f614d8457939b1247671c7331e051fb059 /wear_ui.cpp
parente49c0d6406dcce19bdcf81d635b3449004f44c7e (diff)
downloadplatform-bootable-recovery-35fff61b1c0d736d090a1cd1bb4e99141cc88ad8.tar.gz
platform-bootable-recovery-35fff61b1c0d736d090a1cd1bb4e99141cc88ad8.tar.xz
platform-bootable-recovery-35fff61b1c0d736d090a1cd1bb4e99141cc88ad8.zip
Support use of custom fonts in miniui
Bug: 29547343 Change-Id: I398160c85daac90ffab2fa9bb2e96795b9e9885a
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index b437fd0a..f9727af0 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -177,7 +177,7 @@ void WearRecoveryUI::draw_screen_locked()
177 // items don't fit on the screen. 177 // items don't fit on the screen.
178 if (menu_items > menu_end - menu_start) { 178 if (menu_items > menu_end - menu_start) {
179 sprintf(cur_selection_str, "Current item: %d/%d", menu_sel + 1, menu_items); 179 sprintf(cur_selection_str, "Current item: %d/%d", menu_sel + 1, menu_items);
180 gr_text(x+4, y, cur_selection_str, 1); 180 gr_text(gr_sys_font(), x+4, y, cur_selection_str, 1);
181 y += char_height_+4; 181 y += char_height_+4;
182 } 182 }
183 183
@@ -192,10 +192,10 @@ void WearRecoveryUI::draw_screen_locked()
192 gr_fill(x, y-2, gr_fb_width()-x, y+char_height_+2); 192 gr_fill(x, y-2, gr_fb_width()-x, y+char_height_+2);
193 // white text of selected item 193 // white text of selected item
194 SetColor(MENU_SEL_FG); 194 SetColor(MENU_SEL_FG);
195 if (menu[i][0]) gr_text(x+4, y, menu[i], 1); 195 if (menu[i][0]) gr_text(gr_sys_font(), x+4, y, menu[i], 1);
196 SetColor(MENU); 196 SetColor(MENU);
197 } else { 197 } else if (menu[i][0]) {
198 if (menu[i][0]) gr_text(x+4, y, menu[i], 0); 198 gr_text(gr_sys_font(), x+4, y, menu[i], 0);
199 } 199 }
200 y += char_height_+4; 200 y += char_height_+4;
201 } 201 }
@@ -216,7 +216,7 @@ void WearRecoveryUI::draw_screen_locked()
216 for (int ty = gr_fb_height() - char_height_ - outer_height; 216 for (int ty = gr_fb_height() - char_height_ - outer_height;
217 ty > y+2 && count < text_rows; 217 ty > y+2 && count < text_rows;
218 ty -= char_height_, ++count) { 218 ty -= char_height_, ++count) {
219 gr_text(x+4, ty, text[row], 0); 219 gr_text(gr_sys_font(), x+4, ty, text[row], 0);
220 --row; 220 --row;
221 if (row < 0) row = text_rows-1; 221 if (row < 0) row = text_rows-1;
222 } 222 }
@@ -285,7 +285,7 @@ void WearRecoveryUI::Init()
285{ 285{
286 gr_init(); 286 gr_init();
287 287
288 gr_font_size(&char_width_, &char_height_); 288 gr_font_size(gr_sys_font(), &char_width_, &char_height_);
289 289
290 text_col = text_row = 0; 290 text_col = text_row = 0;
291 text_rows = (gr_fb_height()) / char_height_; 291 text_rows = (gr_fb_height()) / char_height_;