Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(907)

Unified Diff: ui/gfx/render_text.h

Issue 1013543006: [RenderText] Adding vertical alignment options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge from master Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index fe70f4761beed7b7117b96605d9803a41d8906e3..1127e10bdc3dd0940a707b497fd386398d4bed9a 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -214,6 +214,9 @@ class GFX_EXPORT RenderText {
}
void SetHorizontalAlignment(HorizontalAlignment alignment);
+ VerticalAlignment vertical_alignment() const { return vertical_alignment_; }
+ void SetVerticalAlignment(VerticalAlignment alignment);
+
const FontList& font_list() const { return font_list_; }
void SetFontList(const FontList& font_list);
@@ -643,6 +646,7 @@ class GFX_EXPORT RenderText {
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, VerticalAlignement);
msw 2015/03/26 22:55:45 nit: "Alignment"
// Set the cursor to |position|, with the caret trailing the previous
// grapheme, or if there is no previous grapheme, leading the cursor position.
@@ -679,6 +683,10 @@ class GFX_EXPORT RenderText {
// default is to align left if the application UI is LTR and right if RTL.
HorizontalAlignment horizontal_alignment_;
+ // Vertical alignment of the text with respect to |display_rect_|. The
+ // default is to vertically align middle.
+ VerticalAlignment vertical_alignment_;
+
// The text directionality mode, defaults to DIRECTIONALITY_FROM_TEXT.
DirectionalityMode directionality_mode_;
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698