GNOME Bugzilla – Bug 708711
'Unsaved documents' dialogs document list too narrow, shows only two entries
Last modified: 2013-11-03 16:48:51 UTC
The 'Unsaved documents' dialog does not size by default to a reasonable document list, and it does not allow you to resize it either. The result is that when viewing through the document list it presents, you can at maximum see 1 document name in full. It is fairly inconvenient to be looking at the list through that small 'slit'.
Created attachment 255658 [details] Unsaved documents dialog
On my system gedit can display a little more than 2 documents. But the dialog window is not resizable. So I confirm, it would be better to be able to resize the dialog window, and set a maximum height higher than 2 documents (show the scrollbars only with > 5 documents for example).
Created attachment 258857 [details] [review] CloseConfirmationDialog: UI improvements The dialog is now resizable. It is useful when the list of unsaved documents is long, and we want to show all of them. The scrolled window around the tree view has a greater minimum height, so by default more documents can be shown. The vbox2 must have the expand and fill properties to true (with gtk_box_pack_start()), so the treeview expands when the dialog window is resized. (and the policy for a scrolled window is "automatic" by default in GTK+ 3) It would have been better to have (1) natural height if below N (2) scrolled window if above N. With N at a treeview row boundary. But it is not easily feasible with gtk+ afaik (in gtksourceview we use a custom container for that...).
Review of attachment 258857 [details] [review]: ::: gedit/gedit-close-confirmation-dialog.c @@ -135,3 @@ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), 14); - gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE); what about something like: set_resizable (dlg, mode == MULTI) ? @@ -710,2 +706,3 @@ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_SHADOW_IN); + gtk_widget_set_size_request (scrolledwindow, -1, 60); should we use scrolled_window_set_min_content_height instead?
Created attachment 258864 [details] [review] CloseConfirmationDialog: UI improvements The dialog is now resizable on multi mode. It is useful when the list of unsaved documents is long, and we want to show all of them. The scrolled window around the tree view has a greater minimum height, so by default more documents can be shown. The vbox2 must have the expand and fill properties to true (with gtk_box_pack_start()), so the treeview expands when the dialog window is resized. The size request of the tree view is removed, since it has no effect inside a scrolled window (but it's maybe a bug in gtk, I just get used to work around the problem, and set the size on the scrolled window instead). (and the policy for a scrolled window is "automatic" by default in GTK+ 3) It would have been better to have (1) natural height if below N (2) scrolled window if above N. With N at a treeview row boundary. But it is not easily feasible with gtk+ afaik (in gtksourceview we use a custom container for that...).
(In reply to comment #4) > what about something like: set_resizable (dlg, mode == MULTI) ? At this place, we don't know the mode, so I moved the set_resizable() in the function for the single doc mode. > + gtk_widget_set_size_request (scrolledwindow, -1, 60); > > should we use scrolled_window_set_min_content_height instead? I didn't know this function, but I don't know what is the difference. It behaves similarly.
Commit pushed.