summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/custom_button.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:20:18 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 00:20:18 +0000
commitc3c01eeaf88116a3f114a46ec2a900936be56bde (patch)
tree2f4c03d7a9c19405140dcaeada21c7c2a7bfe776 /chrome/browser/gtk/custom_button.cc
parent7c6334b2b3201324bfc6efeefecfdf8003fbcb59 (diff)
downloadchromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.zip
chromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.tar.gz
chromium_src-c3c01eeaf88116a3f114a46ec2a900936be56bde.tar.bz2
GTK custom frame: Don't show the border when maximized. Enlarge the close button's clickable area when maximized.
BUG= http://crbug.com/14646 and http://crbug.com/15628 TEST=maximize, turn on custom frame. The top right most pixel on the screen should be clickable and should close the window. There should be no border around the web contents. Review URL: http://codereview.chromium.org/150078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/custom_button.cc')
-rw-r--r--chrome/browser/gtk/custom_button.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc
index e047202..e828243 100644
--- a/chrome/browser/gtk/custom_button.cc
+++ b/chrome/browser/gtk/custom_button.cc
@@ -45,7 +45,15 @@ gboolean CustomDrawButtonBase::OnExpose(GtkWidget* widget, GdkEventExpose* e) {
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);