diff --git a/conf/okular.kcfg b/conf/okular.kcfg --- a/conf/okular.kcfg +++ b/conf/okular.kcfg @@ -204,6 +204,9 @@ true + + true + true diff --git a/part.cpp b/part.cpp --- a/part.cpp +++ b/part.cpp @@ -435,8 +435,10 @@ // ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList ); connect( m_thumbnailList.data(), &ThumbnailList::rightClick, this, &Part::slotShowMenu ); m_sidebar->addItem( thumbsBox, QIcon::fromTheme( QStringLiteral("view-preview") ), i18n("Thumbnails") ); - - m_sidebar->setCurrentItem( thumbsBox ); + + // Setting current item as thumbsBox if the side navigation panel is visible + if ( !Okular::Settings::hideSideContainer() ) + m_sidebar->setCurrentItem( thumbsBox ); // [left toolbox: Reviews] | [] m_reviewsWidget = new Reviews( nullptr, m_document ); @@ -838,6 +840,8 @@ ac->setDefaultShortcut(m_showLeftPanel, QKeySequence(Qt::Key_F7)); m_showLeftPanel->setChecked( Okular::Settings::showLeftPanel() ); slotShowLeftPanel(); + // Displaying the side navigation panel based on the last state + m_sidebar->setCollapsed( Okular::Settings::hideSideContainer() ); m_showBottomBar = ac->add(QStringLiteral("show_bottombar")); m_showBottomBar->setText(i18n( "Show &Page Bar")); @@ -915,6 +919,9 @@ Part::~Part() { + Okular::Settings::setHideSideContainer( m_sidebar->isCollapsed() ); + Okular::Settings::self()->save(); + QDBusConnection::sessionBus().unregisterObject(m_registerDbusName); GuiUtils::removeIconLoader( iconLoader() ); @@ -2150,8 +2157,8 @@ { m_sidebar->setItemEnabled(m_toc, enable); - // If present, show the TOC when a document is opened - if ( enable && m_sidebar->currentItem() != m_toc ) + // If present, show the TOC when a document is opened and side navigation panel is visible + if ( enable && m_sidebar->currentItem() != m_toc && !Okular::Settings::hideSideContainer() ) { m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed ); }