[gtk+] togglebutton: Don't duplicate button code



commit 1febbdb499757ac01c2cc505e8bcaa455133006a
Author: Benjamin Otte <otte redhat com>
Date:   Sat Aug 16 00:43:18 2014 +0200

    togglebutton: Don't duplicate button code
    
    It's the same code, so no need to write the same vfunc twice.

 gtk/gtktogglebutton.c |   28 ----------------------------
 1 files changed, 0 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index b12fbf2..ebd99ca 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -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;
@@ -603,30 +599,6 @@ gtk_toggle_button_mnemonic_activate (GtkWidget *widget,
 }
 
 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)
 {
   GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]