[gtk/wip/baedert/for-master: 21/34] aboutdialog: Clarify docs and fix preconditions
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 21/34] aboutdialog: Clarify docs and fix preconditions
- Date: Thu, 20 Feb 2020 09:24:32 +0000 (UTC)
commit 2ad6c045b4d21ea41c4aaa15fe50a32b297f456c
Author: Timm Bäder <mail baedert org>
Date: Tue Feb 18 10:36:04 2020 +0100
aboutdialog: Clarify docs and fix preconditions
gtk/gtkaboutdialog.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 6c1475f1cc..a3457e9243 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -584,7 +584,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
g_param_spec_string ("logo-icon-name",
P_("Logo Icon Name"),
P_("A named icon to use as the logo for the about box."),
- "image-missing",
+ NULL,
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -1731,7 +1731,9 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
*
* Returns the paintable displayed as logo in the about dialog.
*
- * Returns: (transfer none): the paintable displayed as logo. The
+ * Returns: (transfer none) (nullable): the paintable displayed as
+ * logo or %NULL if the logo is unset or has been set via
+ * gtk_about_dialog_set_logo_icon_name(). The
* paintable is owned by the about dialog. If you want to keep a
* reference to it, you have to call g_object_ref() on it.
*/
@@ -1753,9 +1755,7 @@ gtk_about_dialog_get_logo (GtkAboutDialog *about)
* @about: a #GtkAboutDialog
* @logo: (allow-none): a #GdkPaintable, or %NULL
*
- * Sets the surface to be displayed as logo in the about dialog.
- * If it is %NULL, the default window icon set with
- * gtk_window_set_default_icon() will be used.
+ * Sets the logo in the about dialog.
*/
void
gtk_about_dialog_set_logo (GtkAboutDialog *about,
@@ -1764,15 +1764,14 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
GtkAboutDialogPrivate *priv = gtk_about_dialog_get_instance_private (about);
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
- g_return_if_fail (logo == NULL || GDK_IS_TEXTURE (logo));
+ g_return_if_fail (logo == NULL || GDK_IS_PAINTABLE (logo));
g_object_freeze_notify (G_OBJECT (about));
if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME)
g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO_ICON_NAME]);
- if (logo != NULL)
- gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
+ gtk_image_set_from_paintable (GTK_IMAGE (priv->logo_image), logo);
g_object_notify_by_pspec (G_OBJECT (about), props[PROP_LOGO]);
@@ -1785,8 +1784,9 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
*
* Returns the icon name displayed as logo in the about dialog.
*
- * Returns: the icon name displayed as logo. The string is
- * owned by the dialog. If you want to keep a reference
+ * Returns: (transfer none) (nullable): the icon name displayed as logo or %NULL
+ * if the logo has been set via gtk_about_dialog_set_logo().
+ * The string is owned by the dialog. If you want to keep a reference
* to it, you have to call g_strdup() on it.
*/
const gchar *
@@ -1807,9 +1807,7 @@ gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
* @about: a #GtkAboutDialog
* @icon_name: (allow-none): an icon name, or %NULL
*
- * Sets the surface to be displayed as logo in the about dialog.
- * If it is %NULL, the default window icon set with
- * gtk_window_set_default_icon() will be used.
+ * Sets the icon name to be displayed as logo in the about dialog.
*/
void
gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]