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

Unified Diff: chrome/views/controls/label.cc

Issue 100013: Allow words to be wrapped in message box.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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/controls/label.h ('k') | chrome/views/controls/message_box_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/controls/label.cc
===================================================================
--- chrome/views/controls/label.cc (revision 14610)
+++ chrome/views/controls/label.cc (working copy)
@@ -45,6 +45,7 @@
color_ = kEnabledColor;
horiz_alignment_ = ALIGN_CENTER;
is_multi_line_ = false;
+ allow_character_break_ = false;
collapse_when_hidden_ = false;
rtl_alignment_mode_ = USE_UI_ALIGNMENT;
paint_as_focused_ = false;
@@ -80,6 +81,8 @@
int Label::ComputeMultiLineFlags() {
int flags = ChromeCanvas::MULTI_LINE;
+ if (allow_character_break_)
+ flags |= ChromeCanvas::CHARACTER_BREAK;
switch (horiz_alignment_) {
case ALIGN_LEFT:
flags |= ChromeCanvas::TEXT_ALIGN_LEFT;
@@ -282,6 +285,13 @@
}
}
+void Label::SetAllowCharacterBreak(bool f) {
+ if (f != allow_character_break_) {
+ allow_character_break_ = f;
+ SchedulePaint();
+ }
+}
+
bool Label::IsMultiLine() {
return is_multi_line_;
}
« no previous file with comments | « chrome/views/controls/label.h ('k') | chrome/views/controls/message_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698