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

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6175
Merged at revision: 6179
Proposed branch: lp:~kalikiana/midori/colorlabel
Merge into: lp:midori
Diff against target: 47 lines (+29/-2)
1 file modified
midori/midori-view.c (+29/-2)
To merge this branch: bzr merge lp:~kalikiana/midori/colorlabel
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+166142@code.launchpad.net

Commit message

Apply label color to label rather than event box

Description of the change

Apply label color to label rather than event box

To post a comment you must log in.
lp:~kalikiana/midori/colorlabel updated
6174. By Cris Dywan

Document the way the label for coloring is composed

6175. By Cris Dywan

With GTK+2 background colors need to be set on the event box

Revision history for this message
Paweł Forysiuk (tuxator) wrote :

Works properly now. Thanks

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-23 21:25:46 +0000
+++ midori/midori-view.c 2013-05-28 23:16:25 +0000
@@ -5903,15 +5903,42 @@
5903 GdkColor* fg_color,5903 GdkColor* fg_color,
5904 GdkColor* bg_color)5904 GdkColor* bg_color)
5905{5905{
5906 /*
5907 The proxy tab label is what's put in the notebook,
5908 in all known cases a GtkEventBox
5909 Contained can be a GtkLabel or a GtkBox including a GtkLabel
5910 Granite as of this writing uses a GtkLabel (which may change)
5911 */
5912 GtkWidget* event_box = midori_view_get_proxy_tab_label (view);
5913 GtkWidget* label = gtk_bin_get_child (GTK_BIN (event_box));
5914
5915 if (GTK_IS_BOX (label))
5916 {
5917 GList* children = gtk_container_get_children (GTK_CONTAINER (label));
5918 for (; children != NULL; children = g_list_next (children))
5919 if (GTK_IS_LABEL (children->data))
5920 {
5921 label = children->data;
5922 break;
5923 }
5924 g_list_free (children);
5925 }
5926
5906 midori_tab_set_fg_color (MIDORI_TAB (view), fg_color);5927 midori_tab_set_fg_color (MIDORI_TAB (view), fg_color);
5907 midori_tab_set_bg_color (MIDORI_TAB (view), bg_color);5928 midori_tab_set_bg_color (MIDORI_TAB (view), bg_color);
59085929
5909 GtkWidget* label = midori_view_get_proxy_tab_label (view);5930 gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box),
5910 gtk_event_box_set_visible_window (GTK_EVENT_BOX (label),
5911 fg_color != NULL || bg_color != NULL);5931 fg_color != NULL || bg_color != NULL);
5932
5912 gtk_widget_modify_fg (label, GTK_STATE_NORMAL, fg_color);5933 gtk_widget_modify_fg (label, GTK_STATE_NORMAL, fg_color);
5913 gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, fg_color);5934 gtk_widget_modify_fg (label, GTK_STATE_ACTIVE, fg_color);
5935
5936 #if GTK_CHECK_VERSION (3, 0, 0)
5914 gtk_widget_modify_bg (label, GTK_STATE_NORMAL, bg_color);5937 gtk_widget_modify_bg (label, GTK_STATE_NORMAL, bg_color);
5915 gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, bg_color);5938 gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, bg_color);
5939 #else
5940 gtk_widget_modify_bg (event_box, GTK_STATE_NORMAL, bg_color);
5941 gtk_widget_modify_bg (event_box, GTK_STATE_ACTIVE, bg_color);
5942 #endif
5916}5943}
59175944

Subscribers

People subscribed via source and target branches

to all changes: