diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 23:15:02 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 23:15:02 +0000 |
commit | 7880bcec08e61d44ffe24bde4ab4645c5839ea98 (patch) | |
tree | 333f1999a3055e13d489e8dfb09b1cd424e5f955 /chrome/browser/gtk/nine_box.h | |
parent | 814a2d33e8655daf6d699bf6aa5c0da6a88919e2 (diff) | |
download | chromium_src-7880bcec08e61d44ffe24bde4ab4645c5839ea98.zip chromium_src-7880bcec08e61d44ffe24bde4ab4645c5839ea98.tar.gz chromium_src-7880bcec08e61d44ffe24bde4ab4645c5839ea98.tar.bz2 |
GTK: give the findbox curvy edges.
Most of the new code concerns shaping the widget to be non-rectangular.
Also, sprinkle some "const" qualifiers on NineBox functions.
Review URL: http://codereview.chromium.org/100224
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/nine_box.h')
-rw-r--r-- | chrome/browser/gtk/nine_box.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/gtk/nine_box.h b/chrome/browser/gtk/nine_box.h index c4c5414..950a359 100644 --- a/chrome/browser/gtk/nine_box.h +++ b/chrome/browser/gtk/nine_box.h @@ -28,16 +28,26 @@ class NineBox { // Render the NineBox to |dst|. // The images will be tiled to fit into the widget. - void RenderToWidget(GtkWidget* dst); + void RenderToWidget(GtkWidget* dst) const; // Render the top row of images to |dst| between |x1| and |x2|. // This is split from RenderToWidget so the toolbar can use it. - void RenderTopCenterStrip(GtkWidget* dst, int x1, int x2, int y1); + void RenderTopCenterStrip(GtkWidget* dst, int x1, int x2, int y1) const; + + // Change all pixels that are white in |images_| to have 0 opacity. + void ChangeWhiteToTransparent(); + + // Set the shape of |widget| to match that of the ninebox. Note that |widget| + // must have its own window and be allocated. Also, currently only the top + // three images are used. + // TODO(estade): extend this function to use all 9 images (if it's ever + // needed). + void ContourWidget(GtkWidget* widget) const; private: // Repeatedly stamp src across dst. void TileImage(GtkWidget* dst, GdkPixbuf* src, - int x1, int y1, int x2, int y2); + int x1, int y1, int x2, int y2) const; GdkPixbuf* images_[9]; }; |