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 660113 - hard to use with excessive page "number" length
hard to use with excessive page "number" length
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
2.32.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-26 09:55 UTC by Johannes Berg
Modified: 2012-10-06 09:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot showing the problem (44.33 KB, image/png)
2011-09-26 09:56 UTC, Johannes Berg
  Details
(bad) mockup of how it would be nicer (57.52 KB, image/png)
2011-09-26 10:17 UTC, Johannes Berg
  Details
Screenshot to show the bug with long page number in the index (32.67 KB, image/png)
2012-10-06 04:05 UTC, Germán Poo-Caamaño
  Details
Set a max widht for page number (1.41 KB, patch)
2012-10-06 04:09 UTC, Germán Poo-Caamaño
accepted-commit_now Details | Review
Screenshot with the fix proposed (47.66 KB, image/png)
2012-10-06 04:10 UTC, Germán Poo-Caamaño
  Details

Description Johannes Berg 2011-09-26 09:55:36 UTC
See screenshot.

I just downloaded 802.11v-2011 from the getieee 802.11 program, and the cover page has the page "number" listed as "IEEE Std 802.11v-2011 front cover". This makes the TOC really hard to use, and there's no way to indicate that I don't care about truncating page numbers in the TOC.

Maybe a good way to solve this would be to right-align the page numbers and allow the section titles to flow over (see attached mockup).
Comment 1 Johannes Berg 2011-09-26 09:56:17 UTC
Created attachment 197456 [details]
screenshot showing the problem
Comment 2 Johannes Berg 2011-09-26 10:17:16 UTC
Created attachment 197457 [details]
(bad) mockup of how it would be nicer

Ok so I didn't do the alignment completely, but it'd be much more usable this way.
Comment 3 Germán Poo-Caamaño 2012-10-06 04:05:13 UTC
Created attachment 225921 [details]
Screenshot to show the bug with long page number in the index
Comment 4 Germán Poo-Caamaño 2012-10-06 04:09:19 UTC
Created attachment 225922 [details] [review]
Set a max widht for page number

This patch set ellipsize to page numbers in the index and set a max width of 12 characters.

5 characters width should be long enough for numbers between 0 to 99999. However, some documents can have 'cover', 'front', 'back'.  12 is long enough to have a long text and still guess the content.

Page numbers are important, but without the text in the TOC they become useless.
Comment 5 Germán Poo-Caamaño 2012-10-06 04:10:08 UTC
Created attachment 225923 [details]
Screenshot with the fix proposed

This is how it looks after applying the patch.
Comment 6 Johannes Berg 2012-10-06 06:58:20 UTC
Nice, thanks.

I think it'd be still better if the two columns didn't have to be completely separate like in my mockup, so that in your screenshot "Normative references" could still be spelled out completely since there's plenty of space to the "3".

I do understand however that making variable-width columns isn't possible (I think?) with the GTK treeview (?) and to implement it you'd have to render both into a single column which might be tricky with alignment. (Although, maybe you can put an hbox & two labels into each cell? I don't really know the programming model well enough to comment on that...)

Anyway, this is a HUGE improvement, in particular for this document, but I suspect it won't be the only one. I haven't run into this bug as much since the -2012 version of the 802.11 spec got rid of the extra long page name, now just calling it "Cover-front". I guess they ran into the same bug in some other viewers :-)

Thanks!
Comment 7 Germán Poo-Caamaño 2012-10-06 07:32:05 UTC
(In reply to comment #6)
> Nice, thanks.
> 
> I think it'd be still better if the two columns didn't have to be completely
> separate like in my mockup, so that in your screenshot "Normative references"
> could still be spelled out completely since there's plenty of space to the "3".
> 
> I do understand however that making variable-width columns isn't possible (I
> think?) with the GTK treeview (?) and to implement it you'd have to render both
> into a single column which might be tricky with alignment. (Although, maybe you
> can put an hbox & two labels into each cell? I don't really know the
> programming model well enough to comment on that...)

I wonder how necessary is the page number after all.

In a paper book it makes sense the page number, because the reader has to go manually to the page.  However, in a PDF reader it is only necessary to select the topic/index/whatever and the PDF reader go directly to the page.
Comment 8 Carlos Garcia Campos 2012-10-06 08:09:14 UTC
Review of attachment 225922 [details] [review]:

Excellent! thanks.
Comment 9 Carlos Garcia Campos 2012-10-06 08:11:11 UTC
(In reply to comment #6)
> Nice, thanks.
> 
> I think it'd be still better if the two columns didn't have to be completely
> separate like in my mockup, so that in your screenshot "Normative references"
> could still be spelled out completely since there's plenty of space to the "3".
> 
> I do understand however that making variable-width columns isn't possible (I
> think?) with the GTK treeview (?) and to implement it you'd have to render both
> into a single column which might be tricky with alignment. (Although, maybe you
> can put an hbox & two labels into each cell? I don't really know the
> programming model well enough to comment on that...)
> 

Yes, I agree we could try to improve it using a custom cell layout or something. For now, let's commit this patch that already improves the result a lot, and then let's try to make it even better :-)
Comment 10 Germán Poo-Caamaño 2012-10-06 09:26:18 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 11 Germán Poo-Caamaño 2012-10-06 09:27:30 UTC
I forgot to add the commit id:
http://git.gnome.org/browse/evince/commit/?id=36d7e9ec3306b48803787d1d1ed79756677b93dd