[frogr] Don't codify information in details dialog's titlebar



commit 3af8e89dfa77084c7582a38f5738a6588804b1c4
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri Apr 22 08:36:17 2011 +0200

    Don't codify information in details dialog's titlebar
    
    Remove the '(n pictures)' string from the titlebar when editing more
    than one picture. Instead, place a label right below the pixbuf.
    
    With GTK3, it's not a good idea to codify information in the titlebar,
    since the titlebar could be not shown at all.

 src/frogr-details-dialog.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/src/frogr-details-dialog.c b/src/frogr-details-dialog.c
index e54fd70..c0127f9 100644
--- a/src/frogr-details-dialog.c
+++ b/src/frogr-details-dialog.c
@@ -62,7 +62,10 @@ typedef struct _FrogrDetailsDialogPrivate {
   GtkWidget *moderate_rb;
   GtkWidget *restricted_rb;
   GtkTextBuffer *text_buffer;
+
   GtkWidget *picture_img;
+  GtkWidget *mpictures_label;
+
   GtkTreeModel *treemodel;
   GSList *pictures;
 } FrogrDetailsDialogPrivate;
@@ -148,6 +151,10 @@ _create_widgets (FrogrDetailsDialog *self)
   gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 6);
   priv->picture_img = widget;
 
+  widget = gtk_label_new (NULL);
+  gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 0);
+  priv->mpictures_label = widget;
+
   /* Visibility */
 
   section_vbox = gtk_vbox_new (FALSE, 6);
@@ -736,11 +743,17 @@ _fill_dialog_with_data (FrogrDetailsDialog *self)
   if (n_pictures > 1)
     {
       GdkPixbuf *pixbuf;
+      gchar *mpictures_str;
 
       /* Set the image for editing multiple pictures */
       pixbuf = gdk_pixbuf_new_from_file (MPICTURES_IMAGE, NULL);
       gtk_image_set_from_pixbuf (GTK_IMAGE (priv->picture_img), pixbuf);
       g_object_unref (pixbuf);
+
+      /* Visually indicate how many pictures are being edited */
+      mpictures_str = g_strdup_printf (_("(%d Pictures)"), n_pictures);
+      gtk_label_set_text (GTK_LABEL (priv->mpictures_label), mpictures_str);
+      g_free (mpictures_str);
     }
   else
     {
@@ -1068,15 +1081,8 @@ void
 frogr_details_dialog_show (GtkWindow *parent, GSList *fpictures, GSList *tags)
 {
   FrogrDetailsDialog *self = NULL;
-  gchar *title = NULL;
-  guint n_pictures = 0;
   GObject *new = NULL;
 
-  n_pictures = g_slist_length (fpictures);
-  title = g_strdup_printf (ngettext ("Edit Picture Details",
-                           "Edit Picture Details (%d Pictures)", n_pictures),
-                           n_pictures);
-
   new = g_object_new (FROGR_TYPE_DETAILS_DIALOG,
                       "modal", TRUE,
                       "pictures", fpictures,
@@ -1084,9 +1090,8 @@ frogr_details_dialog_show (GtkWindow *parent, GSList *fpictures, GSList *tags)
                       "width-request", DIALOG_MIN_WIDTH,
                       "height-request", -1,
                       "resizable", TRUE,
-                      "title", title,
+                      "title", _("Edit Picture Details"),
                       NULL);
-  g_free (title);
 
   self = FROGR_DETAILS_DIALOG (new);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]