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

Unified Diff: chrome/browser/gtk/custom_button.cc

Issue 150078: GTK custom frame: Don't show the border when maximized. Enlarge the close but... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: now with bidi support Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/custom_button.cc
===================================================================
--- chrome/browser/gtk/custom_button.cc (revision 19526)
+++ chrome/browser/gtk/custom_button.cc (working copy)
@@ -45,7 +45,15 @@
cairo_t* cairo_context = gdk_cairo_create(GDK_DRAWABLE(widget->window));
cairo_translate(cairo_context, widget->allocation.x, widget->allocation.y);
- gdk_cairo_set_source_pixbuf(cairo_context, pixbuf, 0, 0);
+
+ // The widget might be larger than the pixbuf. Paint the pixbuf flush with the
+ // start of the widget (left for LTR, right for RTL).
+ int pixbuf_width = gdk_pixbuf_get_width(pixbuf);
+ int widget_width = widget->allocation.width;
+ int x = gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL ?
+ widget_width - pixbuf_width : 0;
+
+ gdk_cairo_set_source_pixbuf(cairo_context, pixbuf, x, 0);
cairo_paint(cairo_context);
cairo_destroy(cairo_context);
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698