Chromium Code Reviews| Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
| index e22761f027484abee8545cb625104892288b1e41..844e4f9477d780293d3b08be5491bc6131e91b28 100644 |
| --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
| @@ -473,6 +473,7 @@ views::LinuxUI::NonClientMiddleClickAction GetDefaultMiddleClickAction() { |
| Gtk2UI::Gtk2UI() |
| : default_font_size_pixels_(0), |
| default_font_style_(gfx::Font::NORMAL), |
| + default_font_weight_(gfx::Font::Weight::NORMAL), |
| middle_click_action_(GetDefaultMiddleClickAction()), |
| device_scale_factor_(1.0) { |
| GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess()); |
| @@ -820,11 +821,13 @@ gfx::FontRenderParams Gtk2UI::GetDefaultFontRenderParams() const { |
| void Gtk2UI::GetDefaultFontDescription( |
| std::string* family_out, |
| int* size_pixels_out, |
| - int* style_out, |
| + bool* italic_out, |
| + gfx::Font::Weight* weight_out, |
| gfx::FontRenderParams* params_out) const { |
| *family_out = default_font_family_; |
| *size_pixels_out = default_font_size_pixels_; |
| - *style_out = default_font_style_; |
| + *italic_out = (default_font_style_ & gfx::Font::ITALIC) != 0; |
| + *weight_out = default_font_weight_; |
| *params_out = default_font_render_params_; |
| } |
| @@ -1346,9 +1349,10 @@ void Gtk2UI::UpdateDefaultFont() { |
| } |
| query.style = gfx::Font::NORMAL; |
| - // TODO(davemoore): Support weights other than bold? |
| + query.weight = gfx::Font::Weight::NORMAL; |
| + // TODO(mboc): Support weights other than bold. |
| if (pango_font_description_get_weight(desc) == PANGO_WEIGHT_BOLD) |
| - query.style |= gfx::Font::BOLD; |
| + query.weight = gfx::Font::Weight::BOLD; |
|
Peter Kasting
2016/03/26 00:56:51
I think you can just do:
query.weight =
s
Mikus
2016/03/29 10:55:38
Done.
|
| // TODO(davemoore): What about PANGO_STYLE_OBLIQUE? |
| if (pango_font_description_get_style(desc) == PANGO_STYLE_ITALIC) |
| query.style |= gfx::Font::ITALIC; |