After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706024 - gtk file chooser dialog stretches out on long file name
gtk file chooser dialog stretches out on long file name
Status: RESOLVED DUPLICATE of bug 722211
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2013-08-14 20:15 UTC by Ritesh Khadgaray ( irc:ritz)
Modified: 2014-01-14 23:09 UTC
See Also:
GNOME target: ---
GNOME version: 3.9/3.10


Attachments
screenshot of the issue (50.03 KB, image/png)
2013-08-14 20:15 UTC, Ritesh Khadgaray ( irc:ritz)
Details

Description Ritesh Khadgaray ( irc:ritz) 2013-08-14 20:15:25 UTC
Created attachment 251650 [details]
screenshot of the issue

The screen size is not taken into account, while trying to identify the size of the label .  Not sure, if this is the ideal solution . 

from gtk/gtkpathbar.c

@@ -1519,7 +1523,7 @@ set_label_size_request (GtkWidget  *widg
 {
   const gchar *dir_name = get_dir_name (button_data);
   PangoLayout *layout = gtk_widget_create_pango_layout (button_data->label, dir_name);
-  gint width, height, bold_width, bold_height;
+  gint width, height, screen_width, bold_width, bold_height;
   gchar *markup;
   
   pango_layout_get_pixel_size (layout, &width, &height);
@@ -1530,8 +1534,10 @@ set_label_size_request (GtkWidget  *widg
 
   pango_layout_get_pixel_size (layout, &bold_width, &bold_height);
 
+  screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget)) * 0.7;
+ 
   gtk_widget_set_size_request (widget,
-                              MAX (width, bold_width),
+                              MIN (MAX (width, bold_width),screen_width),
                               MAX (height, bold_height));
   g_object_unref (layout);
 }
Comment 1 André Klapper 2013-08-15 08:20:38 UTC
Which GTK+ version is this about ("Version" field)?
Comment 2 Timothy Arceri 2013-09-15 22:39:24 UTC
Please see: https://live.gnome.org/GnomeLove/SubmittingPatches for information on how to submit a patch.
Comment 3 Ritesh Khadgaray ( irc:ritz) 2013-10-08 21:36:51 UTC
The bug is still seen with git head.

__self:

code path changed by 

commit 68b34b1bbad9a3940ee0040d264ba4169a98fa26
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Sat Aug 31 17:20:50 2013 -0400

    GtkPathBar: Don't make current dir bold
    
    This is closer to the nautilus path bar.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706451
Comment 4 William Jon McCann 2014-01-14 23:09:10 UTC

*** This bug has been marked as a duplicate of bug 722211 ***