diff options
-rw-r--r-- | capplets/font/ChangeLog | 8 | ||||
-rw-r--r-- | capplets/font/font-properties.glade | 143 | ||||
-rw-r--r-- | capplets/font/main.c | 45 |
3 files changed, 144 insertions, 52 deletions
diff --git a/capplets/font/ChangeLog b/capplets/font/ChangeLog index 5d7dc1789..43b16cc07 100644 --- a/capplets/font/ChangeLog +++ b/capplets/font/ChangeLog @@ -1,3 +1,11 @@ +2002-08-19 Jody Goldberg <jody@gnome.org> + + * font-properties.glade : + * main.c: (setup_dialog): merge in owen's patch to configure the + window title font and the font to use for terminals. This patch + uses a metacity specific key for the window title. Owen ? Seth ? + Can you folk choose please. + 2002-06-24 Seth Nickell <snickell@stanford.edu> * font-properties.glade: diff --git a/capplets/font/font-properties.glade b/capplets/font/font-properties.glade index 70a5a80ce..cf613afc6 100644 --- a/capplets/font/font-properties.glade +++ b/capplets/font/font-properties.glade @@ -21,10 +21,8 @@ <child internal-child="action_area"> <widget class="GtkHButtonBox" id="dialog-action_area1"> - <property name="border_width">5</property> <property name="visible">True</property> <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">10</property> <child> <widget class="GtkButton" id="helpbutton1"> @@ -64,7 +62,7 @@ <widget class="GtkTable" id="table3"> <property name="border_width">5</property> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">8</property> @@ -160,6 +158,95 @@ </child> <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Window title font:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">desktop_font</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GnomeFontPicker" id="window_title_font"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> + <property name="show_size">True</property> + <property name="use_font_in_label">True</property> + <property name="label_font_size">14</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Terminal font:</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_RIGHT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">monospace_font</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GnomeFontPicker" id="monospace_font"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Set the monospace font for terminals and similar applications</property> + <property name="can_focus">True</property> + <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> + <property name="show_size">True</property> + <property name="use_font_in_label">True</property> + <property name="label_font_size">14</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> <widget class="GtkFrame" id="font_render_frame"> <property name="visible">True</property> <property name="label_xalign">0</property> @@ -451,53 +538,9 @@ <packing> <property name="left_attach">0</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Window title font:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">desktop_font</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GnomeFontPicker" id="window_title_font"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property> - <property name="show_size">True</property> - <property name="use_font_in_label">True</property> - <property name="label_font_size">14</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">fill</property> - <property name="y_options"></property> </packing> </child> </widget> @@ -528,10 +571,8 @@ <child internal-child="action_area"> <widget class="GtkHButtonBox" id="dialog-action_area3"> - <property name="border_width">5</property> <property name="visible">True</property> <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">10</property> <child> <widget class="GtkButton" id="button1"> diff --git a/capplets/font/main.c b/capplets/font/main.c index cd33af7db..0725fdd6b 100644 --- a/capplets/font/main.c +++ b/capplets/font/main.c @@ -29,6 +29,11 @@ static void cb_show_details (GtkWidget *button, #define DESKTOP_FONT_KEY "/apps/nautilus/preferences/desktop_font" #define WINDOW_TITLE_FONT_KEY "/desktop/gnome/applications/window_manager/titlebar_font" +#define METACITY_DIR "/apps/metacity/general" +#define WINDOW_TITLE_FONT_KEY METACITY_DIR "/titlebar_font" +#define WINDOW_TITLE_USES_SYSTEM_KEY METACITY_DIR "/titlebar_uses_system_font" +#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name" + #ifdef HAVE_XFT2 #define FONT_RENDER_DIR "/desktop/gnome/font_rendering" #define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing" @@ -218,7 +223,7 @@ setup_font_sample (GtkWidget *darea, pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString, "Serif", FC_SLANT, FcTypeInteger, FC_SLANT_ROMAN, - FC_SIZE, FcTypeDouble, 20., + FC_SIZE, FcTypeDouble, 18., NULL); font1 = open_pattern (pattern, antialiasing, hinting); FcPatternDestroy (pattern); @@ -309,6 +314,8 @@ font_render_get_gconf (Antialiasing *antialiasing, if (hint_str) gconf_string_to_enum (hint_enums, hint_str, &val); *hinting = val; + + g_object_unref (client); } typedef struct { @@ -371,6 +378,8 @@ font_radio_toggled (GtkToggleButton *toggle_button, gconf_client_set_string (client, FONT_HINTING_KEY, gconf_enum_to_string (hint_enums, pair->hinting), NULL); + + g_object_unref (client); } /* Restore back to the previous state until we get notification @@ -398,6 +407,25 @@ setup_font_pair (GtkWidget *radio, } #endif /* HAVE_XFT2 */ +static void +metacity_titlebar_load_sensitivity (GConfClient *client, + GladeXML *dialog) +{ + gtk_widget_set_sensitive (WID ("window_title_font"), + !gconf_client_get_bool (client, + WINDOW_TITLE_USES_SYSTEM_KEY, + NULL)); +} + +static void +metacity_changed (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) +{ + if (strcmp (entry->key, WINDOW_TITLE_USES_SYSTEM_KEY) == 0) + metacity_titlebar_load_sensitivity (client, user_data); +} static void setup_dialog (GladeXML *dialog) @@ -409,6 +437,7 @@ setup_dialog (GladeXML *dialog) client = gconf_client_get_default (); gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_add_dir (client, METACITY_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); #ifdef HAVE_XFT2 gconf_client_add_dir (client, FONT_RENDER_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); #endif /* HAVE_XFT2 */ @@ -425,6 +454,16 @@ setup_dialog (GladeXML *dialog) WID ("window_title_font"), PEDITOR_FONT_COMBINED, NULL); + peditor = gconf_peditor_new_font (NULL, MONOSPACE_FONT_KEY, + WID ("monospace_font"), + PEDITOR_FONT_COMBINED, NULL); + + gconf_client_notify_add (client, METACITY_DIR, + metacity_changed, + dialog, NULL, NULL); + + metacity_titlebar_load_sensitivity (client, dialog); + widget = WID ("font_dialog"); capplet_set_icon (widget, "font-capplet.png"); @@ -452,6 +491,8 @@ setup_dialog (GladeXML *dialog) G_CALLBACK (cb_dialog_response), NULL); gtk_widget_show (widget); + + g_object_unref (client); } #ifdef HAVE_XFT2 @@ -700,6 +741,8 @@ cb_show_details (GtkWidget *button, g_signal_connect (G_OBJECT (details_dialog), "delete_event", G_CALLBACK (gtk_true), NULL); + + g_object_unref (client); } gtk_window_present (GTK_WINDOW (details_dialog)); |