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

Unified Diff: ui/views/controls/styled_label.cc

Issue 2722503005: Add bottom border to StyledLabel. (Closed)
Patch Set: Rebase, test added Created 3 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/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/styled_label.cc
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc
index 5ad539ff653b6e47973bb0ab61d4f88139be799a..304b0ef49e5c6c43d605d3d5934dd1472ca5433e 100644
--- a/ui/views/controls/styled_label.cc
+++ b/ui/views/controls/styled_label.cc
@@ -380,6 +380,13 @@ gfx::Size StyledLabel::CalculateAndDoLayout(int width, bool dry_run) {
}
DCHECK_LE(used_width, width);
+
+ // Add bottom border. Note that StyledLabel::GetInsets() returns StyledLabel
+ // border + in some cases border of labels and borders of labels are already
+ // taken into consideration in |total_height| calculation. So GetInsect() of
+ // the parent class should be used.
+ total_height += View::GetInsets().bottom();
+
calculated_size_ = gfx::Size(used_width + GetInsets().width(), total_height);
return calculated_size_;
}
« no previous file with comments | « no previous file | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698