mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
When reloading, properly remember the state of the sidebar.
CCBUG: 151130 svn path=/trunk/KDE/kdegraphics/okular/; revision=731721
This commit is contained in:
parent
2340d9c6d8
commit
1cd4ae0a3e
5
part.cpp
5
part.cpp
|
@ -914,6 +914,7 @@ void Part::slotDoFileDirty()
|
||||||
|
|
||||||
// store the current toolbox pane
|
// store the current toolbox pane
|
||||||
m_dirtyToolboxIndex = m_sidebar->currentIndex();
|
m_dirtyToolboxIndex = m_sidebar->currentIndex();
|
||||||
|
m_wasSidebarVisible = m_sidebar->isSidebarVisible();
|
||||||
|
|
||||||
// store if presentation view was open
|
// store if presentation view was open
|
||||||
m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
|
m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
|
||||||
|
@ -934,6 +935,10 @@ void Part::slotDoFileDirty()
|
||||||
{
|
{
|
||||||
m_sidebar->setCurrentIndex( m_dirtyToolboxIndex );
|
m_sidebar->setCurrentIndex( m_dirtyToolboxIndex );
|
||||||
}
|
}
|
||||||
|
if ( m_sidebar->isSidebarVisible() != m_wasSidebarVisible )
|
||||||
|
{
|
||||||
|
m_sidebar->setCurrentIndex( m_sidebar->currentIndex() );
|
||||||
|
}
|
||||||
if (m_wasPresentationOpen) slotShowPresentation();
|
if (m_wasPresentationOpen) slotShowPresentation();
|
||||||
emit enablePrintAction(true);
|
emit enablePrintAction(true);
|
||||||
}
|
}
|
||||||
|
|
1
part.h
1
part.h
|
@ -196,6 +196,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
|
||||||
Okular::DocumentViewport m_viewportDirty;
|
Okular::DocumentViewport m_viewportDirty;
|
||||||
bool m_wasPresentationOpen;
|
bool m_wasPresentationOpen;
|
||||||
int m_dirtyToolboxIndex;
|
int m_dirtyToolboxIndex;
|
||||||
|
bool m_wasSidebarVisible;
|
||||||
|
|
||||||
// Remember the search history
|
// Remember the search history
|
||||||
QStringList m_searchHistory;
|
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 )
|
void Sidebar::itemClicked( QListWidgetItem *item )
|
||||||
{
|
{
|
||||||
if ( !item )
|
if ( !item )
|
||||||
|
|
|
@ -34,6 +34,7 @@ class Sidebar : public QWidget
|
||||||
int currentIndex() const;
|
int currentIndex() const;
|
||||||
|
|
||||||
void setSidebarVisibility( bool visible );
|
void setSidebarVisibility( bool visible );
|
||||||
|
bool isSidebarVisible() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void itemClicked( QListWidgetItem *item );
|
void itemClicked( QListWidgetItem *item );
|
||||||
|
|
Loading…
Reference in a new issue