[Okular-devel] The TOC when the sidebar is hidden

Albert Astals Cid aacid at kde.org
Wed Feb 3 21:03:42 CET 2010


A Dimecres, 3 de febrer de 2010, vàreu escriure:
> On 3 February 2010 03:01,  <okular-devel-request at kde.org> wrote:
> > From: Albert Astals Cid <aacid at kde.org>
> > Subject: .
> > To: Okular development <okular-devel at kde.org>
> > Message-ID: <201002030841.32345.aacid at kde.org>
> > Content-Type: Text/Plain;  charset="us-ascii"
> >
> > A Dimecres, 3 de febrer de 2010, Kelvie Wong va escriure:
> >> On 2 February 2010 19:40, Kelvie Wong <kelvie at ieee.org> wrote:
> >> > Greetings.
> >> >
> >> > I would like to make a commit that makes it so that the TOC (on
> >> > documents that have them) only shows up _iff_ the sidebar is showing.
> >> >
> >> > The logic here is that the TOC is part of the sidebar, and it is
> >> > unnatural (and a pain to close) to have the TOC open when the sidebar
> >> > is not visible.
> >> >
> >> > Thanks,
> >> > --
> >> > Kelvie Wong
> >>
> >> Ah, sorry, I forgot to include the actual message.  Is it OK if I make
> >> such a commit?
> >
> > Hi Kelvie, before commiting i'd like you to explain how do you get to
> > that situation and to show us the patch.
> >
> > Thanks for working in Okular.
> >
> > Albert
> 
> I was thinking something like this:
> 
> From a6f15a67323fdafefd91817efcc8159a76c1d7bc Mon Sep 17 00:00:00 2001
> From: Kelvie Wong <kelvie at ieee.org>
> Date: Tue, 2 Feb 2010 19:34:24 -0800
> Subject: [PATCH] Only show the TOC if the sidebar is visible.
> 
> This is _really_ annoying for users that have the side bar turned off on
> documents with a TOC, especially on space-constrained settings.
> 
> One has to show the sidebar, click on the "Contents" button to hide the
>  TOC, then re-hide the sidebar to get it to the state where just the PDF is
>  showing.
> 
> It is also unnatural to have the TOC showing without the sidebar, as the
>  TOC is part of the sidebar.
> 
> Alternatively, this may be implemented in the Sidebar code, where setting
>  the current index while hidden does not cause it to appear.
> ---
>  okular/part.cpp |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/okular/part.cpp b/okular/part.cpp
> index 5431d3d..6e520e2 100644
> --- a/okular/part.cpp
> +++ b/okular/part.cpp
> @@ -990,7 +990,7 @@ bool Part::openFile()
>      }
> 
>      // if the 'OpenTOC' flag is set, open the TOC
> -    if ( m_document->metaData( "OpenTOC" ).toBool() &&
> m_sidebar->isItemEnabled( 0 ) )
> +    if ( m_document->metaData( "OpenTOC" ).toBool() &&
> m_sidebar->isItemEnabled( 0 ) && m_sidebar->isSidebarVisible() )
>      {
>          m_sidebar->setCurrentIndex( 0 );
>      }
> --
> 1.6.6.1
> 

Hmm, i disagree with this approach, if the PDF asked the TOC to be open we 
should open it, if the sidebar was hidden it needs to be shown too to not get 
that weird behaviour you mention

Albert



More information about the Okular-devel mailing list