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

Unified Diff: ui/views/controls/button/label_button.cc

Issue 298813002: views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDirectlyToSecondWindow. Created 6 years, 6 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 | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/button/menu_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index d6647de6b6882cc2264fe6ebd356f6692cdfe767..860d1b17f623324d8a97e168b93358983b6e9681 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -100,6 +100,10 @@ void LabelButton::SetTextColor(ButtonState for_state, SkColor color) {
explicitly_set_colors_[for_state] = true;
}
+void LabelButton::SetHaloColor(SkColor color) {
+ label_->set_halo_color(color);
+}
+
bool LabelButton::GetTextMultiLine() const {
return label_->is_multi_line();
}
@@ -222,7 +226,7 @@ void LabelButton::Layout() {
adjusted_alignment = (adjusted_alignment == gfx::ALIGN_LEFT) ?
gfx::ALIGN_RIGHT : gfx::ALIGN_LEFT;
- gfx::Rect child_area(GetLocalBounds());
+ gfx::Rect child_area(GetChildAreaBounds());
child_area.Inset(GetInsets());
gfx::Size image_size(image_->GetPreferredSize());
@@ -275,6 +279,10 @@ void LabelButton::SetBorder(scoped_ptr<Border> border) {
View::SetBorder(border.Pass());
}
+gfx::Rect LabelButton::GetChildAreaBounds() {
+ return GetLocalBounds();
+}
+
void LabelButton::OnPaint(gfx::Canvas* canvas) {
View::OnPaint(canvas);
Painter::PaintFocusPainter(this, canvas, focus_painter_.get());
@@ -366,7 +374,7 @@ void LabelButton::UpdateThemedBorder() {
views::LinuxUI* linux_ui = views::LinuxUI::instance();
if (linux_ui) {
SetBorder(linux_ui->CreateNativeBorder(
- this, label_button_border.PassAs<Border>()));
+ this, label_button_border.Pass()));
} else
#endif
{
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | ui/views/controls/button/menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698