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 708711 - 'Unsaved documents' dialogs document list too narrow, shows only two entries
'Unsaved documents' dialogs document list too narrow, shows only two entries
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-25 05:36 UTC by Vadim Peretokin
Modified: 2013-11-03 16:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Unsaved documents dialog (25.42 KB, image/png)
2013-09-25 05:36 UTC, Vadim Peretokin
  Details
CloseConfirmationDialog: UI improvements (2.64 KB, patch)
2013-11-03 15:26 UTC, Sébastien Wilmet
none Details | Review
CloseConfirmationDialog: UI improvements (3.54 KB, patch)
2013-11-03 16:37 UTC, Sébastien Wilmet
none Details | Review

Description Vadim Peretokin 2013-09-25 05:36:11 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'.
Comment 1 Vadim Peretokin 2013-09-25 05:36:59 UTC
Created attachment 255658 [details]
Unsaved documents dialog
Comment 2 Sébastien Wilmet 2013-11-01 20:29:29 UTC
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).
Comment 3 Sébastien Wilmet 2013-11-03 15:26:59 UTC
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...).
Comment 4 Paolo Borelli 2013-11-03 16:00:26 UTC
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?
Comment 5 Sébastien Wilmet 2013-11-03 16:37:52 UTC
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...).
Comment 6 Sébastien Wilmet 2013-11-03 16:40:16 UTC
(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.
Comment 7 Sébastien Wilmet 2013-11-03 16:48:51 UTC
Commit pushed.