summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2015-01-05 13:45:19 +0100
committerinfirit <[email protected]>2015-01-05 14:17:32 +0100
commit336b8a375332133fe24413e2f362364399b40f50 (patch)
tree87373f5ed70585aaed35d2d127f45e5a46477739
parent14ad0b4e9311e090865e3d613970bdc5b54ef274 (diff)
downloadmate-applets-336b8a375332133fe24413e2f362364399b40f50.tar.bz2
mate-applets-336b8a375332133fe24413e2f362364399b40f50.tar.xz
stickynotes: Small cleanups
-rw-r--r--stickynotes/stickynotes.c12
-rw-r--r--stickynotes/stickynotes_applet.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index b2b9e855..571242f6 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -428,6 +428,7 @@ stickynote_set_color (StickyNote *note,
gboolean save)
{
char *color_str_actual, *font_color_str_actual;
+ gboolean force_default, use_system_color;
GtkRcStyle *rc_style;
if (save) {
@@ -451,11 +452,14 @@ stickynote_set_color (StickyNote *note,
note->color != NULL);
}
+ force_default = g_settings_get_boolean (stickynotes->settings, "force-default");
+ use_system_color = g_settings_get_boolean (stickynotes->settings, "use-system-color");
+
/* If "force_default" is enabled or color_str is NULL,
* then we use the default color instead of color_str. */
- if (!color_str || g_settings_get_boolean (stickynotes->settings, "force-default"))
+ if (!color_str || force_default)
{
- if (g_settings_get_boolean (stickynotes->settings, "use-system-color"))
+ if (use_system_color)
color_str_actual = NULL;
else
color_str_actual = g_settings_get_string (stickynotes->settings, "default-color");
@@ -463,9 +467,9 @@ stickynote_set_color (StickyNote *note,
else
color_str_actual = g_strdup (color_str);
- if (!font_color_str || g_settings_get_boolean (stickynotes->settings, "force-default"))
+ if (!font_color_str || force_default)
{
- if (g_settings_get_boolean (stickynotes->settings, "use-system-color"))
+ if (use_system_color)
font_color_str_actual = NULL;
else
font_color_str_actual = g_settings_get_string (stickynotes->settings, "default-font-color");
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index f7fbb853..133ca2bf 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -448,13 +448,13 @@ void stickynotes_applet_update_icon(StickyNotesApplet *applet)
void
stickynotes_applet_update_prefs (void)
{
- int height;
+ gint width, height;
gboolean sys_color, sys_font, sticky, force_default, desktop_hide;
char *font_str;
char *color_str, *font_color_str;
GdkColor color, font_color;
- gint width = g_settings_get_int (stickynotes->settings, "default-width");
+ width = g_settings_get_int (stickynotes->settings, "default-width");
width = MAX (width, 1);
height = g_settings_get_int (stickynotes->settings, "default-height");