Merge lp:~kalikiana/midori/tabcolor into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6206
Merged at revision: 6207
Proposed branch: lp:~kalikiana/midori/tabcolor
Merge into: lp:midori
Diff against target: 57 lines (+18/-13)
1 file modified
midori/midori-view.c (+18/-13)
To merge this branch: bzr merge lp:~kalikiana/midori/tabcolor
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+169079@code.launchpad.net

Commit message

Distinguish between box and event box in the tab label when colouring tabs

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'midori/midori-view.c'
--- midori/midori-view.c 2013-05-31 22:06:02 +0000
+++ midori/midori-view.c 2013-06-12 23:38:34 +0000
@@ -4935,14 +4935,7 @@
4935 g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);4935 g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);
49364936
4937 GtkWidget* tab = GTK_WIDGET (midori_view_get_tab (view));4937 GtkWidget* tab = GTK_WIDGET (midori_view_get_tab (view));
4938 GList* children = gtk_container_get_children (GTK_CONTAINER (tab));4938 return tab;
4939 GtkWidget* label = NULL;
4940 for (; children; children = g_list_next (children))
4941 if (GTK_IS_EVENT_BOX (children->data))
4942 label = children->data;
4943 g_list_free (children);
4944 g_warn_if_fail (label != NULL);
4945 return label;
4946}4939}
49474940
4948#else4941#else
@@ -5894,9 +5887,21 @@
5894 Contained can be a GtkLabel or a GtkBox including a GtkLabel5887 Contained can be a GtkLabel or a GtkBox including a GtkLabel
5895 Granite as of this writing uses a GtkLabel (which may change)5888 Granite as of this writing uses a GtkLabel (which may change)
5896 */5889 */
5897 GtkWidget* event_box = midori_view_get_proxy_tab_label (view);5890 GtkWidget* box = midori_view_get_proxy_tab_label (view);
5891 GtkWidget* event_box = box;
5892 if (GTK_IS_BOX (box))
5893 {
5894 GList* children = gtk_container_get_children (GTK_CONTAINER (box));
5895 for (; children != NULL; children = g_list_next (children))
5896 if (GTK_IS_EVENT_BOX (children->data))
5897 {
5898 event_box = children->data;
5899 break;
5900 }
5901 g_list_free (children);
5902 }
5903
5898 GtkWidget* label = gtk_bin_get_child (GTK_BIN (event_box));5904 GtkWidget* label = gtk_bin_get_child (GTK_BIN (event_box));
5899
5900 if (GTK_IS_BOX (label))5905 if (GTK_IS_BOX (label))
5901 {5906 {
5902 GList* children = gtk_container_get_children (GTK_CONTAINER (label));5907 GList* children = gtk_container_get_children (GTK_CONTAINER (label));
@@ -5919,11 +5924,11 @@
5919 gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, fg_color);5924 gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, fg_color);
59205925
5921 #if GTK_CHECK_VERSION (3, 0, 0)5926 #if GTK_CHECK_VERSION (3, 0, 0)
5922 gtk_widget_modify_bg (label, GTK_STATE_NORMAL, bg_color);
5923 gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, bg_color);
5924 #else
5925 gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, bg_color);5927 gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, bg_color);
5926 gtk_widget_modify_bg (event_box, GTK_STATE_ACTIVE, bg_color);5928 gtk_widget_modify_bg (event_box, GTK_STATE_ACTIVE, bg_color);
5929 #else
5930 gtk_widget_modify_bg (box, GTK_STATE_NORMAL, bg_color);
5931 gtk_widget_modify_bg (box, GTK_STATE_ACTIVE, bg_color);
5927 #endif5932 #endif
5928}5933}
59295934

Subscribers

People subscribed via source and target branches

to all changes: