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 778000 - Sidebar: thumbnails in two columns if i18n or font size to big
Sidebar: thumbnails in two columns if i18n or font size to big
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-31 20:10 UTC by lof
Modified: 2017-12-02 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ev-sidebar-bookmarks: Remove "Delete" button from bookmarks section (3.04 KB, patch)
2017-11-26 13:35 UTC, Nelson Benitez
none Details | Review
sidebar: allow to shrink the sidebar more (3.43 KB, patch)
2017-12-01 14:19 UTC, Nelson Benitez
committed Details | Review

Description lof 2017-01-31 20:10:04 UTC
Problem: 

Under certain conditions the thumbnail view always shows two pages in a row/two columns. This means the user has less space for the PDF if he/she wishes to display thumbnails.

How to reproduce:

Choose locale with long words (e.g. German) or / and set font size higher. E.g. 17 for English.

Try to reduce the width of the sidebar and fail.


Here a  video from a reddit thread:  https://vid.me/HoFT
Comment 1 Nelson Benitez 2017-11-26 13:09:09 UTC
Yes, the problem is the "Add" and "Delete" buttons on the Bookmarks section of the sidebar, they don't let the sidebar to shrink more.. locales where the labels of these buttons are more verbose (like in German) show more wasted space.. this video shows the problem:

https://vid.me/hOwqA

I will attach a patch that solves this by removing the "Delete" button, as imo it's not needed because bookmarks already have a "Delete bookmark" action on their right click popup menu.
Comment 2 Nelson Benitez 2017-11-26 13:35:27 UTC
Created attachment 364439 [details] [review]
ev-sidebar-bookmarks: Remove "Delete" button from bookmarks section

As bookmarks can already be deleted from an specific popup menu
action and the "Delete" and "Add" buttons were preventing the
sidebar to shrink past them.

-------

After that, the limit is now on the "Thumbnails" label + Close button, but the situation has improved and now is more difficult that a verbose locale plus bigger font triggers a double column thumbnail view.
Comment 3 Germán Poo-Caamaño 2017-11-26 19:04:50 UTC
What about the symbols '+' and '-' instead?

I have not checked if that has been discussed in the past.
Comment 4 Nelson Benitez 2017-12-01 13:27:59 UTC
(In reply to Germán Poo-Caamaño from comment #3)
> What about the symbols '+' and '-' instead?
> 
> I have not checked if that has been discussed in the past.

Good idea too, I'm attaching a patch using '+' and '-' plus setting the label of sidebar toggle button to be ellipsizable, this makes it possible to shrink the sidebar to the limit of the thumbnail width, so giving the user the option to having more space for the document view.


Like this (video of patch applied):

https://vid.me/vnKbh
Comment 5 Nelson Benitez 2017-12-01 14:19:06 UTC
Created attachment 364760 [details] [review]
sidebar: allow to shrink the sidebar more

so we can give more space to the document view, and
also because sidebar minimum width was too much in
verbose locales (because of bookmark button labels)
which was almost causing it to switch to a two
columns layout.

Fixed by:

 - Switching the bookmarks section button labels
   from "Add" and "Remove" to be "+" and "-" along
   with corresponding tooltip and accesible names.

 - Set the label of the main sidebar toggle button
   to be ellipsizable, so the sidebar can be resized
   to reduce width even more.
Comment 6 Nelson Benitez 2017-12-01 14:53:41 UTC
(In reply to Nelson Benitez from comment #5)
> Created attachment 364760 [details] [review] [review]
> sidebar: allow to shrink the sidebar more
> 

I forgot to explain the change from GtkButtonBox to GtkBox in the patch, that is because GtkButtonBox didn't let shrink past its required min width, and the reason we were using GtkButtonBox in the first place was because it gave the buttons an homogeneous size, which we now don't need as '+' and '-' are the same length.
Comment 7 Carlos Garcia Campos 2017-12-02 09:03:30 UTC
Review of attachment 364760 [details] [review]:

Excellent
Comment 8 Nelson Benitez 2017-12-02 13:26:25 UTC
(In reply to Carlos Garcia Campos from comment #7)
> Review of attachment 364760 [details] [review] [review]:
> 
> Excellent

Pushed as commit 93164eb52bc51b4cef9d476f1de9419b8a035e1c

Thank you!