| 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" | 10 #include "app/l10n_util.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 if (for_drag) { | 270 if (for_drag) { |
| 271 #if defined(OS_WIN) | 271 #if defined(OS_WIN) |
| 272 // TODO(erg): Either port DrawStringWithHalo to linux or find an | 272 // TODO(erg): Either port DrawStringWithHalo to linux or find an |
| 273 // alternative here. | 273 // alternative here. |
| 274 canvas->DrawStringWithHalo(text_, font_, color_, color_highlight_, | 274 canvas->DrawStringWithHalo(text_, font_, color_, color_highlight_, |
| 275 text_bounds.x(), | 275 text_bounds.x(), |
| 276 text_bounds.y(), | 276 text_bounds.y(), |
| 277 text_bounds.width(), | 277 text_bounds.width(), |
| 278 text_bounds.height(), | 278 text_bounds.height(), |
| 279 l10n_util::DefaultCanvasTextAlignment()); | 279 l10n_util::DefaultCanvasTextAlignment()); |
| 280 #else |
| 281 canvas->DrawStringInt(text_, |
| 282 font_, |
| 283 color_, |
| 284 text_bounds.x(), |
| 285 text_bounds.y(), |
| 286 text_bounds.width(), |
| 287 text_bounds.height()); |
| 280 #endif | 288 #endif |
| 281 } else { | 289 } else { |
| 282 canvas->DrawStringInt(text_, | 290 canvas->DrawStringInt(text_, |
| 283 font_, | 291 font_, |
| 284 color_, | 292 color_, |
| 285 text_bounds.x(), | 293 text_bounds.x(), |
| 286 text_bounds.y(), | 294 text_bounds.y(), |
| 287 text_bounds.width(), | 295 text_bounds.width(), |
| 288 text_bounds.height()); | 296 text_bounds.height()); |
| 289 } | 297 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 bool TextButton::OnMousePressed(const MouseEvent& e) { | 346 bool TextButton::OnMousePressed(const MouseEvent& e) { |
| 339 RequestFocus(); | 347 RequestFocus(); |
| 340 return true; | 348 return true; |
| 341 } | 349 } |
| 342 | 350 |
| 343 void TextButton::Paint(gfx::Canvas* canvas) { | 351 void TextButton::Paint(gfx::Canvas* canvas) { |
| 344 Paint(canvas, false); | 352 Paint(canvas, false); |
| 345 } | 353 } |
| 346 | 354 |
| 347 } // namespace views | 355 } // namespace views |
| OLD | NEW |