diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-11 18:04:26 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-11 18:04:26 +0000 |
commit | 49982b0c1b77bf4be7998abcd6b35c3a1a34bc3c (patch) | |
tree | 793e88af204d1e991f5b313835096033d099fc58 /ui/message_center/views | |
parent | ec49c186a3af9c47133998d33f0c8e589aaf9b8c (diff) | |
download | chromium_src-49982b0c1b77bf4be7998abcd6b35c3a1a34bc3c.zip chromium_src-49982b0c1b77bf4be7998abcd6b35c3a1a34bc3c.tar.gz chromium_src-49982b0c1b77bf4be7998abcd6b35c3a1a34bc3c.tar.bz2 |
Use labels to display views tab titles.
Add a Label view to Tab for displaying the title.
Remove Tab::PaintTitle, bounds and font members.
Remove unnecessary Tab::Get[Title|Icon]Bounds helpers.
Update the text on Tab::SetData, not during paint.
Use gfx::DirectionalityMode, remove the Label enum.
Add gfx::ALIGN_TO_HEAD to gfx::HorizontalAlignment.
Add Label::GetHorizontalAlignment for ALIGN_TO_HEAD.
Always flip left/right in Label::SetHorizontalAlignment.
Have Tab and MessageBoxView use ALIGN_TO_HEAD.
Update comments and tests, related minor cleanup.
TODO: Make Label cache RenderText objects.
TODO: Make RenderText support ALIGN_TO_HEAD.
BUG=240037
TEST=No visible Views tab title changes.
R=sky@chromium.org
Review URL: https://codereview.chromium.org/323993002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/message_center/views')
-rw-r--r-- | ui/message_center/views/bounded_label.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc index 0acad8e..99c66f80 100644 --- a/ui/message_center/views/bounded_label.cc +++ b/ui/message_center/views/bounded_label.cc @@ -198,8 +198,11 @@ int InnerBoundedLabel::GetTextFlags() { if (SkColorGetA(background_color()) != 0xFF) flags |= gfx::Canvas::NO_SUBPIXEL_RENDERING; - if (directionality_mode() == - views::Label::AUTO_DETECT_DIRECTIONALITY) { + if (directionality_mode() == gfx::DIRECTIONALITY_FORCE_LTR) { + flags |= gfx::Canvas::FORCE_LTR_DIRECTIONALITY; + } else if (directionality_mode() == gfx::DIRECTIONALITY_FORCE_RTL) { + flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY; + } else if (directionality_mode() == gfx::DIRECTIONALITY_FROM_TEXT) { base::i18n::TextDirection direction = base::i18n::GetFirstStrongCharacterDirection(text()); if (direction == base::i18n::RIGHT_TO_LEFT) |