From bb069b781b22cae0101a7a466bb03b460fb5c651 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 14 Aug 2014 05:13:29 +0200 Subject: [PATCH] button: Remove depressed variable It is not used anymore. --- gtk/gtkbutton.c | 28 ---------------------------- gtk/gtkbuttonprivate.h | 4 ---- gtk/gtkradiobutton.c | 11 ----------- gtk/gtktogglebutton.c | 9 --------- 4 files changed, 52 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 3d90b8075e..5116cf1e19 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -628,7 +628,6 @@ gtk_button_init (GtkButton *button) priv->button_down = FALSE; priv->use_stock = FALSE; priv->use_underline = FALSE; - priv->depressed = FALSE; priv->depress_on_activate = TRUE; priv->focus_on_click = TRUE; @@ -1784,7 +1783,6 @@ gtk_button_draw (GtkWidget *widget, cairo_t *cr) { GtkButton *button = GTK_BUTTON (widget); - GtkButtonPrivate *priv = button->priv; gint x, y; gint width, height; GtkBorder default_border; @@ -2445,31 +2443,6 @@ gtk_button_get_alignment (GtkButton *button, *yalign = priv->yalign; } -/** - * _gtk_button_set_depressed: - * @button: a #GtkButton - * @depressed: %TRUE if the button should be drawn with a recessed shadow. - * - * Sets whether the button is currently drawn as down or not. This is - * purely a visual setting, and is meant only for use by derived widgets - * such as #GtkToggleButton. - **/ -void -_gtk_button_set_depressed (GtkButton *button, - gboolean depressed) -{ - GtkWidget *widget = GTK_WIDGET (button); - GtkButtonPrivate *priv = button->priv; - - depressed = depressed != FALSE; - - if (depressed != priv->depressed) - { - priv->depressed = depressed; - gtk_widget_queue_resize (widget); - } -} - static void gtk_button_enter_leave (GtkButton *button) { @@ -2498,7 +2471,6 @@ gtk_button_update_state (GtkButton *button) if (depressed) new_state |= GTK_STATE_FLAG_ACTIVE; - _gtk_button_set_depressed (button, depressed); gtk_widget_set_state_flags (GTK_WIDGET (button), new_state, TRUE); } diff --git a/gtk/gtkbuttonprivate.h b/gtk/gtkbuttonprivate.h index 55e277c8fe..f7177852a3 100644 --- a/gtk/gtkbuttonprivate.h +++ b/gtk/gtkbuttonprivate.h @@ -53,7 +53,6 @@ struct _GtkButtonPrivate guint align_set : 1; guint button_down : 1; guint constructed : 1; - guint depressed : 1; guint depress_on_activate : 1; guint focus_on_click : 1; guint image_is_stock : 1; @@ -64,9 +63,6 @@ struct _GtkButtonPrivate guint always_show_image : 1; }; -void _gtk_button_set_depressed (GtkButton *button, - gboolean depressed); - G_END_DECLS diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c index 62a63bbc3e..abf4e3cddd 100644 --- a/gtk/gtkradiobutton.c +++ b/gtk/gtkradiobutton.c @@ -212,7 +212,6 @@ gtk_radio_button_init (GtkRadioButton *radio_button) priv->group = g_slist_prepend (NULL, radio_button); - _gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE); gtk_widget_set_state_flags (GTK_WIDGET (radio_button), GTK_STATE_FLAG_CHECKED, TRUE); } @@ -767,7 +766,6 @@ gtk_radio_button_clicked (GtkButton *button) GtkToggleButton *tmp_button; GSList *tmp_list; gint toggled; - gboolean depressed; toggled = FALSE; @@ -817,13 +815,6 @@ gtk_radio_button_clicked (GtkButton *button) } } - if (gtk_toggle_button_get_inconsistent (toggle_button)) - depressed = FALSE; - else if (button->priv->in_button && button->priv->button_down) - depressed = !gtk_toggle_button_get_active (toggle_button); - else - depressed = gtk_toggle_button_get_active (toggle_button); - if (toggled) { if (gtk_toggle_button_get_active (toggle_button)) @@ -836,8 +827,6 @@ gtk_radio_button_clicked (GtkButton *button) g_object_notify (G_OBJECT (toggle_button), "active"); } - _gtk_button_set_depressed (button, depressed); - gtk_widget_queue_draw (GTK_WIDGET (button)); g_object_unref (button); diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index a40c087ee2..193021b529 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -651,7 +651,6 @@ gtk_toggle_button_update_state (GtkButton *button) { GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button); GtkToggleButtonPrivate *priv = toggle_button->priv; - gboolean depressed; GtkStateFlags new_state = 0; new_state = gtk_widget_get_state_flags (GTK_WIDGET (button)) & @@ -671,13 +670,5 @@ gtk_toggle_button_update_state (GtkButton *button) if (button->priv->in_button) new_state |= GTK_STATE_FLAG_PRELIGHT; - if (priv->inconsistent) - depressed = FALSE; - else if (button->priv->in_button && button->priv->button_down) - depressed = TRUE; - else - depressed = priv->active; - - _gtk_button_set_depressed (button, depressed); gtk_widget_set_state_flags (GTK_WIDGET (toggle_button), new_state, TRUE); }