[Xfce4-commits] <midori:master> Fix midori_view_get_proxy_tab_label with Granite

Christian Dywan noreply at xfce.org
Sun Nov 4 18:30:03 CET 2012


Updating branch refs/heads/master
         to 12304f23e382b3690cf4a37ab8ccefab0f8ef569 (commit)
       from 44ccee3023e8a3c081ffadfc0c4b1a6dbff6dbf2 (commit)

commit 12304f23e382b3690cf4a37ab8ccefab0f8ef569
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Nov 4 17:54:38 2012 +0100

    Fix midori_view_get_proxy_tab_label with Granite

 extensions/colorful-tabs.c |    3 +--
 midori/midori-view.c       |   15 +++++++++++++++
 midori/midori-view.h       |    4 ++--
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/extensions/colorful-tabs.c b/extensions/colorful-tabs.c
index 9bb84c3..0468286 100644
--- a/extensions/colorful-tabs.c
+++ b/extensions/colorful-tabs.c
@@ -16,8 +16,7 @@ static void
 colorful_tabs_modify_fg (GtkWidget* label,
                          GdkColor*  color)
 {
-    GtkWidget* box = gtk_bin_get_child (GTK_BIN (label));
-    GList* children = gtk_container_get_children (GTK_CONTAINER (box));
+    GList* children = gtk_container_get_children (GTK_CONTAINER (label));
     for (; children != NULL; children = g_list_next (children))
     {
         if (GTK_IS_LABEL (children->data))
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 47c1028..2ec20ad 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -4459,6 +4459,21 @@ midori_view_set_tab (MidoriView*        view,
         "page", GTK_WIDGET (view),
         NULL);
 }
+
+GtkWidget*
+midori_view_get_proxy_tab_label (MidoriView* view)
+{
+    GtkWidget* tab = GTK_WIDGET (midori_view_get_tab (view));
+    GList* children = gtk_container_get_children (GTK_CONTAINER (tab));
+    GtkWidget* label = NULL;
+    for (; children; children = g_list_next (children))
+        if (GTK_IS_EVENT_BOX (children->data))
+            label = children->data;
+    g_list_free (children);
+    g_warn_if_fail (label != NULL);
+    return label;
+}
+
 #else
 static gboolean
 midori_view_tab_label_button_press_event (GtkWidget*      tab_label,
diff --git a/midori/midori-view.h b/midori/midori-view.h
index 5e41d1a..88cba94 100644
--- a/midori/midori-view.h
+++ b/midori/midori-view.h
@@ -129,10 +129,10 @@ midori_view_get_tab                    (MidoriView*        view);
 void
 midori_view_set_tab                    (MidoriView*        view,
                                         GraniteWidgetsTab* tab);
-#else
+#endif
+
 GtkWidget*
 midori_view_get_proxy_tab_label        (MidoriView*        view);
-#endif
 
 KatzeItem*
 midori_view_get_proxy_item             (MidoriView*        view);


More information about the Xfce4-commits mailing list