Commit 1cd4ae0a authored by Pino Toscano's avatar Pino Toscano

When reloading, properly remember the state of the sidebar.

CCBUG: 151130

svn path=/trunk/KDE/kdegraphics/okular/; revision=731721
parent 2340d9c6
......@@ -914,6 +914,7 @@ void Part::slotDoFileDirty()
// store the current toolbox pane
m_dirtyToolboxIndex = m_sidebar->currentIndex();
m_wasSidebarVisible = m_sidebar->isSidebarVisible();
// store if presentation view was open
m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
......@@ -934,6 +935,10 @@ void Part::slotDoFileDirty()
{
m_sidebar->setCurrentIndex( m_dirtyToolboxIndex );
}
if ( m_sidebar->isSidebarVisible() != m_wasSidebarVisible )
{
m_sidebar->setCurrentIndex( m_sidebar->currentIndex() );
}
if (m_wasPresentationOpen) slotShowPresentation();
emit enablePrintAction(true);
}
......
......@@ -196,6 +196,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
Okular::DocumentViewport m_viewportDirty;
bool m_wasPresentationOpen;
int m_dirtyToolboxIndex;
bool m_wasSidebarVisible;
// Remember the search history
QStringList m_searchHistory;
......
......@@ -510,6 +510,11 @@ void Sidebar::setSidebarVisibility( bool visible )
}
}
bool Sidebar::isSidebarVisible() const
{
return d->sideContainer->isVisible();
}
void Sidebar::itemClicked( QListWidgetItem *item )
{
if ( !item )
......
......@@ -34,6 +34,7 @@ class Sidebar : public QWidget
int currentIndex() const;
void setSidebarVisibility( bool visible );
bool isSidebarVisible() const;
private slots:
void itemClicked( QListWidgetItem *item );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment