| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/button/native_button_gtk.h" | 5 #include "views/controls/button/native_button_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "views/controls/button/checkbox.h" | 13 #include "views/controls/button/checkbox.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 gtk_button_set_label(GTK_BUTTON(native_view()), | 36 gtk_button_set_label(GTK_BUTTON(native_view()), |
| 37 WideToUTF8(native_button_->label()).c_str()); | 37 WideToUTF8(native_button_->label()).c_str()); |
| 38 preferred_size_ = gfx::Size(); | 38 preferred_size_ = gfx::Size(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void NativeButtonGtk::UpdateFont() { | 41 void NativeButtonGtk::UpdateFont() { |
| 42 if (!native_view()) | 42 if (!native_view()) |
| 43 return; | 43 return; |
| 44 | 44 |
| 45 PangoFontDescription* pfd = | 45 PangoFontDescription* pfd = native_button_->font().GetNativeFont(); |
| 46 gfx::Font::PangoFontFromGfxFont(native_button_->font()); | |
| 47 gtk_widget_modify_font(native_view(), pfd); | 46 gtk_widget_modify_font(native_view(), pfd); |
| 48 pango_font_description_free(pfd); | 47 pango_font_description_free(pfd); |
| 49 preferred_size_ = gfx::Size(); | 48 preferred_size_ = gfx::Size(); |
| 50 } | 49 } |
| 51 | 50 |
| 52 void NativeButtonGtk::UpdateEnabled() { | 51 void NativeButtonGtk::UpdateEnabled() { |
| 53 SetEnabled(native_button_->IsEnabled()); | 52 SetEnabled(native_button_->IsEnabled()); |
| 54 } | 53 } |
| 55 | 54 |
| 56 void NativeButtonGtk::UpdateDefault() { | 55 void NativeButtonGtk::UpdateDefault() { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return new NativeCheckboxGtk(checkbox); | 283 return new NativeCheckboxGtk(checkbox); |
| 285 } | 284 } |
| 286 | 285 |
| 287 // static | 286 // static |
| 288 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( | 287 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( |
| 289 RadioButton* radio_button) { | 288 RadioButton* radio_button) { |
| 290 return new NativeRadioButtonGtk(radio_button); | 289 return new NativeRadioButtonGtk(radio_button); |
| 291 } | 290 } |
| 292 | 291 |
| 293 } // namespace views | 292 } // namespace views |
| OLD | NEW |