[gtk+/wip/csoriano/gtkpathbar_rework: 111/120] gtkpathbar: remove unfocus management



commit 7968adad6c7f93d9117a8cef4da98b736a4151f4
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Mar 3 15:06:24 2015 +0100

    gtkpathbar: remove unfocus management
    
    Seems it's not necesary, and NautilusPathbar is not using it.

 gtk/gtkpathbar.c     |   64 --------------------------------------------------
 gtk/ui/gtkpathbar.ui |    2 -
 2 files changed, 0 insertions(+), 66 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 5c0815c..a905b97 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -132,12 +132,6 @@ static gboolean gtk_path_bar_scroll               (GtkWidget        *widget,
 static void gtk_path_bar_scroll_up                (GtkPathBar       *path_bar);
 static void gtk_path_bar_scroll_down              (GtkPathBar       *path_bar);
 static void gtk_path_bar_stop_scrolling           (GtkPathBar       *path_bar);
-static gboolean gtk_path_bar_slider_up_defocus    (GtkWidget        *widget,
-                                                  GdkEventButton   *event,
-                                                  GtkPathBar       *path_bar);
-static gboolean gtk_path_bar_slider_down_defocus  (GtkWidget        *widget,
-                                                  GdkEventButton   *event,
-                                                  GtkPathBar       *path_bar);
 static gboolean gtk_path_bar_slider_button_press  (GtkWidget        *widget,
                                                   GdkEventButton   *event,
                                                   GtkPathBar       *path_bar);
@@ -257,8 +251,6 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
 
   gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_slider_button_press);
   gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_slider_button_release);
-  gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_slider_up_defocus);
-  gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_slider_down_defocus);
   gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_scroll_up);
   gtk_widget_class_bind_template_callback (widget_class, gtk_path_bar_scroll_down);
   gtk_widget_class_bind_template_callback (widget_class, on_slider_unmap);
@@ -1081,62 +1073,6 @@ gtk_path_bar_stop_scrolling (GtkPathBar *path_bar)
 }
 
 static gboolean
-gtk_path_bar_slider_up_defocus (GtkWidget      *widget,
-                                    GdkEventButton *event,
-                                    GtkPathBar     *path_bar)
-{
-  GList *list;
-  GList *up_button = NULL;
-
-  if (event->type != GDK_FOCUS_CHANGE)
-    return FALSE;
-
-  for (list = g_list_last (path_bar->priv->button_list); list; list = list->prev)
-    {
-      if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
-        {
-          up_button = list;
-          break;
-        }
-    }
-
-  /* don't let the focus vanish */
-  if ((!gtk_widget_is_sensitive (path_bar->priv->up_slider_button)) ||
-      (!gtk_widget_get_child_visible (path_bar->priv->up_slider_button)))
-    gtk_widget_grab_focus (BUTTON_DATA (up_button->data)->button);
-
-  return FALSE;
-}
-
-static gboolean
-gtk_path_bar_slider_down_defocus (GtkWidget      *widget,
-                                    GdkEventButton *event,
-                                    GtkPathBar     *path_bar)
-{
-  GList *list;
-  GList *down_button = NULL;
-
-  if (event->type != GDK_FOCUS_CHANGE)
-    return FALSE;
-
-  for (list = path_bar->priv->button_list; list; list = list->next)
-    {
-      if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
-        {
-          down_button = list;
-          break;
-        }
-    }
-
-  /* don't let the focus vanish */
-  if ((!gtk_widget_is_sensitive (path_bar->priv->down_slider_button)) ||
-      (!gtk_widget_get_child_visible (path_bar->priv->down_slider_button)))
-    gtk_widget_grab_focus (BUTTON_DATA (down_button->data)->button);
-
-  return FALSE;
-}
-
-static gboolean
 gtk_path_bar_slider_button_press (GtkWidget      *widget, 
                                  GdkEventButton *event,
                                  GtkPathBar     *path_bar)
diff --git a/gtk/ui/gtkpathbar.ui b/gtk/ui/gtkpathbar.ui
index c41ed7f..f2f624f 100644
--- a/gtk/ui/gtkpathbar.ui
+++ b/gtk/ui/gtkpathbar.ui
@@ -13,7 +13,6 @@
     </child>
     <signal name="button-press-event" handler="gtk_path_bar_slider_button_press" swapped="no"/>
     <signal name="button-release-event" handler="gtk_path_bar_slider_button_release" swapped="no"/>
-    <signal name="focus-out-event" handler="gtk_path_bar_slider_down_defocus" swapped="no"/>
     <signal name="unmap" handler="on_slider_unmap" swapped="no"/>
     <child>
       <object class="GtkImage">
@@ -38,7 +37,6 @@
     </child>
     <signal name="button-press-event" handler="gtk_path_bar_slider_button_press" swapped="no"/>
     <signal name="button-release-event" handler="gtk_path_bar_slider_button_release" swapped="no"/>
-    <signal name="focus-out-event" handler="gtk_path_bar_slider_up_defocus" swapped="no"/>
     <signal name="unmap" handler="on_slider_unmap" swapped="no"/>
     <child>
       <object class="GtkImage">


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