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
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2013-05-31 22:06:02 +0000
3+++ midori/midori-view.c 2013-06-12 23:38:34 +0000
4@@ -4935,14 +4935,7 @@
5 g_return_val_if_fail (MIDORI_IS_VIEW (view), NULL);
6
7 GtkWidget* tab = GTK_WIDGET (midori_view_get_tab (view));
8- GList* children = gtk_container_get_children (GTK_CONTAINER (tab));
9- GtkWidget* label = NULL;
10- for (; children; children = g_list_next (children))
11- if (GTK_IS_EVENT_BOX (children->data))
12- label = children->data;
13- g_list_free (children);
14- g_warn_if_fail (label != NULL);
15- return label;
16+ return tab;
17 }
18
19 #else
20@@ -5894,9 +5887,21 @@
21 Contained can be a GtkLabel or a GtkBox including a GtkLabel
22 Granite as of this writing uses a GtkLabel (which may change)
23 */
24- GtkWidget* event_box = midori_view_get_proxy_tab_label (view);
25+ GtkWidget* box = midori_view_get_proxy_tab_label (view);
26+ GtkWidget* event_box = box;
27+ if (GTK_IS_BOX (box))
28+ {
29+ GList* children = gtk_container_get_children (GTK_CONTAINER (box));
30+ for (; children != NULL; children = g_list_next (children))
31+ if (GTK_IS_EVENT_BOX (children->data))
32+ {
33+ event_box = children->data;
34+ break;
35+ }
36+ g_list_free (children);
37+ }
38+
39 GtkWidget* label = gtk_bin_get_child (GTK_BIN (event_box));
40-
41 if (GTK_IS_BOX (label))
42 {
43 GList* children = gtk_container_get_children (GTK_CONTAINER (label));
44@@ -5919,11 +5924,11 @@
45 gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, fg_color);
46
47 #if GTK_CHECK_VERSION (3, 0, 0)
48- gtk_widget_modify_bg (label, GTK_STATE_NORMAL, bg_color);
49- gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, bg_color);
50- #else
51 gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, bg_color);
52 gtk_widget_modify_bg (event_box, GTK_STATE_ACTIVE, bg_color);
53+ #else
54+ gtk_widget_modify_bg (box, GTK_STATE_NORMAL, bg_color);
55+ gtk_widget_modify_bg (box, GTK_STATE_ACTIVE, bg_color);
56 #endif
57 }
58

Subscribers

People subscribed via source and target branches

to all changes: