|
|
Chromium Code Reviews|
Created:
11 years, 1 month ago by idana Modified:
9 years, 7 months ago Reviewers:
tim (not reviewing) CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org, tfarina (gmail-do not use) Base URL:
svn://chrome-svn/chrome/trunk/src/ Visibility:
Public. |
DescriptionFixed a label alignment issue in ConfirmMessageBoxDialog.
There is no need to manually detect the text directionlity at run time. Setting the
label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem
will flip it automatically if the locale is RTL.
BUG=26378
TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31616
Patch Set 1 #Patch Set 2 : '' #
Messages
Total messages: 10 (0 generated)
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
Reviewers: timsteele, Description: Fixed a label alignment issue in ConfirmMessageBoxDialog. There is no need to manually detect the text directionlity at run time. Setting the label's alignment to views::Label::ALIGN_LEFT is sufficient because the mirroring subsystem will flip it automatically if the locale is RTL. BUG=26378 TEST=Run chrome with --lang=he, enable sync and then disable through the options dialog. Text in dialog box should be right aligned. Please review this at http://codereview.chromium.org/390005 SVN Base: svn://chrome-svn/chrome/trunk/src/ Affected files: M chrome/browser/views/confirm_message_box_dialog.cc Index: chrome/browser/views/confirm_message_box_dialog.cc =================================================================== --- chrome/browser/views/confirm_message_box_dialog.cc (revision 31461) +++ chrome/browser/views/confirm_message_box_dialog.cc (working copy) @@ -59,18 +59,7 @@ IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)) { message_label_ = new views::Label(message_text); message_label_->SetMultiLine(true); - l10n_util::TextDirection direction = - l10n_util::GetFirstStrongCharacterDirection(message_label_->GetText()); - views::Label::Alignment alignment; - if (direction == l10n_util::RIGHT_TO_LEFT) - alignment = views::Label::ALIGN_RIGHT; - else - alignment = views::Label::ALIGN_LEFT; - // In addition, we should set the RTL alignment mode as - // AUTO_DETECT_ALIGNMENT so that the alignment will not be flipped around - // in RTL locales. - message_label_->SetRTLAlignmentMode(views::Label::AUTO_DETECT_ALIGNMENT); - message_label_->SetHorizontalAlignment(alignment); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(message_label_); } @@ -112,4 +101,4 @@ gfx::Size ConfirmMessageBoxDialog::GetPreferredSize() { return preferred_size_; -} \ No newline at end of file +}
LGTM!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
