Trivial formatting fixes
Just committing these is easier than writing them up.
This commit is contained in:
@ -110,7 +110,7 @@ struct _GtkFontChooserPrivate
|
|||||||
|
|
||||||
#define ROW_FORMAT_STRING "<span weight=\"bold\" size=\"small\">%s</span>\n<span size=\"x-large\" font_desc=\"%s\">%s</span>"
|
#define ROW_FORMAT_STRING "<span weight=\"bold\" size=\"small\">%s</span>\n<span size=\"x-large\" font_desc=\"%s\">%s</span>"
|
||||||
|
|
||||||
#define NO_FONT_MATCHED_SEARCH "No fonts matched your serach entry.You can revise your serach and try again."
|
#define NO_FONT_MATCHED_SEARCH "No fonts matched your search. You can revise your search and try again."
|
||||||
|
|
||||||
/* These are what we use as the standard font sizes, for the size list.
|
/* These are what we use as the standard font sizes, for the size list.
|
||||||
*/
|
*/
|
||||||
@ -522,7 +522,6 @@ row_deleted_cb (GtkTreeModel *model,
|
|||||||
gtk_container_add (GTK_CONTAINER (priv->list_scrolled_window),
|
gtk_container_add (GTK_CONTAINER (priv->list_scrolled_window),
|
||||||
priv->empty_list);
|
priv->empty_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -757,9 +756,7 @@ populate_list (GtkFontChooser *fontchooser,
|
|||||||
gchar *font_desc = pango_font_description_to_string (pango_desc);
|
gchar *font_desc = pango_font_description_to_string (pango_desc);
|
||||||
|
|
||||||
/* foreground_color, family_name, face_name, desc, sample string */
|
/* foreground_color, family_name, face_name, desc, sample string */
|
||||||
g_string_printf (family_and_face, "%s %s",
|
g_string_printf (family_and_face, "%s %s", fam_name, face_name);
|
||||||
fam_name,
|
|
||||||
face_name);
|
|
||||||
|
|
||||||
g_string_printf (tmp, ROW_FORMAT_STRING,
|
g_string_printf (tmp, ROW_FORMAT_STRING,
|
||||||
family_and_face->str,
|
family_and_face->str,
|
||||||
@ -852,7 +849,7 @@ visible_func (GtkTreeModel *model,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_font_chooser_bootstrap_fontlist (GtkFontChooser* fontchooser)
|
gtk_font_chooser_bootstrap_fontlist (GtkFontChooser *fontchooser)
|
||||||
{
|
{
|
||||||
GtkTreeView *treeview = GTK_TREE_VIEW (fontchooser->priv->family_face_list);
|
GtkTreeView *treeview = GTK_TREE_VIEW (fontchooser->priv->family_face_list);
|
||||||
GtkCellRenderer *cell;
|
GtkCellRenderer *cell;
|
||||||
@ -914,7 +911,6 @@ gtk_font_chooser_screen_changed (GtkWidget *widget,
|
|||||||
populate_list (fontchooser,
|
populate_list (fontchooser,
|
||||||
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
|
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
|
||||||
fontchooser->priv->model);
|
fontchooser->priv->model);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -927,7 +923,6 @@ gtk_font_chooser_style_updated (GtkWidget *widget)
|
|||||||
populate_list (fontchooser,
|
populate_list (fontchooser,
|
||||||
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
|
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
|
||||||
fontchooser->priv->model);
|
fontchooser->priv->model);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -966,11 +961,11 @@ gtk_font_chooser_ref_face (GtkFontChooser *fontchooser,
|
|||||||
* @fontchooser: a #GtkFontChooser
|
* @fontchooser: a #GtkFontChooser
|
||||||
*
|
*
|
||||||
* Gets the #PangoFontFamily representing the selected font family.
|
* Gets the #PangoFontFamily representing the selected font family.
|
||||||
|
* Font families are a collection of font faces.
|
||||||
*
|
*
|
||||||
* Return value: (transfer none): A #PangoFontFamily representing the
|
* Return value: (transfer none): A #PangoFontFamily representing the
|
||||||
* selected font family. Font families are a collection of font
|
* selected font family. The returned object is owned by @fontchooser
|
||||||
* faces. The returned object is owned by @fontchooser and must not
|
* and must not be modified or freed.
|
||||||
* be modified or freed.
|
|
||||||
*
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
@ -1030,14 +1025,16 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser)
|
|||||||
*
|
*
|
||||||
* Note that this can be a different string than what you set with
|
* Note that this can be a different string than what you set with
|
||||||
* gtk_font_chooser_set_font_name(), as the font chooser widget may
|
* gtk_font_chooser_set_font_name(), as the font chooser widget may
|
||||||
* normalize font names and thus return a string with a different structure.
|
* normalize font names and thus return a string with a different
|
||||||
* For example, "Helvetica Italic Bold 12" could be normalized to
|
* structure. For example, "Helvetica Italic Bold 12" could be
|
||||||
* "Helvetica Bold Italic 12". Use pango_font_description_equal()
|
* normalized to "Helvetica Bold Italic 12".
|
||||||
* if you want to compare two font descriptions.
|
|
||||||
*
|
*
|
||||||
* Return value: (transfer full) (allow-none): A string with the name of the
|
* Use pango_font_description_equal() if you want to compare two
|
||||||
* current font, or %NULL if no font is selected. You must free this
|
* font descriptions.
|
||||||
* string with g_free().
|
*
|
||||||
|
* Return value: (transfer full) (allow-none): A string with the name
|
||||||
|
* of the current font, or %NULL if no font is selected. You must
|
||||||
|
* free this string with g_free().
|
||||||
*
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
@ -1051,8 +1048,6 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
|
|||||||
if (!fontchooser->priv->face)
|
if (!fontchooser->priv->face)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
desc = pango_font_face_describe (fontchooser->priv->face);
|
desc = pango_font_face_describe (fontchooser->priv->face);
|
||||||
font_desc_name = pango_font_description_to_string (desc);
|
font_desc_name = pango_font_description_to_string (desc);
|
||||||
pango_font_description_free (desc);
|
pango_font_description_free (desc);
|
||||||
@ -1062,8 +1057,6 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
|
|||||||
return font_name;
|
return font_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This sets the current font, then selecting the appropriate list rows. */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gtk_font_chooser_set_font_name:
|
* gtk_font_chooser_set_font_name:
|
||||||
* @fontchooser: a #GtkFontChooser
|
* @fontchooser: a #GtkFontChooser
|
||||||
@ -1071,13 +1064,14 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
|
|||||||
*
|
*
|
||||||
* Sets the currently-selected font.
|
* Sets the currently-selected font.
|
||||||
*
|
*
|
||||||
* Note that the @fontchooser needs to know the screen in which it will appear
|
* Note that the @fontchooser needs to know the screen in which
|
||||||
* for this to work; this can be guaranteed by simply making sure that the
|
* it will appear for this to work; this can be guaranteed by simply
|
||||||
* @fontchooser is inserted in a toplevel window before you call this function.
|
* making sure that the @fontchooser is inserted in a toplevel window
|
||||||
|
* before you call this function.
|
||||||
*
|
*
|
||||||
* Return value: %TRUE if the font could be set successfully; %FALSE if no
|
* Return value: %TRUE if the font could be set successfully; %FALSE
|
||||||
* such font exists or if the @fontchooser doesn't belong to a particular
|
* if no such font exists or if the @fontchooser doesn't belong
|
||||||
* screen yet.
|
* to a particular screen yet.
|
||||||
*
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
@ -1130,7 +1124,6 @@ gtk_font_chooser_set_font_name (GtkFontChooser *fontchooser,
|
|||||||
pango_font_description_set_size (tmp_desc,
|
pango_font_description_set_size (tmp_desc,
|
||||||
pango_font_description_get_size (desc));
|
pango_font_description_get_size (desc));
|
||||||
|
|
||||||
|
|
||||||
if (pango_font_description_equal (desc, tmp_desc))
|
if (pango_font_description_equal (desc, tmp_desc))
|
||||||
{
|
{
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
@ -1194,6 +1187,7 @@ const gchar*
|
|||||||
gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser)
|
gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
|
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
|
||||||
|
|
||||||
return (const gchar*)fontchooser->priv->preview_text;
|
return (const gchar*)fontchooser->priv->preview_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1231,8 +1225,11 @@ gtk_font_chooser_set_preview_text (GtkFontChooser *fontchooser,
|
|||||||
* gtk_font_chooser_get_show_preview_entry:
|
* gtk_font_chooser_get_show_preview_entry:
|
||||||
* @fontchooser: a #GtkFontChooser
|
* @fontchooser: a #GtkFontChooser
|
||||||
*
|
*
|
||||||
* Return value: %TRUE if the preview entry is shown or %FALSE if
|
* Returns whether the preview entry is shown or not.
|
||||||
* it is hidden.
|
*
|
||||||
|
* Return value: %TRUE if the preview entry is shown
|
||||||
|
* or %FALSE if it is hidden.
|
||||||
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
@ -1249,6 +1246,7 @@ gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser)
|
|||||||
* @show_preview_entry: whether to show the editable preview entry or not
|
* @show_preview_entry: whether to show the editable preview entry or not
|
||||||
*
|
*
|
||||||
* Shows or hides the editable preview entry.
|
* Shows or hides the editable preview entry.
|
||||||
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
|||||||
@ -80,6 +80,7 @@ void gtk_font_chooser_set_preview_text (GtkFontChooser *fontchoo
|
|||||||
gboolean gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser);
|
gboolean gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser);
|
||||||
void gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
|
void gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
|
||||||
gboolean show_preview_entry);
|
gboolean show_preview_entry);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GTK_FONT_CHOOSER_H__ */
|
#endif /* __GTK_FONT_CHOOSER_H__ */
|
||||||
|
|||||||
@ -70,12 +70,11 @@ struct _GtkFontChooserDialogPrivate
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static void gtk_font_chooser_dialog_buildable_interface_init (GtkBuildableIface *iface);
|
static void gtk_font_chooser_dialog_buildable_interface_init (GtkBuildableIface *iface);
|
||||||
static GObject* gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
|
static GObject *gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
|
||||||
GtkBuilder *builder,
|
GtkBuilder *builder,
|
||||||
const gchar *childname);
|
const gchar *childname);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkFontChooserDialog, gtk_font_chooser_dialog,
|
G_DEFINE_TYPE_WITH_CODE (GtkFontChooserDialog, gtk_font_chooser_dialog, GTK_TYPE_DIALOG,
|
||||||
GTK_TYPE_DIALOG,
|
|
||||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||||
gtk_font_chooser_dialog_buildable_interface_init))
|
gtk_font_chooser_dialog_buildable_interface_init))
|
||||||
|
|
||||||
@ -132,8 +131,7 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
|
|||||||
GTK_RESPONSE_CANCEL,
|
GTK_RESPONSE_CANCEL,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
gtk_window_set_title (GTK_WINDOW (fontchooserdiag),
|
gtk_window_set_title (GTK_WINDOW (fontchooserdiag), _("Font Selection"));
|
||||||
_("Font Selection"));
|
|
||||||
|
|
||||||
gtk_widget_pop_composite_child ();
|
gtk_widget_pop_composite_child ();
|
||||||
}
|
}
|
||||||
@ -172,7 +170,7 @@ gtk_font_chooser_dialog_new (const gchar *title,
|
|||||||
* Returns: (transfer none): the embedded #GtkFontChooser
|
* Returns: (transfer none): the embedded #GtkFontChooser
|
||||||
*
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
**/
|
*/
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
gtk_font_chooser_dialog_get_font_chooser (GtkFontChooserDialog *fcd)
|
gtk_font_chooser_dialog_get_font_chooser (GtkFontChooserDialog *fcd)
|
||||||
{
|
{
|
||||||
@ -217,11 +215,13 @@ gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
|
|||||||
* gtk_font_chooser_dialog_set_font_name(), as the font chooser widget
|
* gtk_font_chooser_dialog_set_font_name(), as the font chooser widget
|
||||||
* may normalize font names and thus return a string with a different
|
* may normalize font names and thus return a string with a different
|
||||||
* structure. For example, "Helvetica Italic Bold 12" could be normalized
|
* structure. For example, "Helvetica Italic Bold 12" could be normalized
|
||||||
* to "Helvetica Bold Italic 12". Use pango_font_description_equal()
|
* to "Helvetica Bold Italic 12".
|
||||||
* if you want to compare two font descriptions.
|
|
||||||
*
|
*
|
||||||
* Return value: A string with the name of the current font, or %NULL if no
|
* Use pango_font_description_equal() if you want to compare two
|
||||||
* font is selected. You must free this string with g_free().
|
* font descriptions.
|
||||||
|
*
|
||||||
|
* Return value: A string with the name of the current font, or %NULL
|
||||||
|
* if no font is selected. You must free this string with g_free().
|
||||||
*
|
*
|
||||||
* Since: 3.2
|
* Since: 3.2
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user