diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 21:21:34 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 21:21:34 +0000 |
commit | 6d8924d8cc89c3129e51e2067e7911b960a7a7d8 (patch) | |
tree | 119e8f849305df17951ad5d16fef830703f5486f /chrome/browser/gtk/custom_button.cc | |
parent | 1e89d3a996da488a3145590e86049dca233fed29 (diff) | |
download | chromium_src-6d8924d8cc89c3129e51e2067e7911b960a7a7d8.zip chromium_src-6d8924d8cc89c3129e51e2067e7911b960a7a7d8.tar.gz chromium_src-6d8924d8cc89c3129e51e2067e7911b960a7a7d8.tar.bz2 |
First implementation of a bookmark bar.
Currently, the bookmark bar only reads state on startup so to see this
work, you have to go to a page, click the star button (that isn't hooked up
yet either), and then restart chromium.
Review URL: http://codereview.chromium.org/60071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/custom_button.cc')
-rw-r--r-- | chrome/browser/gtk/custom_button.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc index 5609937..e3d45d2 100644 --- a/chrome/browser/gtk/custom_button.cc +++ b/chrome/browser/gtk/custom_button.cc @@ -12,7 +12,7 @@ CustomDrawButton::CustomDrawButton(int normal_id, int active_id, int highlight_id, int depressed_id) { - widget_ = gtk_button_new(); + widget_.Own(gtk_button_new()); // Load the button images from the resource bundle. ResourceBundle& rb = ResourceBundle::GetSharedInstance(); @@ -24,14 +24,14 @@ CustomDrawButton::CustomDrawButton(int normal_id, pixbufs_[GTK_STATE_INSENSITIVE] = depressed_id ? rb.LoadPixbuf(depressed_id) : NULL; - gtk_widget_set_size_request(widget_, + gtk_widget_set_size_request(widget_.get(), gdk_pixbuf_get_width(pixbufs_[0]), gdk_pixbuf_get_height(pixbufs_[0])); - gtk_widget_set_app_paintable(widget_, TRUE); + gtk_widget_set_app_paintable(widget_.get(), TRUE); // We effectively double-buffer by virtue of having only one image... - gtk_widget_set_double_buffered(widget_, FALSE); - g_signal_connect(G_OBJECT(widget_), "expose-event", + gtk_widget_set_double_buffered(widget_.get(), FALSE); + g_signal_connect(G_OBJECT(widget_.get()), "expose-event", G_CALLBACK(OnExpose), this); } @@ -40,6 +40,8 @@ CustomDrawButton::~CustomDrawButton() { if (pixbufs_[i]) gdk_pixbuf_unref(pixbufs_[i]); } + + widget_.Destroy(); } // static @@ -92,13 +94,14 @@ CustomContainerButton::CustomContainerButton() { images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_RIGHT_P); nine_box_active_.reset(new NineBox(images)); - widget_ = gtk_button_new(); - gtk_widget_set_app_paintable(widget_, TRUE); - g_signal_connect(G_OBJECT(widget_), "expose-event", + widget_.Own(gtk_button_new()); + gtk_widget_set_app_paintable(widget_.get(), TRUE); + g_signal_connect(G_OBJECT(widget_.get()), "expose-event", G_CALLBACK(OnExpose), this); } CustomContainerButton::~CustomContainerButton() { + widget_.Destroy(); } // static |