]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfontsel.c
gtk: remove "gboolean homogeneous" from gtk_box_new()
[~andy/gtk] / gtk / gtkfontsel.c
index f1a509cab162b96ad540b7aa7b600052e0e0f1e7..e73b4ba426fafa63f5e1c91add8abde49744a72e 100644 (file)
@@ -58,8 +58,8 @@
 #include "gtkscrolledwindow.h"
 #include "gtkintl.h"
 #include "gtkaccessible.h"
-#include "gtkprivate.h"
 #include "gtkbuildable.h"
+#include "gtkprivate.h"
 
 struct _GtkFontSelectionPrivate
 {
@@ -548,10 +548,9 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
           atk_relation_set_add (relation_set, relation);
         }
       g_object_unref (relation_set);
-    }    
-      
+    }
 
-  vbox = gtk_vbox_new (FALSE, 6);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
   gtk_widget_show (vbox);
   gtk_box_pack_start (GTK_BOX (fontsel), vbox, FALSE, TRUE, 0);
   
@@ -560,8 +559,8 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_widget_show (label);
   gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
-  
-  text_box = gtk_hbox_new (FALSE, 0);
+
+  text_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_widget_show (text_box);
   gtk_box_pack_start (GTK_BOX (vbox), text_box, FALSE, TRUE, 0);
   
@@ -1168,22 +1167,22 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
   GtkFontSelectionPrivate *priv = fontsel->priv;
   GtkRcStyle *rc_style;
   gint new_height;
-  GtkRequisition old_requisition;
+  GtkRequisition old_requisition, new_requisition;
   GtkWidget *preview_entry = priv->preview_entry;
   const gchar *text;
 
-  gtk_widget_get_child_requisition (preview_entry, &old_requisition);
-  
+  gtk_widget_get_preferred_size (preview_entry, &old_requisition, NULL);
+
   rc_style = gtk_rc_style_new ();
   rc_style->font_desc = gtk_font_selection_get_font_description (fontsel);
   
   gtk_widget_modify_style (preview_entry, rc_style);
   g_object_unref (rc_style);
 
-  gtk_widget_size_request (preview_entry, NULL);
+  gtk_widget_get_preferred_size (preview_entry, &new_requisition, NULL);
   
   /* We don't ever want to be over MAX_PREVIEW_HEIGHT pixels high. */
-  new_height = CLAMP (preview_entry->requisition.height, INITIAL_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT);
+  new_height = CLAMP (new_requisition.height, INITIAL_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT);
 
   if (new_height > old_requisition.height || new_height < old_requisition.height - 30)
     gtk_widget_set_size_request (preview_entry, -1, new_height);
@@ -1206,8 +1205,8 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
  *
  * This returns the #GtkTreeView that lists font families, for
  * example, 'Sans', 'Serif', etc.
- * 
- * Return value: A #GtkWidget that is part of @fontsel
+ *
+ * Return value: (transfer none): A #GtkWidget that is part of @fontsel
  *
  * Since: 2.14
  */
@@ -1226,7 +1225,7 @@ gtk_font_selection_get_family_list (GtkFontSelection *fontsel)
  * This returns the #GtkTreeView which lists all styles available for
  * the selected font. For example, 'Regular', 'Bold', etc.
  * 
- * Return value: A #GtkWidget that is part of @fontsel
+ * Return value: (transfer none): A #GtkWidget that is part of @fontsel
  *
  * Since: 2.14
  */
@@ -1243,9 +1242,9 @@ gtk_font_selection_get_face_list (GtkFontSelection *fontsel)
  * @fontsel: a #GtkFontSelection
  *
  * This returns the #GtkEntry used to allow the user to edit the font
- * number manually instead of selecting it from the list of font sizes. 
- * 
- * Return value: A #GtkWidget that is part of @fontsel
+ * number manually instead of selecting it from the list of font sizes.
+ *
+ * Return value: (transfer none): A #GtkWidget that is part of @fontsel
  *
  * Since: 2.14
  */
@@ -1261,9 +1260,9 @@ gtk_font_selection_get_size_entry (GtkFontSelection *fontsel)
  * gtk_font_selection_get_size_list:
  * @fontsel: a #GtkFontSelection
  *
- * This returns the #GtkTreeeView used to list font sizes. 
- * 
- * Return value: A #GtkWidget that is part of @fontsel
+ * This returns the #GtkTreeeView used to list font sizes.
+ *
+ * Return value: (transfer none): A #GtkWidget that is part of @fontsel
  *
  * Since: 2.14
  */
