summaryrefslogtreecommitdiff
path: root/gdk/quartz
diff options
context:
space:
mode:
authorRichard Hult <richard@imendio.com>2008-05-26 18:51:35 +0000
committerRichard Hult <rhult@src.gnome.org>2008-05-26 18:51:35 +0000
commitf3a6fecb671a2aec691940c9e1b74c7f11e15930 (patch)
tree242aceda92257b6fa7c9a841f71a13fddd124500 /gdk/quartz
parentc9d073570e784c5ae883dcf4cc20cf2b5e243935 (diff)
downloadgtk+-f3a6fecb671a2aec691940c9e1b74c7f11e15930.tar.gz
Try setting the default font, might need to tweak this.
2008-05-26 Richard Hult <richard@imendio.com> * gdk/quartz/gdkevents-quartz.c: (gdk_screen_get_setting): Try setting the default font, might need to tweak this. svn path=/trunk/; revision=20181
Diffstat (limited to 'gdk/quartz')
-rw-r--r--gdk/quartz/gdkevents-quartz.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
index 121d150854..160be04e23 100644
--- a/gdk/quartz/gdkevents-quartz.c
+++ b/gdk/quartz/gdkevents-quartz.c
@@ -1976,10 +1976,12 @@ gdk_screen_get_setting (GdkScreen *screen,
{
if (strcmp (name, "gtk-double-click-time") == 0)
{
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ NSUserDefaults *defaults;
float t;
GDK_QUARTZ_ALLOC_POOL;
+
+ defaults = [NSUserDefaults standardUserDefaults];
t = [defaults floatForKey:@"com.apple.mouse.doubleClickThreshold"];
if (t == 0.0)
@@ -1991,6 +1993,33 @@ gdk_screen_get_setting (GdkScreen *screen,
GDK_QUARTZ_RELEASE_POOL;
g_value_set_int (value, t * 1000);
+
+ return TRUE;
+ }
+ else if (strcmp (name, "gtk-font-name") == 0)
+ {
+ NSString *name;
+ char *str;
+
+ GDK_QUARTZ_ALLOC_POOL;
+
+ name = [[NSFont systemFontOfSize:0] familyName];
+
+ /* Let's try to use the "views" font size (12pt) by default. This is
+ * used for lists/text/other "content" which is the largest parts of
+ * apps, using the "regular control" size (13pt) looks a bit out of
+ * place. We might have to tweak this.
+ */
+
+ /* The size has to be hardcoded as there doesn't seem to be a way to
+ * get the views font size programmatically.
+ */
+ str = g_strdup_printf ("%s 12", [name UTF8String]);
+ g_value_set_string (value, str);
+ g_free (str);
+
+ GDK_QUARTZ_RELEASE_POOL;
+
return TRUE;
}