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

Unified Diff: chrome/browser/ui/gtk/gtk_theme_service.cc

Issue 8773025: GTK: More removal of raw GtkWidget->allocation access. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/gtk_input_event_box.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/gtk_theme_service.cc
diff --git a/chrome/browser/ui/gtk/gtk_theme_service.cc b/chrome/browser/ui/gtk/gtk_theme_service.cc
index 567e48f06caed6bd853ac3cb7d5036fe23445be5..dc8b0e6fd65d67777769f46ae7edd768301c67d6 100644
--- a/chrome/browser/ui/gtk/gtk_theme_service.cc
+++ b/chrome/browser/ui/gtk/gtk_theme_service.cc
@@ -1217,11 +1217,13 @@ gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget,
static_cast<double>(bottom_color.green / 257) / 255.0,
static_cast<double>(bottom_color.blue / 257) / 255.0, };
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
+
cairo_pattern_t* pattern =
- cairo_pattern_create_linear(widget->allocation.x, widget->allocation.y,
- widget->allocation.x,
- widget->allocation.y +
- widget->allocation.height);
+ cairo_pattern_create_linear(allocation.x, allocation.y,
+ allocation.x,
+ allocation.y + allocation.height);
cairo_pattern_add_color_stop_rgb(
pattern, 0.0,
kTopSeparatorColor[0], kTopSeparatorColor[1], kTopSeparatorColor[2]);
@@ -1233,12 +1235,11 @@ gboolean GtkThemeService::OnSeparatorExpose(GtkWidget* widget,
bottom_color_rgb[0], bottom_color_rgb[1], bottom_color_rgb[2]);
cairo_set_source(cr, pattern);
- double start_x = 0.5 + widget->allocation.x;
+ double start_x = 0.5 + allocation.x;
cairo_new_path(cr);
cairo_set_line_width(cr, 1.0);
- cairo_move_to(cr, start_x, widget->allocation.y);
- cairo_line_to(cr, start_x,
- widget->allocation.y + widget->allocation.height);
+ cairo_move_to(cr, start_x, allocation.y);
+ cairo_line_to(cr, start_x, allocation.y + allocation.height);
cairo_stroke(cr);
cairo_destroy(cr);
cairo_pattern_destroy(pattern);
« no previous file with comments | « chrome/browser/ui/gtk/gtk_input_event_box.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698