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_HotMenuItemBackgroundColor: |
| 150 return GetMenuItemStyle()->bg[GTK_STATE_PRELIGHT]; |
149 case kColorId_MenuBorderColor: | 151 case kColorId_MenuBorderColor: |
150 case kColorId_MenuSeparatorColor: { | 152 case kColorId_MenuSeparatorColor: { |
151 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; | 153 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; |
152 } | 154 } |
153 case kColorId_MenuBackgroundColor: | 155 case kColorId_MenuBackgroundColor: |
154 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; | 156 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; |
155 | 157 |
156 // Label | 158 // Label |
157 case kColorId_LabelEnabledColor: | 159 case kColorId_LabelEnabledColor: |
158 return GetLabelStyle()->text[GTK_STATE_NORMAL]; | 160 return GetLabelStyle()->text[GTK_STATE_NORMAL]; |
159 case kColorId_LabelDisabledColor: | 161 case kColorId_LabelDisabledColor: |
160 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; | 162 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; |
161 case kColorId_LabelBackgroundColor: | 163 case kColorId_LabelBackgroundColor: |
162 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 164 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
163 | 165 |
164 // TextButton | 166 // TextButton |
165 case kColorId_TextButtonBackgroundColor: | 167 case kColorId_TextButtonBackgroundColor: |
166 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; | 168 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; |
167 case kColorId_TextButtonEnabledColor: | 169 case kColorId_TextButtonEnabledColor: |
168 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 170 return GetButtonStyle()->text[GTK_STATE_NORMAL]; |
169 case kColorId_TextButtonDisabledColor: | 171 case kColorId_TextButtonDisabledColor: |
170 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; | 172 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; |
171 case kColorId_TextButtonHighlightColor: | 173 case kColorId_TextButtonHighlightColor: |
172 return GetButtonStyle()->base[GTK_STATE_SELECTED]; | 174 return GetButtonStyle()->base[GTK_STATE_SELECTED]; |
173 case kColorId_TextButtonHoverColor: | 175 case kColorId_TextButtonHoverColor: |
174 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 176 return GetButtonStyle()->text[GTK_STATE_PRELIGHT]; |
175 | 177 |
176 // Textfield | 178 // Textfield |
177 case kColorId_TextfieldDefaultColor: | 179 case kColorId_TextfieldDefaultColor: |
178 return GetEntryStyle()->text[GTK_STATE_NORMAL]; | 180 return GetEntryStyle()->text[GTK_STATE_NORMAL]; |
179 case kColorId_TextfieldDefaultBackground: | 181 case kColorId_TextfieldDefaultBackground: |
180 return GetEntryStyle()->base[GTK_STATE_NORMAL]; | 182 return GetEntryStyle()->base[GTK_STATE_NORMAL]; |
181 case kColorId_TextfieldReadOnlyColor: | 183 case kColorId_TextfieldReadOnlyColor: |
182 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; | 184 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; |
183 case kColorId_TextfieldReadOnlyBackground: | 185 case kColorId_TextfieldReadOnlyBackground: |
184 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE]; | 186 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()); | 253 fake_menu_.Own(gtk_menu_new()); |
252 | 254 |
253 fake_menu_item_ = gtk_menu_item_new(); | 255 fake_menu_item_ = gtk_menu_item_new(); |
254 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); | 256 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); |
255 } | 257 } |
256 | 258 |
257 return gtk_rc_get_style(fake_menu_item_); | 259 return gtk_rc_get_style(fake_menu_item_); |
258 } | 260 } |
259 | 261 |
260 } // namespace libgtk2ui | 262 } // namespace libgtk2ui |
OLD | NEW |