]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfilechooserbutton.c
gtk: Clean some includes
[~andy/gtk] / gtk / gtkfilechooserbutton.c
index c12ef917f049808faed3b8465f23d90e86ea7275..f3ede0cf83f6ecb9e3f7c0e21261d097d579d464 100644 (file)
@@ -44,7 +44,7 @@
 #include "gtkliststore.h"
 #include "gtkstock.h"
 #include "gtktreemodelfilter.h"
-#include "gtkvseparator.h"
+#include "gtkseparator.h"
 #include "gtkfilechooserdialog.h"
 #include "gtkfilechooserprivate.h"
 #include "gtkfilechooserutils.h"
 
 #include "gtkfilechooserbutton.h"
 
+#include "gtkorientable.h"
+
 #include "gtktypebuiltins.h"
 #include "gtkprivate.h"
 
+
+/**
+ * SECTION:gtkfilechooserbutton
+ * @Short_description: A button to launch a file selection dialog
+ * @Title: GtkFileChooserButton
+ * @See_also:#GtkFileChooserDialog
+ *
+ * The #GtkFileChooserButton is a widget that lets the user select a
+ * file.  It implements the #GtkFileChooser interface.  Visually, it is a
+ * file name with a button to bring up a #GtkFileChooserDialog.
+ * The user can then use that dialog to change the file associated with
+ * that button.  This widget does not support setting the
+ * #GtkFileChooser:select-multiple property to %TRUE.
+ *
+ * <example>
+ * <title>Create a button to let the user select a file in /etc</title>
+ * <programlisting>
+ * {
+ *   GtkWidget *button;
+ *
+ *   button = gtk_file_chooser_button_new (_("Select a file"),
+ *                                         GTK_FILE_CHOOSER_ACTION_OPEN);
+ *   gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
+ *                                        "/etc");
+ * }
+ * </programlisting>
+ * </example>
+ *
+ * The #GtkFileChooserButton supports the #GtkFileChooserAction<!-- -->s
+ * %GTK_FILE_CHOOSER_ACTION_OPEN and %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
+ *
+ * <important>
+ * The #GtkFileChooserButton will ellipsize the label,
+ * and thus will thus request little horizontal space.  To give the button
+ * more space, you should call gtk_widget_get_preferred_size(),
+ * gtk_file_chooser_button_set_width_chars(), or pack the button in
+ * such a way that other interface elements give space to the widget.
+ * </important>
+ */
+
+
 /* **************** *
  *  Private Macros  *
  * **************** */
@@ -301,7 +344,7 @@ static guint file_chooser_button_signals[LAST_SIGNAL] = { 0 };
  *  GType Declaration  *
  * ******************* */
 
-G_DEFINE_TYPE_WITH_CODE (GtkFileChooserButton, gtk_file_chooser_button, GTK_TYPE_HBOX, { \
+G_DEFINE_TYPE_WITH_CODE (GtkFileChooserButton, gtk_file_chooser_button, GTK_TYPE_BOX, { \
     G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER, gtk_file_chooser_button_file_chooser_iface_init) \
 })
 
@@ -451,7 +494,8 @@ gtk_file_chooser_button_init (GtkFileChooserButton *button)
 
   priv->label = gtk_label_new (_(FALLBACK_DISPLAY_NAME));
   gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
-  gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+  gtk_widget_set_halign (priv->label, GTK_ALIGN_START);
+  gtk_widget_set_valign (priv->label, GTK_ALIGN_CENTER);
   gtk_box_pack_start (GTK_BOX (box), priv->label, TRUE, TRUE, 0);
   //gtk_container_add (GTK_CONTAINER (box), priv->label);
   gtk_widget_show (priv->label);