[Xfce4-commits] [panel-plugins/xfce4-verve-plugin] 02/04: Save colors to configuration file
noreply at xfce.org
noreply at xfce.org
Wed Nov 22 23:34:28 CET 2017
This is an automated email from the git hooks/post-receive script.
i s a a c s c h e m m p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-verve-plugin.
commit 2183785a779157fc22559058221b181d97be658d
Author: Isaac Schemm <isaacschemm at gmail.com>
Date: Fri Nov 17 08:18:28 2017 -0600
Save colors to configuration file
---
panel-plugin/verve-plugin.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/verve-plugin.c b/panel-plugin/verve-plugin.c
index 72da842..72fa08f 100644
--- a/panel-plugin/verve-plugin.c
+++ b/panel-plugin/verve-plugin.c
@@ -529,6 +529,11 @@ verve_plugin_new (XfcePanelPlugin *plugin)
verve->launch_params.use_backslash = FALSE;
verve->launch_params.use_smartbookmark = FALSE;
verve->launch_params.smartbookmark_url = g_strdup("");
+
+ /* Initialize colors */
+ verve->fg_color_override = FALSE;
+ verve->bg_color_override = FALSE;
+ verve->base_color_override = FALSE;
/* Initialize label */
verve->label = gtk_label_new ("");
@@ -833,6 +838,7 @@ verve_plugin_write_rc_file (XfcePanelPlugin *plugin,
{
XfceRc *rc;
gchar *filename;
+ gchar *color_str;
g_return_if_fail (plugin != NULL);
g_return_if_fail (verve != NULL);
@@ -872,9 +878,17 @@ verve_plugin_write_rc_file (XfcePanelPlugin *plugin,
xfce_rc_write_entry (rc, "smartbookmark-url", verve->launch_params.smartbookmark_url);
/* Write colors */
- xfce_rc_write_entry (rc, "foreground-color", verve->fg_color_override ? "orange" : "");
- xfce_rc_write_entry (rc, "background-color", verve->bg_color_override ? "green" : "");
- xfce_rc_write_entry (rc, "base-color", verve->base_color_override ? "blue" : "");
+ color_str = gdk_color_to_string(&verve->fg_color);
+ xfce_rc_write_entry (rc, "foreground-color", verve->fg_color_override ? color_str : "");
+ g_free (color_str);
+
+ color_str = gdk_color_to_string(&verve->bg_color);
+ xfce_rc_write_entry (rc, "background-color", verve->bg_color_override ? color_str : "");
+ g_free (color_str);
+
+ color_str = gdk_color_to_string(&verve->base_color);
+ xfce_rc_write_entry (rc, "base-color", verve->base_color_override ? color_str : "");
+ g_free (color_str);
/* Close handle */
xfce_rc_close (rc);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list