@@ -1278,10 +1277,10 @@ gtk_font_selection_get_size_list (GtkFontSelection *fontsel)
 /**
  * gtk_font_selection_get_preview_entry:
  * @fontsel: a #GtkFontSelection
- * 
+ *
  * This returns the #GtkEntry used to display the font as a preview.
  *
- * Return value: A #GtkWidget that is part of @fontsel
+ * Return value: (transfer none): A #GtkWidget that is part of @fontsel
  *
  * Since: 2.14
  */
@@ -1296,13 +1295,13 @@ gtk_font_selection_get_preview_entry (GtkFontSelection *fontsel)
 /**
  * gtk_font_selection_get_family:
  * @fontsel: a #GtkFontSelection
- * 
+ *
  * Gets the #PangoFontFamily representing the selected font family.
  *
- * Return value: A #PangoFontFamily representing the selected font
- *     family. Font families are a collection of font faces. The 
- *     returned object is owned by @fontsel and must not be modified 
- *     or freed.
+ * Return value: (transfer none): A #PangoFontFamily representing the
+ *     selected font family. Font families are a collection of font
+ *     faces. The returned object is owned by @fontsel and must not
+ *     be modified or freed.
  *
  * Since: 2.14
  */
@@ -1317,13 +1316,13 @@ gtk_font_selection_get_family (GtkFontSelection *fontsel)
 /**
  * gtk_font_selection_get_face:
  * @fontsel: a #GtkFontSelection
- * 
+ *
  * Gets the #PangoFontFace representing the selected font group
- * details (i.e. family, slant, weight, width, etc).   
+ * details (i.e. family, slant, weight, width, etc).
  *
- * Return value: A #PangoFontFace representing the selected font 
- *     group details. The returned object is owned by @fontsel and
- *     must not be modified or freed. 
+ * Return value: (transfer none): A #PangoFontFace representing the
+ *     selected font group details. The returned object is owned by
+ *     @fontsel and must not be modified or freed.
  *
  * Since: 2.14
  */
@@ -1338,10 +1337,10 @@ gtk_font_selection_get_face (GtkFontSelection *fontsel)
 /**
  * gtk_font_selection_get_size:
  * @fontsel: a #GtkFontSelection
- * 
+ *
  * The selected font size.
  *
- * Return value: A n integer representing the selected font size, 
+ * Return value: A n integer representing the selected font size,
  *     or -1 if no font size is selected.
  *
  * Since: 2.14
@@ -1618,7 +1617,6 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
   content_area = gtk_dialog_get_content_area (dialog);
   action_area = gtk_dialog_get_action_area (dialog);
 
-  gtk_dialog_set_has_separator (dialog, FALSE);
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
   gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
   gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
@@ -1660,8 +1658,6 @@ gtk_font_selection_dialog_init (GtkFontSelectionDialog *fontseldiag)
                         _("Font Selection"));
 
   gtk_widget_pop_composite_child ();
-
-  _gtk_dialog_set_ignore_separator (dialog, TRUE);
 }
 
 /**
@@ -1687,11 +1683,11 @@ gtk_font_selection_dialog_new (const gchar *title)
 
 /**
  * gtk_font_selection_dialog_get_font_selection:
- * @colorsel: a #GtkFontSelectionDialog
+ * @fsd: a #GtkFontSelectionDialog
  *
  * Retrieves the #GtkFontSelection widget embedded in the dialog.
  *
- * Returns: the embedded #GtkFontSelection
+ * Returns: (transfer none): the embedded #GtkFontSelection
  *
  * Since: 2.22
  **/
@@ -1710,7 +1706,8 @@ gtk_font_selection_dialog_get_font_selection (GtkFontSelectionDialog *fsd)
  *
  * Gets the 'OK' button.
  *
- * Return value: the #GtkWidget used in the dialog for the 'OK' button.
+ * Return value: (transfer none): the #GtkWidget used in the dialog
+ *     for the 'OK' button.
  *
  * Since: 2.14
  */
@@ -1728,7 +1725,8 @@ gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd)
  *
  * Gets the 'Cancel' button.
  *
- * Return value: the #GtkWidget used in the dialog for the 'Cancel' button.
+ * Return value: (transfer none): the #GtkWidget used in the dialog
+ *     for the 'Cancel' button.
  *
  * Since: 2.14
  */