summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-04-11 15:02:56 +0200
committerBenjamin Otte <otte@redhat.com>2012-04-17 08:59:23 +0200
commit8b1385804e049d6e691462224ed928d15c5b8dc6 (patch)
treee8cd3630097e2079f3ef62bdb9ee2660686f8e56 /gtk/gtkbutton.c
parentd8b99d47ea79c69594830c1fae56bc7c9c034fcf (diff)
downloadgtk+-8b1385804e049d6e691462224ed928d15c5b8dc6.tar.gz
button: Remove _gtk_button_paint()
All buttons use the same paint function these days. States are managed correctly so this was just leftovers from GTK 1 or GTK 2.
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 1ecd6d1468..7957f48a52 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1677,15 +1677,12 @@ gtk_button_size_allocate (GtkWidget *widget,
}
}
-void
-_gtk_button_paint (GtkButton *button,
- cairo_t *cr,
- int width,
- int height,
- GtkStateFlags state)
+static gboolean
+gtk_button_draw (GtkWidget *widget,
+ cairo_t *cr)
{
+ GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
- GtkWidget *widget;
gint x, y;
GtkBorder default_border;
GtkBorder default_outside_border;
@@ -1694,13 +1691,12 @@ _gtk_button_paint (GtkButton *button,
gint focus_pad;
GtkAllocation allocation;
GtkStyleContext *context;
+ GtkStateFlags state;
gboolean draw_focus;
+ gint width, height;
- widget = GTK_WIDGET (button);
context = gtk_widget_get_style_context (widget);
-
- gtk_style_context_save (context);
- gtk_style_context_set_state (context, state);
+ state = gtk_style_context_get_state (context);
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL, &interior_focus);
gtk_style_context_get_style (context,
@@ -1712,6 +1708,8 @@ _gtk_button_paint (GtkButton *button,
x = 0;
y = 0;
+ width = allocation.width;
+ height = allocation.height;
if (gtk_widget_has_default (widget) &&
priv->relief == GTK_RELIEF_NORMAL)
@@ -1787,20 +1785,6 @@ _gtk_button_paint (GtkButton *button,
gtk_render_focus (context, cr, x, y, width, height);
}
- gtk_style_context_restore (context);
-}
-
-static gboolean
-gtk_button_draw (GtkWidget *widget,
- cairo_t *cr)
-{
- GtkButton *button = GTK_BUTTON (widget);
-
- _gtk_button_paint (button, cr,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget),
- gtk_widget_get_state_flags (widget));
-
GTK_WIDGET_CLASS (gtk_button_parent_class)->draw (widget, cr);
return FALSE;