Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: chrome/browser/ui/gtk/gtk_custom_menu_item.cc

Issue 9030029: GTK: A bunch more removal of deprecated raw GtkWidget access, focusing on GtkWidget->window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tony nits Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/gtk/gtk_chrome_link_button.cc ('k') | chrome/browser/ui/gtk/gtk_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // Check to see if this is the last button in a run. 254 // Check to see if this is the last button in a run.
255 GList* next_item = g_list_next(current_item); 255 GList* next_item = g_list_next(current_item);
256 if (next_item && GTK_IS_BUTTON(next_item->data)) { 256 if (next_item && GTK_IS_BUTTON(next_item->data)) {
257 GtkWidget* current_button = GTK_WIDGET(current_item->data); 257 GtkWidget* current_button = GTK_WIDGET(current_item->data);
258 GtkAllocation button_allocation; 258 GtkAllocation button_allocation;
259 gtk_widget_get_allocation(current_button, &button_allocation); 259 gtk_widget_get_allocation(current_button, &button_allocation);
260 GtkAllocation child_alloc; 260 GtkAllocation child_alloc;
261 gtk_widget_get_allocation(gtk_bin_get_child(GTK_BIN(current_button)), 261 gtk_widget_get_allocation(gtk_bin_get_child(GTK_BIN(current_button)),
262 &child_alloc); 262 &child_alloc);
263 int half_offset = widget->style->xthickness / 2; 263 int half_offset = widget->style->xthickness / 2;
264 gtk_paint_vline(widget->style, widget->window, 264 gtk_paint_vline(gtk_widget_get_style(widget),
265 gtk_widget_get_window(widget),
265 gtk_widget_get_state(current_button), 266 gtk_widget_get_state(current_button),
266 &event->area, widget, "button", 267 &event->area, widget, "button",
267 child_alloc.y, 268 child_alloc.y,
268 child_alloc.y + child_alloc.height, 269 child_alloc.y + child_alloc.height,
269 button_allocation.x + 270 button_allocation.x +
270 button_allocation.width - half_offset); 271 button_allocation.width - half_offset);
271 } 272 }
272 } 273 }
273 } 274 }
274 275
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 gpointer callback_data) { 481 gpointer callback_data) {
481 // Even though we're filtering |all_widgets| on GTK_IS_BUTTON(), this isn't 482 // Even though we're filtering |all_widgets| on GTK_IS_BUTTON(), this isn't
482 // equivalent to |button_widgets| because we also want the button-labels. 483 // equivalent to |button_widgets| because we also want the button-labels.
483 for (GList* i = menu_item->all_widgets; i && GTK_IS_BUTTON(i->data); 484 for (GList* i = menu_item->all_widgets; i && GTK_IS_BUTTON(i->data);
484 i = g_list_next(i)) { 485 i = g_list_next(i)) {
485 if (GTK_IS_BUTTON(i->data)) { 486 if (GTK_IS_BUTTON(i->data)) {
486 callback(GTK_WIDGET(i->data), callback_data); 487 callback(GTK_WIDGET(i->data), callback_data);
487 } 488 }
488 } 489 }
489 } 490 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_chrome_link_button.cc ('k') | chrome/browser/ui/gtk/gtk_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698