summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2003-12-30 12:01:46 +0000
committerShaun McCance <shaunm@src.gnome.org>2003-12-30 12:01:46 +0000
commit4d2a2f86f79824448095c9ba0d62807f750c61c1 (patch)
treed3cdb467174da7d40440838dd68cbd7b5d5b881f
parent8d935e517828bbaad1229a55623268d82b176a0b (diff)
downloadyelp-4d2a2f86f79824448095c9ba0d62807f750c61c1.tar.gz
- Grab the default style if gtk_rc_get_style_by_paths returns NULL.
* src/yelp-theme.c: - Grab the default style if gtk_rc_get_style_by_paths returns NULL.
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-theme.c32
2 files changed, 23 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 08254687..f9fb3d9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2003-12-30 Shaun McCance <shaunm@gnome.org>
+ * src/yelp-theme.c:
+ - Grab the default style if gtk_rc_get_style_by_paths returns NULL.
+
+2003-12-30 Shaun McCance <shaunm@gnome.org>
+
* src/yelp-db-pager.c:
- doc_name and doc_path were reversed for some reason.
diff --git a/src/yelp-theme.c b/src/yelp-theme.c
index 3e246cb5..8bd06d0a 100644
--- a/src/yelp-theme.c
+++ b/src/yelp-theme.c
@@ -44,20 +44,24 @@ yelp_theme_init (void)
style = gtk_rc_get_style_by_paths (gtk_settings_get_default (),
"GtkWidget", "GtkWidget",
GTK_TYPE_WIDGET);
- if (!style) {
- g_warning (_("Could not obtain a GtkStyle."));
- } else {
- g_snprintf (gray_background, 10,
- "\"#%02X%02X%02X\"",
- style->bg[GTK_STATE_NORMAL].red >> 8,
- style->bg[GTK_STATE_NORMAL].green >> 8,
- style->bg[GTK_STATE_NORMAL].blue >> 8);
- g_snprintf (gray_border, 10,
- "\"#%02X%02X%02X\"",
- style->dark[GTK_STATE_NORMAL].red >> 8,
- style->dark[GTK_STATE_NORMAL].green >> 8,
- style->dark[GTK_STATE_NORMAL].blue >> 8);
- }
+
+ if (!style)
+ style = gtk_style_new ();
+
+ g_object_ref (G_OBJECT (style));
+
+ g_snprintf (gray_background, 10,
+ "\"#%02X%02X%02X\"",
+ style->bg[GTK_STATE_NORMAL].red >> 8,
+ style->bg[GTK_STATE_NORMAL].green >> 8,
+ style->bg[GTK_STATE_NORMAL].blue >> 8);
+ g_snprintf (gray_border, 10,
+ "\"#%02X%02X%02X\"",
+ style->dark[GTK_STATE_NORMAL].red >> 8,
+ style->dark[GTK_STATE_NORMAL].green >> 8,
+ style->dark[GTK_STATE_NORMAL].blue >> 8);
+
+ g_object_unref (G_OBJECT (style));
}
const GtkIconTheme*