aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-08-14 01:48:55 -0500
committerTao Bao2017-08-15 17:10:21 -0500
commit2bbc6d642d1fbfb007905d95b629fe5f833b2a1b (patch)
tree3e6e9cdb3e14e52d19c0a029c8cb7ee71db73619 /screen_ui.h
parent0459799ea83d669df089c670f244771b7be211e3 (diff)
downloadplatform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.tar.gz
platform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.tar.xz
platform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.zip
screen_ui: Word-wrap menu headers.
This CL adds ScreenRecoveryUI::DrawWrappedTextLines() to better handle long menu header texts. It does a word wrap at spaces, if available. This avoids fixed-length menu headers being truncated on small screens. Bug: 64293520 Test: On bullhead, boot into recovery with --prompt_and_wipe_data, and check the prompt texts. Change-Id: Ia22746583516dd230567a267584aca558429395e
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/screen_ui.h b/screen_ui.h
index 8402fac0..df7cc25b 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -187,6 +187,9 @@ class ScreenRecoveryUI : public RecoveryUI {
187 virtual int DrawTextLine(int x, int y, const char* line, bool bold) const; 187 virtual int DrawTextLine(int x, int y, const char* line, bool bold) const;
188 // Draws multiple text lines. Returns the offset it should be moving along Y-axis. 188 // Draws multiple text lines. Returns the offset it should be moving along Y-axis.
189 int DrawTextLines(int x, int y, const char* const* lines) const; 189 int DrawTextLines(int x, int y, const char* const* lines) const;
190 // Similar to DrawTextLines() to draw multiple text lines, but additionally wraps long lines.
191 // Returns the offset it should be moving along Y-axis.
192 int DrawWrappedTextLines(int x, int y, const char* const* lines) const;
190}; 193};
191 194
192#endif // RECOVERY_UI_H 195#endif // RECOVERY_UI_H