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

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

Issue 40139: Put the dropdown menu button on the linux download shelf.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« chrome/browser/gtk/download_shelf_gtk.cc ('K') | « chrome/browser/gtk/nine_box.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/nine_box.cc
===================================================================
--- chrome/browser/gtk/nine_box.cc (revision 10937)
+++ chrome/browser/gtk/nine_box.cc (working copy)
@@ -49,20 +49,27 @@
// rendering of the ninebox.
const int x1 = gdk_pixbuf_get_width(images[0]);
const int y1 = gdk_pixbuf_get_height(images[0]);
- const int x2 = gdk_pixbuf_get_width(dst) - gdk_pixbuf_get_width(images[8]);
- const int y2 = gdk_pixbuf_get_height(dst) - gdk_pixbuf_get_height(images[8]);
+ const int x2 = images[2] ?
+ gdk_pixbuf_get_width(dst) - gdk_pixbuf_get_width(images[2]) : x1;
+ const int y2 = images[6] ?
+ gdk_pixbuf_get_height(dst) - gdk_pixbuf_get_height(images[6]) : y1;
DCHECK(x2 >= x1);
DCHECK(y2 >= y1);
- DrawPixbuf(images[0], dst, 0, 0);
- RenderTopCenterStrip(dst, x1, x2);
- DrawPixbuf(images[2], dst, x2, 0);
+ if (images[0])
+ DrawPixbuf(images[0], dst, 0, 0);
+ if (images[1])
+ RenderTopCenterStrip(dst, x1, x2);
+ if (images[2])
+ DrawPixbuf(images[2], dst, x2, 0);
// Center row. Needs vertical tiling.
images = &images_[1 * 3];
- TileImage(images[0], dst,
- 0, y1,
- 0, y2);
+ if (images[0]) {
+ TileImage(images[0], dst,
+ 0, y1,
+ 0, y2);
+ }
if (images[1]) {
const int delta_y = gdk_pixbuf_get_height(images[1]);
for (int y = y1; y < y2; y += delta_y) {
@@ -71,17 +78,23 @@
x2, y);
}
}
- TileImage(images[2], dst,
- x2, y1,
- x2, y2);
+ if (images[2]) {
+ TileImage(images[2], dst,
+ x2, y1,
+ x2, y2);
+ }
// Bottom row.
images = &images_[2 * 3];
- DrawPixbuf(images[0], dst, 0, y2);
- TileImage(images[1], dst,
- x1, y2,
- x2, y2);
- DrawPixbuf(images[2], dst, x2, y2);
+ if (images[0])
+ DrawPixbuf(images[0], dst, 0, y2);
+ if (images[1]) {
+ TileImage(images[1], dst,
+ x1, y2,
+ x2, y2);
+ }
+ if (images[2])
+ DrawPixbuf(images[2], dst, x2, y2);
}
void NineBox::RenderTopCenterStrip(GdkPixbuf* dst, int x1, int x2) {
« chrome/browser/gtk/download_shelf_gtk.cc ('K') | « chrome/browser/gtk/nine_box.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698