Merge branch 'about-banner-fix'

This commit is contained in:
Colomban Wendling 2014-09-22 19:38:41 +02:00
commit 34f7ce9cc9

View File

@ -120,6 +120,8 @@ static const gchar *contributors =
"Tyler Mulligan, Walery Studennikov, Yura Siamashka";
static void header_eventbox_style_set(GtkWidget *widget);
static void header_label_style_set(GtkWidget *widget);
static void homepage_clicked(GtkButton *button, gpointer data);
@ -187,8 +189,10 @@ static GtkWidget *create_dialog(void)
gtk_label_set_markup(GTK_LABEL(header_label), buffer);
gtk_widget_show(header_label);
gtk_box_pack_start(GTK_BOX(header_hbox), header_label, FALSE, FALSE, 0);
gtk_widget_set_state(header_eventbox, GTK_STATE_SELECTED);
gtk_widget_set_state(header_label, GTK_STATE_SELECTED);
header_eventbox_style_set(header_eventbox);
header_label_style_set(header_label);
g_signal_connect_after(header_eventbox, "style-set", G_CALLBACK(header_eventbox_style_set), NULL);
g_signal_connect_after(header_label, "style-set", G_CALLBACK(header_label_style_set), NULL);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), header_eventbox, FALSE, FALSE, 0);
/* create notebook */
@ -452,6 +456,22 @@ void about_dialog_show(void)
}
static void header_eventbox_style_set(GtkWidget *widget)
{
GtkStyle *style = gtk_widget_get_style(widget);
if (! gdk_color_equal(&style->bg[GTK_STATE_NORMAL], &style->bg[GTK_STATE_SELECTED]))
gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &style->bg[GTK_STATE_SELECTED]);
}
static void header_label_style_set(GtkWidget *widget)
{
GtkStyle *style = gtk_widget_get_style(widget);
if (! gdk_color_equal(&style->fg[GTK_STATE_NORMAL], &style->fg[GTK_STATE_SELECTED]))
gtk_widget_modify_fg(widget, GTK_STATE_NORMAL, &style->fg[GTK_STATE_SELECTED]);
}
static void homepage_clicked(GtkButton *button, gpointer data)
{
utils_open_browser(data);