summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-global-preferences.c
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2001-03-08 00:40:19 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2001-03-08 00:40:19 +0000
commit47496b27cbefa0e6fdc0c2674f07a63fda156e05 (patch)
tree683f72bd930039cc9765c796d1724337bea44634 /libnautilus-extensions/nautilus-global-preferences.c
parent2832fe1009198522cd2b920a6e16cc598e1a9a98 (diff)
downloadnautilus-47496b27cbefa0e6fdc0c2674f07a63fda156e05.tar.gz
reviewed by: John Sullivan <sullivan@eazel.com>
Fix bugs: 7349 - Sidebar tabs no longer display in a bold font 7477 - Sidebar tab labels don't update to new font when font is changed 7492 - Font style regression on Sidebar title * libnautilus-extensions/nautilus-global-preferences.h: * libnautilus-extensions/nautilus-global-preferences.c: (nautilus_global_preferences_get_smooth_font): Add documentation to clarify the fact that the result needs to be unrefed. (nautilus_global_preferences_get_smooth_bold_font): New function that returns a bold version of the user's preferred font. * src/nautilus-sidebar-tabs.c: (nautilus_sidebar_tabs_load_theme_data): Use the user's bold preffered font instead of the default font. (bug 7349) (smooth_font_changed_callback), (nautilus_sidebar_tabs_initialize), (nautilus_sidebar_tabs_destroy): Listen for changes in the user's preferred font and update the tabs accordingly (bug 7477) * src/nautilus-sidebar-title.c: (smooth_font_changed_callback): Use the user's bold preferred font instead of the plain one. Also unref the font when done to plug a tiny leak. (bug 7492)
Diffstat (limited to 'libnautilus-extensions/nautilus-global-preferences.c')
-rw-r--r--libnautilus-extensions/nautilus-global-preferences.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-global-preferences.c b/libnautilus-extensions/nautilus-global-preferences.c
index 61f716dc6..2ae55a2d5 100644
--- a/libnautilus-extensions/nautilus-global-preferences.c
+++ b/libnautilus-extensions/nautilus-global-preferences.c
@@ -1261,6 +1261,12 @@ nautilus_global_preferences_set_dialog_title (const char *title)
gtk_window_set_title (GTK_WINDOW (dialog), title);
}
+/**
+ * nautilus_global_preferences_get_smooth_font
+ *
+ * Return value: The user's preferred smooth font. Need to
+ * unref the returned GtkObject when done with it.
+ */
NautilusScalableFont *
nautilus_global_preferences_get_smooth_font (void)
{
@@ -1280,6 +1286,35 @@ nautilus_global_preferences_get_smooth_font (void)
return scalable_font;
}
+/**
+ * nautilus_global_preferences_get_smooth_bold_font
+ *
+ * Return value: A bold flavor on the user's preferred smooth font. If
+ * no bold font is found, then the plain preffered font is
+ * used. Need to unref the returned GtkObject when done
+ * with it.
+ */
+NautilusScalableFont *
+nautilus_global_preferences_get_smooth_bold_font (void)
+{
+ NautilusScalableFont *plain_font;
+ NautilusScalableFont *bold_font;
+
+ plain_font = nautilus_global_preferences_get_smooth_font ();
+ g_assert (NAUTILUS_IS_SCALABLE_FONT (plain_font));
+
+ bold_font = nautilus_scalable_font_make_bold (plain_font);
+
+ if (bold_font == NULL) {
+ bold_font = plain_font;
+ } else {
+ gtk_object_unref (GTK_OBJECT (plain_font));
+ }
+
+ g_assert (NAUTILUS_IS_SCALABLE_FONT (bold_font));
+ return bold_font;
+}
+
void
nautilus_global_preferences_initialize (void)
{