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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Dialogs | 129 // Dialogs |
130 case kColorId_DialogBackground: | 130 case kColorId_DialogBackground: |
131 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 131 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
132 | 132 |
133 // FocusableBorder | 133 // FocusableBorder |
134 case kColorId_FocusedBorderColor: | 134 case kColorId_FocusedBorderColor: |
135 return GetEntryStyle()->bg[GTK_STATE_SELECTED]; | 135 return GetEntryStyle()->bg[GTK_STATE_SELECTED]; |
136 case kColorId_UnfocusedBorderColor: | 136 case kColorId_UnfocusedBorderColor: |
137 return GetEntryStyle()->text_aa[GTK_STATE_NORMAL]; | 137 return GetEntryStyle()->text_aa[GTK_STATE_NORMAL]; |
| 138 case kColorId_HoverBorderColor: |
| 139 return GetEntryStyle()->text_aa[GTK_STATE_PRELIGHT]; |
138 | 140 |
139 // MenuItem | 141 // MenuItem |
140 case kColorId_EnabledMenuItemForegroundColor: | 142 case kColorId_EnabledMenuItemForegroundColor: |
141 return GetMenuItemStyle()->text[GTK_STATE_NORMAL]; | 143 return GetMenuItemStyle()->text[GTK_STATE_NORMAL]; |
142 case kColorId_DisabledMenuItemForegroundColor: | 144 case kColorId_DisabledMenuItemForegroundColor: |
143 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; | 145 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; |
144 // TODO(erg): We also need a FocusedMenuItemForegroundColor, since the | 146 // TODO(erg): We also need a FocusedMenuItemForegroundColor, since the |
145 // accessibility theme HighContrastInverse is unreadable without it. That | 147 // accessibility theme HighContrastInverse is unreadable without it. That |
146 // will require careful threading through existing menu code though. | 148 // will require careful threading through existing menu code though. |
147 case kColorId_FocusedMenuItemBackgroundColor: | 149 case kColorId_FocusedMenuItemBackgroundColor: |
148 return GetMenuItemStyle()->bg[GTK_STATE_SELECTED]; | 150 return GetMenuItemStyle()->bg[GTK_STATE_SELECTED]; |
| 151 case kColorId_HoverMenuItemBackgroundColor: |
| 152 return GetMenuItemStyle()->bg[GTK_STATE_PRELIGHT]; |
149 case kColorId_MenuBorderColor: | 153 case kColorId_MenuBorderColor: |
150 case kColorId_MenuSeparatorColor: { | 154 case kColorId_MenuSeparatorColor: { |
151 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; | 155 return GetMenuItemStyle()->text[GTK_STATE_INSENSITIVE]; |
152 } | 156 } |
153 case kColorId_MenuBackgroundColor: | 157 case kColorId_MenuBackgroundColor: |
154 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; | 158 return GetMenuStyle()->bg[GTK_STATE_NORMAL]; |
155 | 159 |
156 // Label | 160 // Label |
157 case kColorId_LabelEnabledColor: | 161 case kColorId_LabelEnabledColor: |
158 return GetLabelStyle()->text[GTK_STATE_NORMAL]; | 162 return GetLabelStyle()->text[GTK_STATE_NORMAL]; |
159 case kColorId_LabelDisabledColor: | 163 case kColorId_LabelDisabledColor: |
160 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; | 164 return GetLabelStyle()->text[GTK_STATE_INSENSITIVE]; |
161 case kColorId_LabelBackgroundColor: | 165 case kColorId_LabelBackgroundColor: |
162 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 166 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
163 | 167 |
164 // TextButton | 168 // TextButton |
165 case kColorId_TextButtonBackgroundColor: | 169 case kColorId_TextButtonBackgroundColor: |
166 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; | 170 return GetButtonStyle()->bg[GTK_STATE_NORMAL]; |
167 case kColorId_TextButtonEnabledColor: | 171 case kColorId_TextButtonEnabledColor: |
168 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 172 return GetButtonStyle()->text[GTK_STATE_NORMAL]; |
169 case kColorId_TextButtonDisabledColor: | 173 case kColorId_TextButtonDisabledColor: |
170 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; | 174 return GetButtonStyle()->text[GTK_STATE_INSENSITIVE]; |
171 case kColorId_TextButtonHighlightColor: | 175 case kColorId_TextButtonHighlightColor: |
172 return GetButtonStyle()->base[GTK_STATE_SELECTED]; | 176 return GetButtonStyle()->base[GTK_STATE_SELECTED]; |
173 case kColorId_TextButtonHoverColor: | 177 case kColorId_TextButtonHoverColor: |
174 return GetButtonStyle()->text[GTK_STATE_NORMAL]; | 178 return GetButtonStyle()->text[GTK_STATE_PRELIGHT]; |
175 | 179 |
176 // Textfield | 180 // Textfield |
177 case kColorId_TextfieldDefaultColor: | 181 case kColorId_TextfieldDefaultColor: |
178 return GetEntryStyle()->text[GTK_STATE_NORMAL]; | 182 return GetEntryStyle()->text[GTK_STATE_NORMAL]; |
179 case kColorId_TextfieldDefaultBackground: | 183 case kColorId_TextfieldDefaultBackground: |
180 return GetEntryStyle()->base[GTK_STATE_NORMAL]; | 184 return GetEntryStyle()->base[GTK_STATE_NORMAL]; |
181 case kColorId_TextfieldReadOnlyColor: | 185 case kColorId_TextfieldReadOnlyColor: |
182 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; | 186 return GetEntryStyle()->text[GTK_STATE_INSENSITIVE]; |
183 case kColorId_TextfieldReadOnlyBackground: | 187 case kColorId_TextfieldReadOnlyBackground: |
184 return GetEntryStyle()->base[GTK_STATE_INSENSITIVE]; | 188 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()); | 255 fake_menu_.Own(gtk_menu_new()); |
252 | 256 |
253 fake_menu_item_ = gtk_menu_item_new(); | 257 fake_menu_item_ = gtk_menu_item_new(); |
254 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); | 258 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); |
255 } | 259 } |
256 | 260 |
257 return gtk_rc_get_style(fake_menu_item_); | 261 return gtk_rc_get_style(fake_menu_item_); |
258 } | 262 } |
259 | 263 |
260 } // namespace libgtk2ui | 264 } // namespace libgtk2ui |
OLD | NEW |