| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/button/text_button.h" | 5 #include "views/controls/button/text_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
| 10 #include "app/l10n_util.h" | |
| 11 #include "app/throb_animation.h" | 10 #include "app/throb_animation.h" |
| 12 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 13 #include "views/controls/button/button.h" | 12 #include "views/controls/button/button.h" |
| 14 #include "views/event.h" | 13 #include "views/event.h" |
| 15 #include "grit/app_resources.h" | 14 #include "grit/app_resources.h" |
| 16 | 15 |
| 17 namespace views { | 16 namespace views { |
| 18 | 17 |
| 19 // Padding between the icon and text. | 18 // Padding between the icon and text. |
| 20 static const int kIconTextPadding = 5; | 19 static const int kIconTextPadding = 5; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 313 |
| 315 if (for_drag) { | 314 if (for_drag) { |
| 316 #if defined(OS_WIN) | 315 #if defined(OS_WIN) |
| 317 // TODO(erg): Either port DrawStringWithHalo to linux or find an | 316 // TODO(erg): Either port DrawStringWithHalo to linux or find an |
| 318 // alternative here. | 317 // alternative here. |
| 319 canvas->DrawStringWithHalo(text_, font_, text_color, color_highlight_, | 318 canvas->DrawStringWithHalo(text_, font_, text_color, color_highlight_, |
| 320 text_bounds.x(), | 319 text_bounds.x(), |
| 321 text_bounds.y(), | 320 text_bounds.y(), |
| 322 text_bounds.width(), | 321 text_bounds.width(), |
| 323 text_bounds.height(), | 322 text_bounds.height(), |
| 324 l10n_util::DefaultCanvasTextAlignment()); | 323 gfx::Canvas::DefaultCanvasTextAlignment()); |
| 325 #else | 324 #else |
| 326 canvas->DrawStringInt(text_, | 325 canvas->DrawStringInt(text_, |
| 327 font_, | 326 font_, |
| 328 text_color, | 327 text_color, |
| 329 text_bounds.x(), | 328 text_bounds.x(), |
| 330 text_bounds.y(), | 329 text_bounds.y(), |
| 331 text_bounds.width(), | 330 text_bounds.width(), |
| 332 text_bounds.height()); | 331 text_bounds.height()); |
| 333 #endif | 332 #endif |
| 334 } else { | 333 } else { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 bool TextButton::OnMousePressed(const MouseEvent& e) { | 390 bool TextButton::OnMousePressed(const MouseEvent& e) { |
| 392 RequestFocus(); | 391 RequestFocus(); |
| 393 return true; | 392 return true; |
| 394 } | 393 } |
| 395 | 394 |
| 396 void TextButton::Paint(gfx::Canvas* canvas) { | 395 void TextButton::Paint(gfx::Canvas* canvas) { |
| 397 Paint(canvas, false); | 396 Paint(canvas, false); |
| 398 } | 397 } |
| 399 | 398 |
| 400 } // namespace views | 399 } // namespace views |
| OLD | NEW |