OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/libgtkui/native_theme_gtk3.h" | 5 #include "chrome/browser/ui/libgtkui/native_theme_gtk3.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h" | 9 #include "chrome/browser/ui/libgtkui/chrome_gtk_frame.h" |
10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h" | 10 #include "chrome/browser/ui/libgtkui/chrome_gtk_menu_subclasses.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 SkColor ret_color = SkColorSetRGB(color->red / 255, color->green / 255, | 128 SkColor ret_color = SkColorSetRGB(color->red / 255, color->green / 255, |
129 color->blue / 255); | 129 color->blue / 255); |
130 gdk_color_free(color); | 130 gdk_color_free(color); |
131 return ret_color; | 131 return ret_color; |
132 } else { | 132 } else { |
133 // Default color comes from gtklinkbutton.c. | 133 // Default color comes from gtklinkbutton.c. |
134 return SkColorSetRGB(0x00, 0x00, 0xEE); | 134 return SkColorSetRGB(0x00, 0x00, 0xEE); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
| 138 // Separator |
| 139 case ui::NativeTheme::kColorId_SeparatorColor: |
| 140 return GetFgColor("GtkSeparator#separator.horizontal"); |
| 141 |
138 // Button | 142 // Button |
139 case ui::NativeTheme::kColorId_ButtonEnabledColor: | 143 case ui::NativeTheme::kColorId_ButtonEnabledColor: |
140 return GetFgColor("GtkButton#button.text-button GtkLabel#label"); | 144 return GetFgColor("GtkButton#button.text-button GtkLabel#label"); |
141 case ui::NativeTheme::kColorId_ButtonDisabledColor: | 145 case ui::NativeTheme::kColorId_ButtonDisabledColor: |
142 return GetFgColor("GtkButton#button.text-button:disabled GtkLabel#label"); | 146 return GetFgColor("GtkButton#button.text-button:disabled GtkLabel#label"); |
143 case ui::NativeTheme::kColorId_ButtonHoverColor: | 147 case ui::NativeTheme::kColorId_ButtonHoverColor: |
144 return GetFgColor("GtkButton#button.text-button:hover GtkLabel#label"); | 148 return GetFgColor("GtkButton#button.text-button:hover GtkLabel#label"); |
145 case ui::NativeTheme::kColorId_ButtonPressedShade: | 149 case ui::NativeTheme::kColorId_ButtonPressedShade: |
146 return SK_ColorTRANSPARENT; | 150 return SK_ColorTRANSPARENT; |
147 | 151 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 g_type_class_unref(g_type_class_ref(gtk_link_button_get_type())); | 318 g_type_class_unref(g_type_class_ref(gtk_link_button_get_type())); |
315 g_type_class_unref(g_type_class_ref(gtk_spinner_get_type())); | 319 g_type_class_unref(g_type_class_ref(gtk_spinner_get_type())); |
316 g_type_class_unref(g_type_class_ref(gtk_menu_get_type())); | 320 g_type_class_unref(g_type_class_ref(gtk_menu_get_type())); |
317 g_type_class_unref(g_type_class_ref(gtk_menu_item_get_type())); | 321 g_type_class_unref(g_type_class_ref(gtk_menu_item_get_type())); |
318 g_type_class_unref(g_type_class_ref(gtk_entry_get_type())); | 322 g_type_class_unref(g_type_class_ref(gtk_entry_get_type())); |
319 g_type_class_unref(g_type_class_ref(gtk_info_bar_get_type())); | 323 g_type_class_unref(g_type_class_ref(gtk_info_bar_get_type())); |
320 g_type_class_unref(g_type_class_ref(gtk_tooltip_get_type())); | 324 g_type_class_unref(g_type_class_ref(gtk_tooltip_get_type())); |
321 g_type_class_unref(g_type_class_ref(gtk_scrollbar_get_type())); | 325 g_type_class_unref(g_type_class_ref(gtk_scrollbar_get_type())); |
322 g_type_class_unref(g_type_class_ref(gtk_toolbar_get_type())); | 326 g_type_class_unref(g_type_class_ref(gtk_toolbar_get_type())); |
323 g_type_class_unref(g_type_class_ref(gtk_text_view_get_type())); | 327 g_type_class_unref(g_type_class_ref(gtk_text_view_get_type())); |
| 328 g_type_class_unref(g_type_class_ref(gtk_separator_get_type())); |
324 | 329 |
325 g_signal_connect_after(gtk_settings_get_default(), "notify::gtk-theme-name", | 330 g_signal_connect_after(gtk_settings_get_default(), "notify::gtk-theme-name", |
326 G_CALLBACK(OnThemeChanged), this); | 331 G_CALLBACK(OnThemeChanged), this); |
327 } | 332 } |
328 | 333 |
329 // This doesn't actually get called | 334 // This doesn't actually get called |
330 NativeThemeGtk3::~NativeThemeGtk3() {} | 335 NativeThemeGtk3::~NativeThemeGtk3() {} |
331 | 336 |
332 void NativeThemeGtk3::ResetColorCache() { | 337 void NativeThemeGtk3::ResetColorCache() { |
333 for (auto& color : color_cache_) | 338 for (auto& color : color_cache_) |
(...skipping 19 matching lines...) Expand all Loading... |
353 void NativeThemeGtk3::PaintMenuItemBackground( | 358 void NativeThemeGtk3::PaintMenuItemBackground( |
354 SkCanvas* canvas, | 359 SkCanvas* canvas, |
355 State state, | 360 State state, |
356 const gfx::Rect& rect, | 361 const gfx::Rect& rect, |
357 const MenuItemExtraParams& menu_item) const { | 362 const MenuItemExtraParams& menu_item) const { |
358 PaintWidget(canvas, rect, "GtkMenu#menu GtkMenuItem#menuitem", | 363 PaintWidget(canvas, rect, "GtkMenu#menu GtkMenuItem#menuitem", |
359 StateToStateFlags(state)); | 364 StateToStateFlags(state)); |
360 } | 365 } |
361 | 366 |
362 } // namespace libgtkui | 367 } // namespace libgtkui |
OLD | NEW |