diff options
Diffstat (limited to 'chrome/browser/gtk/custom_button.cc')
-rw-r--r-- | chrome/browser/gtk/custom_button.cc | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/chrome/browser/gtk/custom_button.cc b/chrome/browser/gtk/custom_button.cc index 4ff475c..3110dea 100644 --- a/chrome/browser/gtk/custom_button.cc +++ b/chrome/browser/gtk/custom_button.cc @@ -93,64 +93,3 @@ CustomDrawButton* CustomDrawButton::AddBarCloseButton(GtkWidget* hbox) { gtk_box_pack_end(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, 0); return rv; } - -CustomContainerButton::CustomContainerButton() { - GdkPixbuf* images[9]; - int i = 0; - - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_LEFT_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_RIGHT_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_LEFT_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_CENTER_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_RIGHT_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_LEFT_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_H); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_RIGHT_H); - nine_box_prelight_.reset(new NineBox(images)); - - i = 0; - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_LEFT_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_TOP_RIGHT_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_LEFT_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_CENTER_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_RIGHT_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_LEFT_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_P); - images[i++] = rb.LoadPixbuf(IDR_TEXTBUTTON_BOTTOM_RIGHT_P); - nine_box_active_.reset(new NineBox(images)); - - 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 -gboolean CustomContainerButton::OnExpose(GtkWidget* widget, GdkEventExpose* e, - CustomContainerButton* button) { - NineBox* nine_box = NULL; - if (GTK_WIDGET_STATE(widget) == GTK_STATE_PRELIGHT) - nine_box = button->nine_box_prelight_.get(); - else if (GTK_WIDGET_STATE(widget) == GTK_STATE_ACTIVE) - nine_box = button->nine_box_active_.get(); - - // Only draw theme graphics if we have some. - if (nine_box) - nine_box->RenderToWidget(widget); - - // If we return FALSE from the function, the button paints itself. - // If we return TRUE, no children are painted. - // So we return TRUE and send the expose along directly to the child. - gtk_container_propagate_expose(GTK_CONTAINER(widget), - gtk_bin_get_child(GTK_BIN(widget)), - e); - - return TRUE; // Prevent normal painting. -} |