In the Contents panel there is a green triangle that's supposed to appear before the current section/chapter. However, it only shows up, when the currently displayed page is the first page of a section, and the section title that is on the current page is visible in the outline view. In my understanding the green marker should show which of the sections currently displayed in the outline contains the currently displayed page. E.g. I'm on page 139, which is the third page of section 4.4.3. Now the outline should show the marker at section 4, if it's collapsed; at 4.4, if it's expanded one level; and at 4.4.3, if it's fully expanded. Currently no marker is shown for any of these cases. I'm using Debian Unstable, I don't know if this has been fixed in newer versions of Okular. Reproducible: Always
Please attach a file and to use and a screenshot showing your problem.
In can confirm this with the current git master. To reproduce just pick any LaTeX-generated file with a toc, e.g.: http://arxiv.org/pdf/1301.2539 Set up okular so that it shows the toc in the left part. The green triangle appears when viewing page one (which contains the chapter heading "1. Introduction". It disappears when scrolling to page 2 (which does not contain a chapter heading). It reappears when scrolling to page 3 which contains the beginning of Chapter 2.
Oliver's link is a good example.
Ah, Oliver description is easier to understand, that's just how it was coded. Besides I don't think what you suggest can be done, nothing in the specification guarantees the Table Of Contents is sorted. What would you do when that happens? And what when the TOC has multiple sublevels? And multiple TOC items pointing to the same page?
If you can generate the TOC tree, and you can jump to specific pages when a TOC element is clicked, you have a sorted representation of the document structure. You just need to find the TOC element that points to the highest page number that is lower or equal than the currently displayed page. Add the marker to that TOC element, if visible, to its parent, if not (use a recursion). If multiple TOC elements point to the same page, select the first one (deterministically).
I disagree, and actually querying the whole TOC tree is quite a bad idea since on big documents it can be veeeeeeeeeeeeeeery slow. But if someone comes up with a patch we can discuss over it.
Created attachment 97055 [details] okular_marker.diff (In reply to Albert Astals Cid from comment #6) > I disagree, and actually querying the whole TOC tree is quite a bad idea > since on big documents it can be veeeeeeeeeeeeeeery slow. > > But if someone comes up with a patch we can discuss over it. Today I noticed that this bug is still open, and I decided to take a look at the code. You worry about querying the whole TOC tree? The current code does exactly that to find the items matching the current page! I came up with the attached patch that half-solves the problem, and doesn't go over the entire TOC tree :) The remaining task is to teach TOCModel::data() to only set KIcon to nodes that either have no children or are not expanded. The latter is a bit difficult, as the model knows nothing about the treeview. I'm open to suggestions.
Please use reviewboard for patches, it's much easier to review them in there
(In reply to Albert Astals Cid from comment #8) > Please use reviewboard for patches, it's much easier to review them in there OK, I did that.
Git commit 1371ccfa28cf777dd04d3f67a1947e41b02dba0d by Albert Astals Cid, on behalf of Miklós Máté. Committed on 21/03/2016 at 23:29. Pushed by aacid into branch 'Applications/16.04'. Show TOC marker for parents if the children is collapsed REVIEWS: 127013 M +59 -12 ui/tocmodel.cpp http://commits.kde.org/okular/1371ccfa28cf777dd04d3f67a1947e41b02dba0d