merge in owen's patch to configure the window title font and the font to
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.
This commit is contained in:
parent
b5ef65002e
commit
393fa2d6d1
3 changed files with 144 additions and 52 deletions
|
@ -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:
|
||||
|
|
|
@ -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>
|
||||
|
@ -159,6 +157,95 @@
|
|||
</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="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>
|
||||
|
@ -451,55 +538,11 @@
|
|||
<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="top_attach">4</property>
|
||||
<property name="bottom_attach">5</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="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
@ -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">
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue