| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/libgtk2ui/native_theme_gtk2.h" | 5 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" | 9 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" |
| 10 #include "ui/gfx/color_utils.h" | 10 #include "ui/gfx/color_utils.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // MenuItem | 139 // MenuItem |
| 140 case kColorId_EnabledMenuItemForegroundColor: | 140 case kColorId_EnabledMenuItemForegroundColor: |
| 141 return GetMenuItemStyle()->text[GTK_STATE_NORMAL]; | 141 return GetMenuItemStyle()->text[GTK_STATE_NORMAL]; |
| 142 case kColorId_DisabledMenuItemForegroundColor: | 142 case kColorId_DisabledMenuItemForegroundColor: |
| 143 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; | 143 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; |
| 144 // TODO(erg): We also need a FocusedMenuItemForegroundColor, since the | 144 // TODO(erg): We also need a FocusedMenuItemForegroundColor, since the |
| 145 // accessibility theme HighContrastInverse is unreadable without it. That | 145 // accessibility theme HighContrastInverse is unreadable without it. That |
| 146 // will require careful threading through existing menu code though. | 146 // will require careful threading through existing menu code though. |
| 147 case kColorId_FocusedMenuItemBackgroundColor: | 147 case kColorId_FocusedMenuItemBackgroundColor: |
| 148 return GetMenuItemStyle()->bg[GTK_STATE_SELECTED]; | 148 return GetMenuItemStyle()->bg[GTK_STATE_SELECTED]; |
| 149 case kColorId_HoverMenuItemBackgroundColor: |
| 150 return GetMenuItemStyle()->bg[GTK_STATE_PRELIGHT]; |
| 151 case kColorId_FocusedMenuButtonBorderColor: |
| 152 return GetEntryStyle()->bg[GTK_STATE_NORMAL]; |
| 153 case kColorId_HoverMenuButtonBorderColor: |
| 154 return GetEntryStyle()->text_aa[GTK_STATE_PRELIGHT]; |
| 149 case kColorId_MenuBorderColor: | 155 case kColorId_MenuBorderColor: |
| 156 case kColorId_EnabledMenuButtonBorderColor: |
| 150 case kColorId_MenuSeparatorColor: { | 157 case kColorId_MenuSeparatorColor: { |
| 151 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; | 158 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; |
| 152 } | 159 } |
| 153 case kColorId_MenuBackgroundColor: | 160 case kColorId_MenuBackgroundColor: |
| 154 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; | 161 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; |
| 155 | 162 |
| 156 // Label | 163 // Label |
| 157 case kColorId_LabelEnabledColor: | 164 case kColorId_LabelEnabledColor: |
| 158 return GetLabelStyle()->text[GTK_STATE_NORMAL]; | 165 return GetLabelStyle()->text[GTK_STATE_NORMAL]; |
| 159 case kColorId_LabelDisabledColor: | 166 case kColorId_LabelDisabledColor: |
| 160 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; | 167 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; |
| 161 case kColorId_LabelBackgroundColor: | 168 case kColorId_LabelBackgroundColor: |
| 162 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 169 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
| 163 | 170 |
| 164 // TextButton | 171 // TextButton |
| 165 case kColorId_TextButtonBackgroundColor: | 172 case kColorId_TextButtonBackgroundColor: |
| 166 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; | 173 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; |
| 167 case kColorId_TextButtonEnabledColor: | 174 case kColorId_TextButtonEnabledColor: |
| 168 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 175 return GetButtonStyle()->text[GTK_STATE_NORMAL]; |
| 169 case kColorId_TextButtonDisabledColor: | 176 case kColorId_TextButtonDisabledColor: |
| 170 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; | 177 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; |
| 171 case kColorId_TextButtonHighlightColor: | 178 case kColorId_TextButtonHighlightColor: |
| 172 return GetButtonStyle()->base[GTK_STATE_SELECTED]; | 179 return GetButtonStyle()->base[GTK_STATE_SELECTED]; |
| 173 case kColorId_TextButtonHoverColor: | 180 case kColorId_TextButtonHoverColor: |
| 174 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 181 return GetButtonStyle()->text[GTK_STATE_PRELIGHT]; |
| 175 | 182 |
| 176 // Textfield | 183 // Textfield |
| 177 case kColorId_TextfieldDefaultColor: | 184 case kColorId_TextfieldDefaultColor: |
| 178 return GetEntryStyle()->text[GTK_STATE_NORMAL]; | 185 return GetEntryStyle()->text[GTK_STATE_NORMAL]; |
| 179 case kColorId_TextfieldDefaultBackground: | 186 case kColorId_TextfieldDefaultBackground: |
| 180 return GetEntryStyle()->base[GTK_STATE_NORMAL]; | 187 return GetEntryStyle()->base[GTK_STATE_NORMAL]; |
| 181 case kColorId_TextfieldReadOnlyColor: | 188 case kColorId_TextfieldReadOnlyColor: |
| 182 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; | 189 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; |
| 183 case kColorId_TextfieldReadOnlyBackground: | 190 case kColorId_TextfieldReadOnlyBackground: |
| 184 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE]; | 191 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE]; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 fake_menu_.Own(gtk_menu_new()); | 258 fake_menu_.Own(gtk_menu_new()); |
| 252 | 259 |
| 253 fake_menu_item_ = gtk_menu_item_new(); | 260 fake_menu_item_ = gtk_menu_item_new(); |
| 254 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); | 261 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); |
| 255 } | 262 } |
| 256 | 263 |
| 257 return gtk_rc_get_style(fake_menu_item_); | 264 return gtk_rc_get_style(fake_menu_item_); |
| 258 } | 265 } |
| 259 | 266 |
| 260 } // namespace libgtk2ui | 267 } // namespace libgtk2ui |
| OLD | NEW |