| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gtk/gtk_custom_menu_item.h" | 5 #include "chrome/browser/ui/gtk/gtk_custom_menu_item.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "chrome/browser/ui/gtk/gtk_custom_menu.h" | 8 #include "chrome/browser/ui/gtk/gtk_custom_menu.h" |
| 9 #include "ui/base/gtk/gtk_compat.h" | 9 #include "ui/base/gtk/gtk_compat.h" |
| 10 | 10 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 GtkAllocation current_allocation; | 211 GtkAllocation current_allocation; |
| 212 gtk_widget_get_allocation(current_button, ¤t_allocation); | 212 gtk_widget_get_allocation(current_button, ¤t_allocation); |
| 213 GtkAllocation last_allocation; | 213 GtkAllocation last_allocation; |
| 214 gtk_widget_get_allocation(last_button, &last_allocation); | 214 gtk_widget_get_allocation(last_button, &last_allocation); |
| 215 | 215 |
| 216 int x = first_allocation.x; | 216 int x = first_allocation.x; |
| 217 int y = first_allocation.y; | 217 int y = first_allocation.y; |
| 218 int width = last_allocation.width + last_allocation.x - first_allocation.x; | 218 int width = last_allocation.width + last_allocation.x - first_allocation.x; |
| 219 int height = last_allocation.height; | 219 int height = last_allocation.height; |
| 220 | 220 |
| 221 gtk_paint_box(hbox->style, hbox->window, | 221 gtk_paint_box(gtk_widget_get_style(hbox), |
| 222 gtk_widget_get_window(hbox), |
| 222 gtk_widget_get_state(current_button), | 223 gtk_widget_get_state(current_button), |
| 223 GTK_SHADOW_OUT, | 224 GTK_SHADOW_OUT, |
| 224 ¤t_allocation, hbox, "button", | 225 ¤t_allocation, hbox, "button", |
| 225 x, y, width, height); | 226 x, y, width, height); |
| 226 | 227 |
| 227 // Propagate to the button's children. | 228 // Propagate to the button's children. |
| 228 gtk_container_propagate_expose( | 229 gtk_container_propagate_expose( |
| 229 GTK_CONTAINER(current_button), | 230 GTK_CONTAINER(current_button), |
| 230 gtk_bin_get_child(GTK_BIN(current_button)), | 231 gtk_bin_get_child(GTK_BIN(current_button)), |
| 231 event); | 232 event); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 gpointer callback_data) { | 482 gpointer callback_data) { |
| 482 // Even though we're filtering |all_widgets| on GTK_IS_BUTTON(), this isn't | 483 // Even though we're filtering |all_widgets| on GTK_IS_BUTTON(), this isn't |
| 483 // equivalent to |button_widgets| because we also want the button-labels. | 484 // equivalent to |button_widgets| because we also want the button-labels. |
| 484 for (GList* i = menu_item->all_widgets; i && GTK_IS_BUTTON(i->data); | 485 for (GList* i = menu_item->all_widgets; i && GTK_IS_BUTTON(i->data); |
| 485 i = g_list_next(i)) { | 486 i = g_list_next(i)) { |
| 486 if (GTK_IS_BUTTON(i->data)) { | 487 if (GTK_IS_BUTTON(i->data)) { |
| 487 callback(GTK_WIDGET(i->data), callback_data); | 488 callback(GTK_WIDGET(i->data), callback_data); |
| 488 } | 489 } |
| 489 } | 490 } |
| 490 } | 491 } |
| OLD | NEW |