[gnome-commander/gcmd-1-6] Changes style colors if desktop env theme should be respected, fixes bgo#398734
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-6] Changes style colors if desktop env theme should be respected, fixes bgo#398734
- Date: Fri, 21 Oct 2016 22:15:54 +0000 (UTC)
commit 9200265a3c09bfa104a77ba32451df4cb4446b79
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sat Oct 22 00:10:07 2016 +0200
Changes style colors if desktop env theme should be respected, fixes bgo#398734
NEWS | 7 ++++
doc/C/releases.xml | 14 +++++++++
src/gnome-cmd-style.cc | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index ffec0c3..63b6578 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,11 @@
===================================
+gnome-commander 1.6.2
+---------------
+
+Bug fixes:
+ * Fixed problem bgo#398734 (Color of marked files does not change when using theme colors)
+
+===================================
gnome-commander 1.6.1
---------------
diff --git a/doc/C/releases.xml b/doc/C/releases.xml
index 7167138..de7b81a 100644
--- a/doc/C/releases.xml
+++ b/doc/C/releases.xml
@@ -23,6 +23,20 @@
</thead>
<tbody>
<row valign="top">
+ <entry><para>1.6.2</para></entry>
+ <entry><para>2016-??-??</para></entry>
+ <entry>
+ <para>Bug fixes:</para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>Fixed problem bgo#398734 (Color of marked files does not change when using
theme colors)</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </entry>
+ </row>
+ <row valign="top">
<entry><para>1.6.1</para></entry>
<entry><para>2016-10-18</para></entry>
<entry>
diff --git a/src/gnome-cmd-style.cc b/src/gnome-cmd-style.cc
index d7b77b5..0890052 100644
--- a/src/gnome-cmd-style.cc
+++ b/src/gnome-cmd-style.cc
@@ -62,6 +62,22 @@ inline GtkStyle *create_list_style (GnomeCmdColorTheme *cols, const gchar *font_
style->base[GTK_STATE_NORMAL] = *cols->norm_bg;
style->base[GTK_STATE_ACTIVE] = *cols->norm_bg;
}
+ else
+ {
+ GtkWidget *widget = gtk_combo_new ();
+ GtkStyle *default_style = gtk_rc_get_style(widget);
+ gtk_widget_destroy (widget);
+
+ if(default_style)
+ {
+ gtk_style_lookup_color (default_style, "tooltip_fg_color", &style->fg[GTK_STATE_SELECTED]);
+ gtk_style_lookup_color (default_style, "fg_color", &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "fg_color", &style->text[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "tooltip_bg_color", &style->bg[GTK_STATE_SELECTED]);
+ gtk_style_lookup_color (default_style, "bg_color", &style->base[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "bg_color", &style->base[GTK_STATE_ACTIVE]);
+ }
+ }
return style;
}
@@ -93,6 +109,22 @@ inline GtkStyle *create_alt_list_style (GnomeCmdColorTheme *cols, const gchar *f
style->base[GTK_STATE_NORMAL] = *cols->alt_bg;
style->base[GTK_STATE_ACTIVE] = *cols->alt_bg;
}
+ else
+ {
+ GtkWidget *widget = gtk_combo_new ();
+ GtkStyle *default_style = gtk_rc_get_style(widget);
+ gtk_widget_destroy (widget);
+
+ if(default_style)
+ {
+ gtk_style_lookup_color (default_style, "tooltip_fg_color", &style->fg[GTK_STATE_SELECTED]);
+ gtk_style_lookup_color (default_style, "selected_bg_color", &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "selected_bg_color", &style->text[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "tooltip_bg_color", &style->bg[GTK_STATE_SELECTED]);
+ gtk_style_lookup_color (default_style, "selected_fg_color", &style->base[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "selected_fg_color", &style->base[GTK_STATE_ACTIVE]);
+ }
+ }
return style;
}
@@ -125,6 +157,28 @@ inline GtkStyle *create_sel_list_style (GnomeCmdColorTheme *cols, const gchar *f
style->base[GTK_STATE_NORMAL] = *cols->sel_bg;
style->base[GTK_STATE_ACTIVE] = *cols->sel_bg;
}
+ else
+ {
+ GtkWidget *widget = gtk_combo_new ();
+ GtkStyle *default_style = gtk_rc_get_style(widget);
+ gtk_widget_destroy (widget);
+
+ if(default_style)
+ {
+ gtk_style_lookup_color (default_style, "selected_fg_color", &style->fg[GTK_STATE_SELECTED]);
+ if (!gtk_style_lookup_color (default_style, "selected_fg_color", &style->fg[GTK_STATE_NORMAL]))
+ gdk_color_parse("#ffffff", &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "text_color", &style->text[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "bg_color", &style->bg[GTK_STATE_SELECTED]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->bg[GTK_STATE_NORMAL]))
+ gdk_color_parse("#000000", &style->bg[GTK_STATE_NORMAL]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->base[GTK_STATE_NORMAL]))
+ gdk_color_parse("#000000", &style->base[GTK_STATE_NORMAL]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->base[GTK_STATE_ACTIVE]))
+ gdk_color_parse("#000000", &style->base[GTK_STATE_ACTIVE]);
+ }
+ }
+
return style;
}
@@ -157,6 +211,27 @@ inline GtkStyle *create_alt_sel_list_style (GnomeCmdColorTheme *cols, const gcha
style->base[GTK_STATE_NORMAL] = *cols->sel_bg;
style->base[GTK_STATE_ACTIVE] = *cols->sel_bg;
}
+ else
+ {
+ GtkWidget *widget = gtk_combo_new ();
+ GtkStyle *default_style = gtk_rc_get_style(widget);
+ gtk_widget_destroy (widget);
+
+ if(default_style)
+ {
+ gtk_style_lookup_color (default_style, "selected_fg_color", &style->fg[GTK_STATE_SELECTED]);
+ if (!gtk_style_lookup_color (default_style, "selected_fg_color", &style->fg[GTK_STATE_NORMAL]))
+ gdk_color_parse("#ffffff", &style->fg[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "text_color", &style->text[GTK_STATE_NORMAL]);
+ gtk_style_lookup_color (default_style, "bg_color", &style->bg[GTK_STATE_SELECTED]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->bg[GTK_STATE_NORMAL]))
+ gdk_color_parse("#000000", &style->bg[GTK_STATE_NORMAL]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->base[GTK_STATE_NORMAL]))
+ gdk_color_parse("#000000", &style->base[GTK_STATE_NORMAL]);
+ if(!gtk_style_lookup_color (default_style, "selected_bg_color", &style->base[GTK_STATE_ACTIVE]))
+ gdk_color_parse("#000000", &style->base[GTK_STATE_ACTIVE]);
+ }
+ }
return style;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]