| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) { | 63 SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) { |
| 64 const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43); | 64 const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43); |
| 65 const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29); | 65 const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29); |
| 66 | 66 |
| 67 switch (color_id) { | 67 switch (color_id) { |
| 68 // Windows | 68 // Windows |
| 69 case ui::NativeTheme::kColorId_WindowBackground: | 69 case ui::NativeTheme::kColorId_WindowBackground: |
| 70 // Dialogs | 70 // Dialogs |
| 71 case ui::NativeTheme::kColorId_DialogBackground: | 71 case ui::NativeTheme::kColorId_DialogBackground: |
| 72 case ui::NativeTheme::kColorId_BubbleBackground: | 72 case ui::NativeTheme::kColorId_BubbleBackground: |
| 73 return GetBGColor(""); | 73 return GetBgColor(""); |
| 74 | 74 |
| 75 // FocusableBorder | 75 // FocusableBorder |
| 76 case ui::NativeTheme::kColorId_FocusedBorderColor: | 76 case ui::NativeTheme::kColorId_FocusedBorderColor: |
| 77 return GetBorderColor("GtkEntry.entry:focus"); | 77 return GetBorderColor("GtkEntry.entry:focus"); |
| 78 case ui::NativeTheme::kColorId_UnfocusedBorderColor: | 78 case ui::NativeTheme::kColorId_UnfocusedBorderColor: |
| 79 return GetBorderColor("GtkEntry.entry"); | 79 return GetBorderColor("GtkEntry.entry"); |
| 80 | 80 |
| 81 // Menu | 81 // Menu |
| 82 case ui::NativeTheme::kColorId_MenuBackgroundColor: | 82 case ui::NativeTheme::kColorId_MenuBackgroundColor: |
| 83 return GetBGColor("GtkMenu.menu"); | 83 return GetBgColor("GtkMenu.menu"); |
| 84 case ui::NativeTheme::kColorId_MenuBorderColor: | 84 case ui::NativeTheme::kColorId_MenuBorderColor: |
| 85 return GetBorderColor("GtkMenu.menu"); | 85 return GetBorderColor("GtkMenu.menu"); |
| 86 case ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor: | 86 case ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor: |
| 87 return GetBGColor("GtkMenu.menu GtkMenuItem.menuitem:focus"); | 87 return GetBgColor("GtkMenu.menu GtkMenuItem.menuitem:focus"); |
| 88 case ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor: | 88 case ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor: |
| 89 return GetFGColor("GtkMenu.menu GtkMenuItem.menuitem GtkLabel.label"); | 89 return GetFgColor("GtkMenu.menu GtkMenuItem.menuitem GtkLabel.label"); |
| 90 case ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 90 case ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
| 91 return GetFGColor( | 91 return GetFgColor( |
| 92 "GtkMenu.menu GtkMenuItem.menuitem:selected GtkLabel.label"); | 92 "GtkMenu.menu GtkMenuItem.menuitem:selected GtkLabel.label"); |
| 93 case ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor: | 93 case ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor: |
| 94 return GetFGColor( | 94 return GetFgColor( |
| 95 "GtkMenu.menu GtkMenuItem.menuitem:disabled GtkLabel.label"); | 95 "GtkMenu.menu GtkMenuItem.menuitem:disabled GtkLabel.label"); |
| 96 case ui::NativeTheme::kColorId_MenuItemSubtitleColor: | 96 case ui::NativeTheme::kColorId_MenuItemSubtitleColor: |
| 97 return GetFGColor( | 97 return GetFgColor( |
| 98 "GtkMenu.menu GtkMenuItem.menuitem GtkLabel.label.accelerator"); | 98 "GtkMenu.menu GtkMenuItem.menuitem GtkLabel.label.accelerator"); |
| 99 case ui::NativeTheme::kColorId_MenuSeparatorColor: | 99 case ui::NativeTheme::kColorId_MenuSeparatorColor: |
| 100 // MenuButton borders are used the same way as menu separators in Chrome. | 100 // MenuButton borders are used the same way as menu separators in Chrome. |
| 101 case ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor: | 101 case ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor: |
| 102 case ui::NativeTheme::kColorId_FocusedMenuButtonBorderColor: | 102 case ui::NativeTheme::kColorId_FocusedMenuButtonBorderColor: |
| 103 case ui::NativeTheme::kColorId_HoverMenuButtonBorderColor: | 103 case ui::NativeTheme::kColorId_HoverMenuButtonBorderColor: |
| 104 return GetFGColor("GtkMenu.menu GtkMenuItem.menuitem.separator:disabled"); | 104 return GetFgColor("GtkMenu.menu GtkMenuItem.menuitem.separator:disabled"); |
| 105 | 105 |
| 106 // Label | 106 // Label |
| 107 case ui::NativeTheme::kColorId_LabelEnabledColor: | 107 case ui::NativeTheme::kColorId_LabelEnabledColor: |
| 108 return GetFGColor("GtkLabel.label"); | 108 return GetFgColor("GtkLabel.label"); |
| 109 case ui::NativeTheme::kColorId_LabelDisabledColor: | 109 case ui::NativeTheme::kColorId_LabelDisabledColor: |
| 110 return GetFGColor("GtkLabel.label:disabled"); | 110 return GetFgColor("GtkLabel.label:disabled"); |
| 111 case ui::NativeTheme::kColorId_LabelTextSelectionColor: | 111 case ui::NativeTheme::kColorId_LabelTextSelectionColor: |
| 112 return GetFGColor("GtkLabel.label .selection:selected"); | 112 return GetFgColor("GtkLabel.label .selection:selected"); |
| 113 case ui::NativeTheme::kColorId_LabelTextSelectionBackgroundFocused: | 113 case ui::NativeTheme::kColorId_LabelTextSelectionBackgroundFocused: |
| 114 return GetBGColor("GtkLabel.label .selection:selected"); | 114 return GetBgColor("GtkLabel.label .selection:selected"); |
| 115 | 115 |
| 116 // Link | 116 // Link |
| 117 case ui::NativeTheme::kColorId_LinkDisabled: | 117 case ui::NativeTheme::kColorId_LinkDisabled: |
| 118 return SkColorSetA( | 118 return SkColorSetA( |
| 119 SkColorFromColorId(ui::NativeTheme::kColorId_LinkEnabled), 0xBB); | 119 SkColorFromColorId(ui::NativeTheme::kColorId_LinkEnabled), 0xBB); |
| 120 case ui::NativeTheme::kColorId_LinkPressed: | 120 case ui::NativeTheme::kColorId_LinkPressed: |
| 121 case ui::NativeTheme::kColorId_LinkEnabled: { | 121 case ui::NativeTheme::kColorId_LinkEnabled: { |
| 122 // TODO(thomasanderson): Gtk changed the way links are colored in 3.12. | 122 // TODO(thomasanderson): Gtk changed the way links are colored in 3.12. |
| 123 // Add code for later versions. | 123 // Add code for later versions. |
| 124 auto link_context = GetStyleContextFromCss("GtkLabel.label.view"); | 124 auto link_context = GetStyleContextFromCss("GtkLabel.label.view"); |
| 125 GdkColor* color; | 125 GdkColor* color; |
| 126 gtk_style_context_get_style(link_context, "link-color", &color, nullptr); | 126 gtk_style_context_get_style(link_context, "link-color", &color, nullptr); |
| 127 if (color) { | 127 if (color) { |
| 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 // Button | 138 // Button |
| 139 case ui::NativeTheme::kColorId_ButtonEnabledColor: | 139 case ui::NativeTheme::kColorId_ButtonEnabledColor: |
| 140 return GetFGColor("GtkButton.button.text-button GtkLabel.label"); | 140 return GetFgColor("GtkButton.button.text-button GtkLabel.label"); |
| 141 case ui::NativeTheme::kColorId_ButtonDisabledColor: | 141 case ui::NativeTheme::kColorId_ButtonDisabledColor: |
| 142 return GetFGColor("GtkButton.button.text-button:disabled GtkLabel.label"); | 142 return GetFgColor("GtkButton.button.text-button:disabled GtkLabel.label"); |
| 143 case ui::NativeTheme::kColorId_ButtonHoverColor: | 143 case ui::NativeTheme::kColorId_ButtonHoverColor: |
| 144 return GetFGColor("GtkButton.button.text-button:hover GtkLabel.label"); | 144 return GetFgColor("GtkButton.button.text-button:hover GtkLabel.label"); |
| 145 case ui::NativeTheme::kColorId_ButtonPressedShade: | 145 case ui::NativeTheme::kColorId_ButtonPressedShade: |
| 146 return SK_ColorTRANSPARENT; | 146 return SK_ColorTRANSPARENT; |
| 147 | 147 |
| 148 case ui::NativeTheme::kColorId_BlueButtonEnabledColor: | 148 case ui::NativeTheme::kColorId_BlueButtonEnabledColor: |
| 149 return GetFGColor( | 149 return GetFgColor( |
| 150 "GtkButton.button.text-button.suggested-action GtkLabel.label"); | 150 "GtkButton.button.text-button.suggested-action GtkLabel.label"); |
| 151 case ui::NativeTheme::kColorId_BlueButtonDisabledColor: | 151 case ui::NativeTheme::kColorId_BlueButtonDisabledColor: |
| 152 return GetFGColor( | 152 return GetFgColor( |
| 153 "GtkButton.button.text-button.suggested-action:disabled " | 153 "GtkButton.button.text-button.suggested-action:disabled " |
| 154 "GtkLabel.label"); | 154 "GtkLabel.label"); |
| 155 case ui::NativeTheme::kColorId_BlueButtonHoverColor: | 155 case ui::NativeTheme::kColorId_BlueButtonHoverColor: |
| 156 return GetFGColor( | 156 return GetFgColor( |
| 157 "GtkButton.button.text-button.suggested-action:hover GtkLabel.label"); | 157 "GtkButton.button.text-button.suggested-action:hover GtkLabel.label"); |
| 158 case ui::NativeTheme::kColorId_BlueButtonPressedColor: | 158 case ui::NativeTheme::kColorId_BlueButtonPressedColor: |
| 159 return GetFGColor( | 159 return GetFgColor( |
| 160 "GtkButton.button.text-button.suggested-action:hover:active " | 160 "GtkButton.button.text-button.suggested-action:hover:active " |
| 161 "GtkLabel.label"); | 161 "GtkLabel.label"); |
| 162 case ui::NativeTheme::kColorId_BlueButtonShadowColor: | 162 case ui::NativeTheme::kColorId_BlueButtonShadowColor: |
| 163 return SK_ColorTRANSPARENT; | 163 return SK_ColorTRANSPARENT; |
| 164 | 164 |
| 165 case ui::NativeTheme::kColorId_ProminentButtonColor: | 165 case ui::NativeTheme::kColorId_ProminentButtonColor: |
| 166 return GetBGColor("GtkButton.button.text-button.destructive-action"); | 166 return GetBgColor("GtkButton.button.text-button.destructive-action"); |
| 167 case ui::NativeTheme::kColorId_TextOnProminentButtonColor: | 167 case ui::NativeTheme::kColorId_TextOnProminentButtonColor: |
| 168 return GetFGColor( | 168 return GetFgColor( |
| 169 "GtkButton.button.text-button.destructive-action GtkLabel.label"); | 169 "GtkButton.button.text-button.destructive-action GtkLabel.label"); |
| 170 | 170 |
| 171 // Textfield | 171 // Textfield |
| 172 case ui::NativeTheme::kColorId_TextfieldDefaultColor: | 172 case ui::NativeTheme::kColorId_TextfieldDefaultColor: |
| 173 return GetFGColor("GtkEntry.entry"); | 173 return GetFgColor("GtkEntry.entry"); |
| 174 case ui::NativeTheme::kColorId_TextfieldDefaultBackground: | 174 case ui::NativeTheme::kColorId_TextfieldDefaultBackground: |
| 175 return GetBGColor("GtkEntry.entry"); | 175 return GetBgColor("GtkEntry.entry"); |
| 176 case ui::NativeTheme::kColorId_TextfieldReadOnlyColor: | 176 case ui::NativeTheme::kColorId_TextfieldReadOnlyColor: |
| 177 return GetFGColor("GtkEntry.entry:disabled"); | 177 return GetFgColor("GtkEntry.entry:disabled"); |
| 178 case ui::NativeTheme::kColorId_TextfieldReadOnlyBackground: | 178 case ui::NativeTheme::kColorId_TextfieldReadOnlyBackground: |
| 179 return GetBGColor("GtkEntry.entry:disabled"); | 179 return GetBgColor("GtkEntry.entry:disabled"); |
| 180 case ui::NativeTheme::kColorId_TextfieldSelectionColor: | 180 case ui::NativeTheme::kColorId_TextfieldSelectionColor: |
| 181 return GetFGColor("GtkEntry.entry .selection:selected"); | 181 return GetFgColor("GtkEntry.entry .selection:selected"); |
| 182 case ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused: | 182 case ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused: |
| 183 return GetBGColor("GtkEntry.entry .selection:selected"); | 183 return GetBgColor("GtkEntry.entry .selection:selected"); |
| 184 | 184 |
| 185 // Tooltips | 185 // Tooltips |
| 186 case ui::NativeTheme::kColorId_TooltipBackground: | 186 case ui::NativeTheme::kColorId_TooltipBackground: |
| 187 return GetBGColor("GtkTooltip.tooltip"); | 187 return GetBgColor("GtkTooltip.tooltip"); |
| 188 case ui::NativeTheme::kColorId_TooltipText: | 188 case ui::NativeTheme::kColorId_TooltipText: |
| 189 return color_utils::GetReadableColor(GetFGColor("GtkTooltip.tooltip"), | 189 return color_utils::GetReadableColor(GetFgColor("GtkTooltip.tooltip"), |
| 190 GetBGColor("GtkTooltip.tooltip")); | 190 GetBgColor("GtkTooltip.tooltip")); |
| 191 | 191 |
| 192 // Trees and Tables (implemented on GTK using the same class) | 192 // Trees and Tables (implemented on GTK using the same class) |
| 193 case ui::NativeTheme::kColorId_TableBackground: | 193 case ui::NativeTheme::kColorId_TableBackground: |
| 194 case ui::NativeTheme::kColorId_TreeBackground: | 194 case ui::NativeTheme::kColorId_TreeBackground: |
| 195 return GetBGColor("GtkTreeView.view"); | 195 return GetBgColor("GtkTreeView.view"); |
| 196 case ui::NativeTheme::kColorId_TableText: | 196 case ui::NativeTheme::kColorId_TableText: |
| 197 case ui::NativeTheme::kColorId_TreeText: | 197 case ui::NativeTheme::kColorId_TreeText: |
| 198 case ui::NativeTheme::kColorId_TreeArrow: | 198 case ui::NativeTheme::kColorId_TreeArrow: |
| 199 case ui::NativeTheme::kColorId_TableGroupingIndicatorColor: | 199 case ui::NativeTheme::kColorId_TableGroupingIndicatorColor: |
| 200 return GetFGColor("GtkTreeView.view .cell"); | 200 return GetFgColor("GtkTreeView.view .cell"); |
| 201 case ui::NativeTheme::kColorId_TableSelectedText: | 201 case ui::NativeTheme::kColorId_TableSelectedText: |
| 202 case ui::NativeTheme::kColorId_TableSelectedTextUnfocused: | 202 case ui::NativeTheme::kColorId_TableSelectedTextUnfocused: |
| 203 case ui::NativeTheme::kColorId_TreeSelectedText: | 203 case ui::NativeTheme::kColorId_TreeSelectedText: |
| 204 case ui::NativeTheme::kColorId_TreeSelectedTextUnfocused: | 204 case ui::NativeTheme::kColorId_TreeSelectedTextUnfocused: |
| 205 return GetFGColor("GtkTreeView.view .cell:selected"); | 205 return GetFgColor("GtkTreeView.view .cell:selected"); |
| 206 case ui::NativeTheme::kColorId_TableSelectionBackgroundFocused: | 206 case ui::NativeTheme::kColorId_TableSelectionBackgroundFocused: |
| 207 case ui::NativeTheme::kColorId_TableSelectionBackgroundUnfocused: | 207 case ui::NativeTheme::kColorId_TableSelectionBackgroundUnfocused: |
| 208 case ui::NativeTheme::kColorId_TreeSelectionBackgroundFocused: | 208 case ui::NativeTheme::kColorId_TreeSelectionBackgroundFocused: |
| 209 case ui::NativeTheme::kColorId_TreeSelectionBackgroundUnfocused: | 209 case ui::NativeTheme::kColorId_TreeSelectionBackgroundUnfocused: |
| 210 return GetBGColor("GtkTreeView.view .cell:selected"); | 210 return GetBgColor("GtkTreeView.view .cell:selected"); |
| 211 | 211 |
| 212 // Results Table | 212 // Results Table |
| 213 // TODO(thomasanderson): The GtkEntry selectors was how the gtk2 theme got | 213 // TODO(thomasanderson): The GtkEntry selectors was how the gtk2 theme got |
| 214 // these colors. Update this code to use a different widget. | 214 // these colors. Update this code to use a different widget. |
| 215 case ui::NativeTheme::kColorId_ResultsTableNormalBackground: | 215 case ui::NativeTheme::kColorId_ResultsTableNormalBackground: |
| 216 return GetBGColor("GtkEntry.entry"); | 216 return GetBgColor("GtkEntry.entry"); |
| 217 case ui::NativeTheme::kColorId_ResultsTableHoveredBackground: | 217 case ui::NativeTheme::kColorId_ResultsTableHoveredBackground: |
| 218 return color_utils::AlphaBlend( | 218 return color_utils::AlphaBlend( |
| 219 GetBGColor("GtkEntry.entry"), | 219 GetBgColor("GtkEntry.entry"), |
| 220 GetBGColor("GtkEntry.entry .selection:selected"), 0x80); | 220 GetBgColor("GtkEntry.entry .selection:selected"), 0x80); |
| 221 case ui::NativeTheme::kColorId_ResultsTableSelectedBackground: | 221 case ui::NativeTheme::kColorId_ResultsTableSelectedBackground: |
| 222 return GetBGColor("GtkEntry.entry .selection:selected"); | 222 return GetBgColor("GtkEntry.entry .selection:selected"); |
| 223 case ui::NativeTheme::kColorId_ResultsTableNormalText: | 223 case ui::NativeTheme::kColorId_ResultsTableNormalText: |
| 224 case ui::NativeTheme::kColorId_ResultsTableHoveredText: | 224 case ui::NativeTheme::kColorId_ResultsTableHoveredText: |
| 225 return GetFGColor("GtkEntry.entry"); | 225 return GetFgColor("GtkEntry.entry"); |
| 226 case ui::NativeTheme::kColorId_ResultsTableSelectedText: | 226 case ui::NativeTheme::kColorId_ResultsTableSelectedText: |
| 227 return GetFGColor("GtkEntry.entry .selection:selected"); | 227 return GetFgColor("GtkEntry.entry .selection:selected"); |
| 228 case ui::NativeTheme::kColorId_ResultsTableNormalDimmedText: | 228 case ui::NativeTheme::kColorId_ResultsTableNormalDimmedText: |
| 229 case ui::NativeTheme::kColorId_ResultsTableHoveredDimmedText: | 229 case ui::NativeTheme::kColorId_ResultsTableHoveredDimmedText: |
| 230 return color_utils::AlphaBlend(GetFGColor("GtkEntry.entry"), | 230 return color_utils::AlphaBlend(GetFgColor("GtkEntry.entry"), |
| 231 GetBGColor("GtkEntry.entry"), 0x80); | 231 GetBgColor("GtkEntry.entry"), 0x80); |
| 232 case ui::NativeTheme::kColorId_ResultsTableSelectedDimmedText: | 232 case ui::NativeTheme::kColorId_ResultsTableSelectedDimmedText: |
| 233 return color_utils::AlphaBlend( | 233 return color_utils::AlphaBlend( |
| 234 GetFGColor("GtkEntry.entry .selection:selected"), | 234 GetFgColor("GtkEntry.entry .selection:selected"), |
| 235 GetBGColor("GtkEntry.entry"), 0x80); | 235 GetBgColor("GtkEntry.entry"), 0x80); |
| 236 case ui::NativeTheme::kColorId_ResultsTableNormalUrl: | 236 case ui::NativeTheme::kColorId_ResultsTableNormalUrl: |
| 237 case ui::NativeTheme::kColorId_ResultsTableHoveredUrl: | 237 case ui::NativeTheme::kColorId_ResultsTableHoveredUrl: |
| 238 return NormalURLColor(GetFGColor("GtkEntry.entry")); | 238 return NormalURLColor(GetFgColor("GtkEntry.entry")); |
| 239 case ui::NativeTheme::kColorId_ResultsTableSelectedUrl: | 239 case ui::NativeTheme::kColorId_ResultsTableSelectedUrl: |
| 240 return SelectedURLColor(GetFGColor("GtkEntry.entry .selection:selected"), | 240 return SelectedURLColor(GetFgColor("GtkEntry.entry .selection:selected"), |
| 241 GetBGColor("GtkEntry.entry .selection:selected")); | 241 GetBgColor("GtkEntry.entry .selection:selected")); |
| 242 | 242 |
| 243 case ui::NativeTheme::kColorId_ResultsTablePositiveText: | 243 case ui::NativeTheme::kColorId_ResultsTablePositiveText: |
| 244 return color_utils::GetReadableColor(kPositiveTextColor, | 244 return color_utils::GetReadableColor(kPositiveTextColor, |
| 245 GetBGColor("GtkEntry.entry")); | 245 GetBgColor("GtkEntry.entry")); |
| 246 case ui::NativeTheme::kColorId_ResultsTablePositiveHoveredText: | 246 case ui::NativeTheme::kColorId_ResultsTablePositiveHoveredText: |
| 247 return color_utils::GetReadableColor(kPositiveTextColor, | 247 return color_utils::GetReadableColor(kPositiveTextColor, |
| 248 GetBGColor("GtkEntry.entry:hover")); | 248 GetBgColor("GtkEntry.entry:hover")); |
| 249 case ui::NativeTheme::kColorId_ResultsTablePositiveSelectedText: | 249 case ui::NativeTheme::kColorId_ResultsTablePositiveSelectedText: |
| 250 return color_utils::GetReadableColor( | 250 return color_utils::GetReadableColor( |
| 251 kPositiveTextColor, GetBGColor("GtkEntry.entry:selected")); | 251 kPositiveTextColor, GetBgColor("GtkEntry.entry:selected")); |
| 252 case ui::NativeTheme::kColorId_ResultsTableNegativeText: | 252 case ui::NativeTheme::kColorId_ResultsTableNegativeText: |
| 253 return color_utils::GetReadableColor(kNegativeTextColor, | 253 return color_utils::GetReadableColor(kNegativeTextColor, |
| 254 GetBGColor("GtkEntry.entry")); | 254 GetBgColor("GtkEntry.entry")); |
| 255 case ui::NativeTheme::kColorId_ResultsTableNegativeHoveredText: | 255 case ui::NativeTheme::kColorId_ResultsTableNegativeHoveredText: |
| 256 return color_utils::GetReadableColor(kNegativeTextColor, | 256 return color_utils::GetReadableColor(kNegativeTextColor, |
| 257 GetBGColor("GtkEntry.entry:hover")); | 257 GetBgColor("GtkEntry.entry:hover")); |
| 258 case ui::NativeTheme::kColorId_ResultsTableNegativeSelectedText: | 258 case ui::NativeTheme::kColorId_ResultsTableNegativeSelectedText: |
| 259 return color_utils::GetReadableColor( | 259 return color_utils::GetReadableColor( |
| 260 kNegativeTextColor, GetBGColor("GtkEntry.entry:selected")); | 260 kNegativeTextColor, GetBgColor("GtkEntry.entry:selected")); |
| 261 | 261 |
| 262 // Throbber | 262 // Throbber |
| 263 // TODO(thomasanderson): Render GtkSpinner directly. | 263 // TODO(thomasanderson): Render GtkSpinner directly. |
| 264 case ui::NativeTheme::kColorId_ThrobberSpinningColor: | 264 case ui::NativeTheme::kColorId_ThrobberSpinningColor: |
| 265 case ui::NativeTheme::kColorId_ThrobberWaitingColor: | 265 case ui::NativeTheme::kColorId_ThrobberWaitingColor: |
| 266 return GetFGColor("GtkMenu.menu GtkSpinner.spinner"); | 266 return GetFgColor("GtkMenu.menu GtkSpinner.spinner"); |
| 267 case ui::NativeTheme::kColorId_ThrobberLightColor: | 267 case ui::NativeTheme::kColorId_ThrobberLightColor: |
| 268 return GetFGColor("GtkMenu.menu GtkSpinner.spinner:disabled"); | 268 return GetFgColor("GtkMenu.menu GtkSpinner.spinner:disabled"); |
| 269 | 269 |
| 270 // Alert icons | 270 // Alert icons |
| 271 case ui::NativeTheme::kColorId_AlertSeverityLow: | 271 case ui::NativeTheme::kColorId_AlertSeverityLow: |
| 272 return GetBGColor("GtkInfoBar.infobar.info"); | 272 return GetBgColor("GtkInfoBar.infobar.info"); |
| 273 case ui::NativeTheme::kColorId_AlertSeverityMedium: | 273 case ui::NativeTheme::kColorId_AlertSeverityMedium: |
| 274 return GetBGColor("GtkInfoBar.infobar.warning"); | 274 return GetBgColor("GtkInfoBar.infobar.warning"); |
| 275 case ui::NativeTheme::kColorId_AlertSeverityHigh: | 275 case ui::NativeTheme::kColorId_AlertSeverityHigh: |
| 276 return GetBGColor("GtkInfoBar.infobar.error"); | 276 return GetBgColor("GtkInfoBar.infobar.error"); |
| 277 | 277 |
| 278 case ui::NativeTheme::kColorId_NumColors: | 278 case ui::NativeTheme::kColorId_NumColors: |
| 279 NOTREACHED(); | 279 NOTREACHED(); |
| 280 break; | 280 break; |
| 281 } | 281 } |
| 282 return kInvalidColorIdColor; | 282 return kInvalidColorIdColor; |
| 283 } | 283 } |
| 284 | 284 |
| 285 void OnThemeChanged(GObject* obj, GParamSpec* param, NativeThemeGtk3* theme) { | 285 void OnThemeChanged(GObject* obj, GParamSpec* param, NativeThemeGtk3* theme) { |
| 286 theme->ResetColorCache(); | 286 theme->ResetColorCache(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 void NativeThemeGtk3::PaintMenuItemBackground( | 344 void NativeThemeGtk3::PaintMenuItemBackground( |
| 345 SkCanvas* canvas, | 345 SkCanvas* canvas, |
| 346 State state, | 346 State state, |
| 347 const gfx::Rect& rect, | 347 const gfx::Rect& rect, |
| 348 const MenuItemExtraParams& menu_item) const { | 348 const MenuItemExtraParams& menu_item) const { |
| 349 PaintWidget(canvas, rect, "GtkMenu.menu GtkMenuItem.menuitem", | 349 PaintWidget(canvas, rect, "GtkMenu.menu GtkMenuItem.menuitem", |
| 350 StateToStateFlags(state)); | 350 StateToStateFlags(state)); |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace libgtkui | 353 } // namespace libgtkui |
| OLD | NEW |