[geany/geany] 34f7ce: Merge branch 'about-banner-fix'

Colomban Wendling git-noreply at xxxxx
Mon Sep 22 17:38:41 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 22 Sep 2014 17:38:41 UTC
Commit:      34f7ce9cc993b9aec41c36fa04fa196cc4f7b402
             https://github.com/geany/geany/commit/34f7ce9cc993b9aec41c36fa04fa196cc4f7b402

Log Message:
-----------
Merge branch 'about-banner-fix'


Modified Paths:
--------------
    src/about.c

Modified: src/about.c
24 lines changed, 22 insertions(+), 2 deletions(-)
===================================================================
@@ -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);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list