mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
button: Remove depressed variable
It is not used anymore.
This commit is contained in:
parent
e9f1d6d85c
commit
bb069b781b
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user