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

Unified Diff: chrome/views/label.cc

Issue 18863: Review request: fix issue 6099 -- bad display of multi-line English message in pop ups (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « chrome/views/label.h ('k') | chrome/views/label_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/label.cc
===================================================================
--- chrome/views/label.cc (revision 10107)
+++ chrome/views/label.cc (working copy)
@@ -45,6 +45,7 @@
horiz_alignment_ = ALIGN_CENTER;
is_multi_line_ = false;
collapse_when_hidden_ = false;
+ rtl_alignment_mode_ = USE_UI_ALIGNMENT;
}
Label::~Label() {
@@ -238,17 +239,16 @@
}
void Label::SetHorizontalAlignment(Alignment a) {
+ // If the View's UI layout is right-to-left and rtl_alignment_mode_ is
+ // USE_UI_ALIGNMENT, we need to flip the alignment so that the alignment
+ // settings take into account the text directionality.
+ if (UILayoutIsRightToLeft() && rtl_alignment_mode_ == USE_UI_ALIGNMENT) {
+ if (a == ALIGN_LEFT)
+ a = ALIGN_RIGHT;
+ else if (a == ALIGN_RIGHT)
+ a = ALIGN_LEFT;
+ }
if (horiz_alignment_ != a) {
-
- // If the View's UI layout is right-to-left, we need to flip the alignment
- // so that the alignment settings take into account the text
- // directionality.
- if (UILayoutIsRightToLeft()) {
- if (a == ALIGN_LEFT)
- a = ALIGN_RIGHT;
- else if (a == ALIGN_RIGHT)
- a = ALIGN_LEFT;
- }
horiz_alignment_ = a;
SchedulePaint();
}
@@ -258,6 +258,14 @@
return horiz_alignment_;
}
+void Label::SetRTLAlignmentMode(RTLAlignmentMode mode) {
+ rtl_alignment_mode_ = mode;
+}
+
+Label::RTLAlignmentMode Label::GetRTLAlignmentMode() const {
+ return rtl_alignment_mode_;
+}
+
void Label::SetMultiLine(bool f) {
if (f != is_multi_line_) {
is_multi_line_ = f;
« no previous file with comments | « chrome/views/label.h ('k') | chrome/views/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698