* Fixed NB#80996, resized the rename folder dialog to allow pt_BR strings to fit...
authorSergio Villar Senin <svillar@igalia.com>
Tue, 4 Mar 2008 19:08:06 +0000 (19:08 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 4 Mar 2008 19:08:06 +0000 (19:08 +0000)
* The entry is now properly resized and fills the dialog if the original folder name is too short

pmo-trunk-r4277

src/maemo/modest-platform.c

index 220ff7d..53fbd75 100644 (file)
@@ -838,7 +838,8 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window,
        else
                gtk_entry_set_text (GTK_ENTRY (entry), _("mcen_ia_default_folder_name"));
        gtk_entry_set_width_chars (GTK_ENTRY (entry),
        else
                gtk_entry_set_text (GTK_ENTRY (entry), _("mcen_ia_default_folder_name"));
        gtk_entry_set_width_chars (GTK_ENTRY (entry),
-                                  g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (entry)), -1));
+                                  MAX (g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (entry)), -1),
+                                       g_utf8_strlen (_("mcen_ia_default_folder_name"), -1)));
        gtk_entry_select_region (GTK_ENTRY (entry), 0, -1);
 
        /* Connect to the response method to avoid closing the dialog
        gtk_entry_select_region (GTK_ENTRY (entry), 0, -1);
 
        /* Connect to the response method to avoid closing the dialog
@@ -861,15 +862,19 @@ modest_platform_run_folder_name_dialog (GtkWindow *parent_window,
        /* Create the hbox */
        hbox = gtk_hbox_new (FALSE, 12);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
        /* Create the hbox */
        hbox = gtk_hbox_new (FALSE, 12);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
-       gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
 
        /* Add hbox to dialog */
        gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), 
                            hbox, FALSE, FALSE, 0);
 
        /* Add hbox to dialog */
        gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), 
                            hbox, FALSE, FALSE, 0);
-       
+
        gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
        gtk_window_set_transient_for (GTK_WINDOW (dialog), parent_window);
        gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
        gtk_window_set_transient_for (GTK_WINDOW (dialog), parent_window);
-       
+
+       /* Some locales like pt_BR need this to get the full window
+          title shown */
+       gtk_widget_set_size_request (GTK_WIDGET (dialog), 300, -1);
+               
        result = gtk_dialog_run (GTK_DIALOG(dialog));
        if (result == GTK_RESPONSE_ACCEPT)
                *folder_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
        result = gtk_dialog_run (GTK_DIALOG(dialog));
        if (result == GTK_RESPONSE_ACCEPT)
                *folder_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));