Bug 147233

Summary: no horizontal scroll bar in table of contents sidebar
Product: [Applications] kpdf Reporter: Leo Savernik <l.savernik>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED FIXED    
Severity: normal CC: gerda.shank, LLLActive
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: current accessibility issue
patch

Description Leo Savernik 2007-06-26 11:19:03 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Compiled From Sources

PDFs with deeply nested tables of contents are not fully accessible in the contents sidebar as it provides no horizontal scrollbar on small window widths.

This leads to a chapter's sections being cut off instead of horizontally scrollable at a 120px sidebar width.

Steps to reproduce.
1. Load a document with an elaborate table of contents. I used http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf
2. Reduce sidebar width to ~120px

Expected results:
A horizontal scrollbar appears, allowing me to center on the subsection list of a chapter

Actual results:
No horizontal scrollbar appears, subsection titles are cut off.
Comment 1 Leo Savernik 2007-06-26 11:22:21 UTC
Created attachment 20967 [details]
current accessibility issue

Table of contents exhibiting the issue. Note that entries are cut off insteasd
of providing a horizontal scrollbar.
Comment 2 Leo Savernik 2007-06-26 17:38:34 UTC
Created attachment 20973 [details]
patch

Patch fixing the bug.

Please review and commit before 3.5.8 or let me commit it.
Comment 3 Albert Astals Cid 2007-06-26 22:41:48 UTC
Hi Leo, we already provide a Tooltip for TOC items that don't fit in the TOC width, but if you think your patch is better please go ahead.
Comment 4 Pino Toscano 2007-06-26 22:47:03 UTC
What about enabling directly the horizontal scrollbar of the TOC, instead of using a dummy widget?
Comment 5 Leo Savernik 2007-06-27 10:38:25 UTC
@ comment 4: Been there, done that. The scrollbar will stretch beyond the visible viewport (seems to be an issue with QToolBox).
Comment 6 Leo Savernik 2007-06-27 10:40:54 UTC
SVN commit 680874 by savernik:

Provide horizontal scrollbar in table of contents sidebar instead of
cropping the entries. This improves usability esp. for deeply nested TOCs.

BUG: 147233


 M  +6 -2      part.cpp  
 M  +2 -1      ui/toc.cpp  


--- branches/KDE/3.5/kdegraphics/kpdf/part.cpp #680873:680874
@@ -186,9 +186,13 @@
 
 	int index;
 	// [left toolbox: Table of Contents] | []
-	m_tocFrame = new TOC( m_toolBox, m_document );
+	// dummy wrapper with layout to enable horizontal scroll bars (bug: 147233)
+	QWidget *tocWrapper = new QWidget(m_toolBox);
+	QVBoxLayout *tocWrapperLayout = new QVBoxLayout(tocWrapper);
+	m_tocFrame = new TOC( tocWrapper, m_document );
+	tocWrapperLayout->add(m_tocFrame);
 	connect(m_tocFrame, SIGNAL(hasTOC(bool)), this, SLOT(enableTOC(bool)));
-	index = m_toolBox->addItem( m_tocFrame, QIconSet(SmallIcon("text_left")), i18n("Contents") );
+	index = m_toolBox->addItem( tocWrapper, QIconSet(SmallIcon("text_left")), i18n("Contents") );
 	m_toolBox->setItemToolTip(index, i18n("Contents"));
 	enableTOC( false );
 
--- branches/KDE/3.5/kdegraphics/kpdf/ui/toc.cpp #680873:680874
@@ -64,7 +64,8 @@
 #endif
     setSorting(-1);
     setRootIsDecorated(true);
-    setResizeMode(AllColumns);
+    // the next line causes bug:147233
+//    setResizeMode(AllColumns);
     setAllColumnsShowFocus(true);
     connect(this, SIGNAL(clicked(QListViewItem *)), this, SLOT(slotExecuted(QListViewItem *)));
     connect(this, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(slotExecuted(QListViewItem *)));
Comment 7 Albert Astals Cid 2007-08-26 20:06:25 UTC
*** Bug 149239 has been marked as a duplicate of this bug. ***
Comment 8 LandoSr 2009-08-22 03:42:29 UTC
(KPDF: 0.5.10 (using KDE 3.5.10 "release 21.11" openSUSE)
(Okular: Version 0.7.3 Using KDE 4.1.3 (KDE 4.1.3) "release 4.10.4")

Hi, it has been a while since this bug. I find the limited sizing of the left pane _with scrollbar_ very irritating (also in Okular). Hovering over the TOC entry does not show the whole entry in my openSUSE 11.1 64 Bit System, on which Okular does show the hover. 

Why can the two panes not be varied without limits for either the TOC or the main displayed PDF?