[libhandy/tabs: 25/62] .




commit e73f6fca67fa7b619d5470c3e205ce9348c4ecc9
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Sep 6 19:53:43 2020 +0500

    .

 src/hdy-tab-bar.c |  4 ++--
 src/hdy-tab-box.c | 16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/hdy-tab-bar.c b/src/hdy-tab-bar.c
index 250a64aa..3a9500ec 100644
--- a/src/hdy-tab-bar.c
+++ b/src/hdy-tab-bar.c
@@ -115,9 +115,9 @@ page_pinned_cb (HdyTabBar  *self,
 {
   gboolean should_focus = hdy_tab_box_is_page_focused (self->scroll_box, page);
 
+  hdy_tab_box_remove_page (self->scroll_box, page);
   hdy_tab_box_add_page (self->pinned_box, page,
                         hdy_tab_view_get_n_pinned_pages (self->view));
-  hdy_tab_box_remove_page (self->scroll_box, page);
 
   if (should_focus)
     hdy_tab_box_try_focus_selected_tab (self->pinned_box);
@@ -129,9 +129,9 @@ page_unpinned_cb (HdyTabBar  *self,
 {
   gboolean should_focus = hdy_tab_box_is_page_focused (self->pinned_box, page);
 
+  hdy_tab_box_remove_page (self->pinned_box, page);
   hdy_tab_box_add_page (self->scroll_box, page,
                         hdy_tab_view_get_n_pinned_pages (self->view));
-  hdy_tab_box_remove_page (self->pinned_box, page);
 
   if (should_focus)
     hdy_tab_box_try_focus_selected_tab (self->scroll_box);
diff --git a/src/hdy-tab-box.c b/src/hdy-tab-box.c
index 69f8e524..65d494c9 100644
--- a/src/hdy-tab-box.c
+++ b/src/hdy-tab-box.c
@@ -3202,6 +3202,18 @@ hdy_tab_box_class_init (HdyTabBoxClass *klass)
                   G_TYPE_NONE,
                   2, GTK_TYPE_DIRECTION_TYPE, G_TYPE_BOOLEAN);
 
+  g_signal_override_class_handler ("activate-tab",
+                                   G_TYPE_FROM_CLASS (klass),
+                                   G_CALLBACK (activate_tab));
+
+  g_signal_override_class_handler ("focus-tab",
+                                   G_TYPE_FROM_CLASS (klass),
+                                   G_CALLBACK (focus_tab_cb));
+
+  g_signal_override_class_handler ("reorder-tab",
+                                   G_TYPE_FROM_CLASS (klass),
+                                   G_CALLBACK (reorder_tab_cb));
+
   binding_set = gtk_binding_set_by_class (klass);
 
   gtk_binding_entry_add_signal (binding_set, GDK_KEY_space,     0, "activate-tab", 0);
@@ -3261,10 +3273,6 @@ hdy_tab_box_init (HdyTabBox *self)
 
   self->source_targets = gtk_target_list_new (src_targets,
                                               G_N_ELEMENTS (src_targets));
-
-  g_signal_connect_object (self, "activate-tab", G_CALLBACK (activate_tab), self, G_CONNECT_AFTER);
-  g_signal_connect_object (self, "focus-tab", G_CALLBACK (focus_tab_cb), self, 0);
-  g_signal_connect_object (self, "reorder-tab", G_CALLBACK (reorder_tab_cb), self, 0);
 }
 
 void


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