[gtk+/wip/checked: 6/9] button: Remove depressed_on_activate



commit a66ff5227c869692119000b53a6f3e7ad056f4f4
Author: Benjamin Otte <otte redhat com>
Date:   Thu Aug 14 15:44:35 2014 +0200

    button: Remove depressed_on_activate
    
    All buttons should always be marked as :active when they are pressed.
    That includes checkboxes (which are never activated in real code anyway,
    so this change pretty much doesn't matter).

 gtk/gtkbutton.c        |    3 +--
 gtk/gtkbuttonprivate.h |    1 -
 gtk/gtkradiobutton.c   |    2 --
 gtk/gtktogglebutton.c  |    3 ---
 4 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 5116cf1..63fb9cf 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->depress_on_activate = TRUE;
   priv->focus_on_click = TRUE;
 
   priv->xalign = 0.5;
@@ -2458,7 +2457,7 @@ gtk_button_update_state (GtkButton *button)
   gboolean depressed;
 
   if (priv->activate_timeout)
-    depressed = priv->depress_on_activate;
+    depressed = TRUE;
   else
     depressed = priv->in_button && priv->button_down;
 
diff --git a/gtk/gtkbuttonprivate.h b/gtk/gtkbuttonprivate.h
index f717785..423088f 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          depress_on_activate   : 1;
   guint          focus_on_click        : 1;
   guint          image_is_stock        : 1;
   guint          in_button             : 1;
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 6d3dec3..131348a 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -208,8 +208,6 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
 
   _gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), TRUE);
 
-  GTK_BUTTON (radio_button)->priv->depress_on_activate = FALSE;
-
   priv->group = g_slist_prepend (NULL, radio_button);
 
   gtk_widget_set_state_flags (GTK_WIDGET (radio_button), GTK_STATE_FLAG_CHECKED, TRUE);
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 1a0580e..cca85e9 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -229,8 +229,6 @@ gtk_toggle_button_init (GtkToggleButton *toggle_button)
   toggle_button->priv = gtk_toggle_button_get_instance_private (toggle_button);
   toggle_button->priv->active = FALSE;
   toggle_button->priv->draw_indicator = FALSE;
-
-  GTK_BUTTON (toggle_button)->priv->depress_on_activate = TRUE;
 }
 
 static void
@@ -419,7 +417,6 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
       GtkStyleContext *context;
 
       priv->draw_indicator = draw_indicator;
-      GTK_BUTTON (toggle_button)->priv->depress_on_activate = !draw_indicator;
 
       if (gtk_widget_get_visible (GTK_WIDGET (toggle_button)))
        gtk_widget_queue_resize (GTK_WIDGET (toggle_button));


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