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

Side by Side Diff: views/controls/button/native_button_gtk.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/button/native_button.cc ('k') | views/controls/button/native_button_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/button/native_button.cc ('k') | views/controls/button/native_button_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698