mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
togglebutton: Don't duplicate button code
It's the same code, so no need to write the same vfunc twice.
This commit is contained in:
parent
0f7c90ac62
commit
1febbdb499
@ -124,8 +124,6 @@ enum {
|
||||
|
||||
static gboolean gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling);
|
||||
static void gtk_toggle_button_pressed (GtkButton *button);
|
||||
static void gtk_toggle_button_released (GtkButton *button);
|
||||
static void gtk_toggle_button_clicked (GtkButton *button);
|
||||
static void gtk_toggle_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
@ -172,8 +170,6 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
|
||||
|
||||
widget_class->mnemonic_activate = gtk_toggle_button_mnemonic_activate;
|
||||
|
||||
button_class->pressed = gtk_toggle_button_pressed;
|
||||
button_class->released = gtk_toggle_button_released;
|
||||
button_class->clicked = gtk_toggle_button_clicked;
|
||||
button_class->enter = gtk_toggle_button_enter_leave;
|
||||
button_class->leave = gtk_toggle_button_enter_leave;
|
||||
@ -602,30 +598,6 @@ gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_pressed (GtkButton *button)
|
||||
{
|
||||
button->priv->button_down = TRUE;
|
||||
|
||||
gtk_toggle_button_update_state (button);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (button));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_released (GtkButton *button)
|
||||
{
|
||||
if (button->priv->button_down)
|
||||
{
|
||||
button->priv->button_down = FALSE;
|
||||
|
||||
if (button->priv->in_button)
|
||||
gtk_button_clicked (button);
|
||||
|
||||
gtk_toggle_button_update_state (button);
|
||||
gtk_widget_queue_draw (GTK_WIDGET (button));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_toggle_button_clicked (GtkButton *button)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user