#include <midori/midori.h>
static void
-colorful_tabs_modify_fg (GtkWidget* child,
- GdkColor* color)
+colorful_tabs_modify_fg (GtkWidget* label,
+ GdkColor* color)
{
- if (GTK_IS_LABEL (child))
+ GtkWidget* box = gtk_bin_get_child (GTK_BIN (label));
+ GList* children = gtk_container_get_children (GTK_CONTAINER (box));
+ for (; children != NULL; children = g_list_next (children))
{
- gtk_widget_modify_fg (child, GTK_STATE_ACTIVE, color);
- gtk_widget_modify_fg (child, GTK_STATE_NORMAL, color);
+ if (GTK_IS_LABEL (children->data))
+ {
+ gtk_widget_modify_fg (children->data, GTK_STATE_ACTIVE, color);
+ gtk_widget_modify_fg (children->data, GTK_STATE_NORMAL, color);
+ /* Also modify the label itself, for Tab Panel */
+ gtk_widget_modify_fg (label, GTK_STATE_NORMAL, color);
+ break;
+ }
}
+ g_list_free (children);
}
static void
GParamSpec* pspec,
MidoriExtension* extension)
{
- GtkWidget* box;
GtkWidget* label;
SoupURI* uri;
gchar* colorstr;
else
gdk_color_parse ("#000", &fgcolor);
- box = gtk_bin_get_child (GTK_BIN (label));
-
gtk_event_box_set_visible_window (GTK_EVENT_BOX (label), TRUE);
- gtk_container_foreach (GTK_CONTAINER (box),
- (GtkCallback) colorful_tabs_modify_fg,
- &fgcolor);
-
+ colorful_tabs_modify_fg (label, &fgcolor);
gtk_widget_modify_bg (label, GTK_STATE_NORMAL, &color);
if (color.red < 10000)
{
gtk_widget_modify_bg (label, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, NULL);
- gtk_container_foreach (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (label))),
- (GtkCallback) colorful_tabs_modify_fg,
- NULL);
+ colorful_tabs_modify_fg (label, NULL);
}
}
gtk_event_box_set_visible_window (GTK_EVENT_BOX (label), FALSE);
gtk_widget_modify_bg (label, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_bg (label, GTK_STATE_ACTIVE, NULL);
- gtk_container_foreach (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (label))),
- (GtkCallback) colorful_tabs_modify_fg,
- NULL);
+ colorful_tabs_modify_fg (label, NULL);
g_signal_handlers_disconnect_by_func (
view, colorful_tabs_view_notify_uri_cb, extension);
}
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
3, icon,
6, &style->bg[GTK_STATE_NORMAL],
+ 7, &style->fg[GTK_STATE_NORMAL],
-1);
}
}
gtk_tree_store_insert_with_values (GTK_TREE_STORE (model),
&iter, NULL, page, 0, view, 1, GTK_STOCK_CLOSE, 2, buttons,
- 3, icon, 4, title, 5, ellipsize, 6, NULL, -1);
+ 3, icon, 4, title, 5, ellipsize, 6, NULL, 7, NULL, -1);
}
if (!g_signal_handler_find (view, G_SIGNAL_MATCH_FUNC,
panel = katze_object_get_object (browser, "panel");
- model = gtk_tree_store_new (7, MIDORI_TYPE_VIEW,
- G_TYPE_STRING, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT, GDK_TYPE_COLOR);
+ model = gtk_tree_store_new (8, MIDORI_TYPE_VIEW,
+ G_TYPE_STRING, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_STRING,
+ G_TYPE_INT, GDK_TYPE_COLOR, GDK_TYPE_COLOR);
g_object_set_data (G_OBJECT (browser), "tab-panel-ext-model", model);
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
renderer_text = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, renderer_text, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer_text,
- "text", 4, "ellipsize", 5, "cell-background-gdk", 6, NULL);
+ "text", 4, "ellipsize", 5,
+ "cell-background-gdk", 6, "foreground-gdk", 7, NULL);
gtk_tree_view_column_set_expand (column, TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
column = gtk_tree_view_column_new ();