Changeset View
Changeset View
Standalone View
Standalone View
part.cpp
Show First 20 Lines • Show All 430 Lines • ▼ Show 20 Line(s) | 308 | { | |||
---|---|---|---|---|---|
431 | m_searchWidget = new SearchWidget( thumbsBox, m_document ); | 431 | m_searchWidget = new SearchWidget( thumbsBox, m_document ); | ||
432 | thumbsBox->layout()->addWidget(m_searchWidget); | 432 | thumbsBox->layout()->addWidget(m_searchWidget); | ||
433 | m_thumbnailList = new ThumbnailList( thumbsBox, m_document ); | 433 | m_thumbnailList = new ThumbnailList( thumbsBox, m_document ); | ||
434 | thumbsBox->layout()->addWidget(m_thumbnailList); | 434 | thumbsBox->layout()->addWidget(m_thumbnailList); | ||
435 | // ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList ); | 435 | // ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList ); | ||
436 | connect( m_thumbnailList.data(), &ThumbnailList::rightClick, this, &Part::slotShowMenu ); | 436 | connect( m_thumbnailList.data(), &ThumbnailList::rightClick, this, &Part::slotShowMenu ); | ||
437 | m_sidebar->addItem( thumbsBox, QIcon::fromTheme( QStringLiteral("view-preview") ), i18n("Thumbnails") ); | 437 | m_sidebar->addItem( thumbsBox, QIcon::fromTheme( QStringLiteral("view-preview") ), i18n("Thumbnails") ); | ||
438 | 438 | | |||
439 | // Setting current item as thumbsBox if the side navigation panel is visible | ||||
aacid: can you please change your nomenclarute of "side navigation panel is visible" in this and the… | |||||
440 | if ( !Okular::Settings::hideSideContainer() ) | ||||
439 | m_sidebar->setCurrentItem( thumbsBox ); | 441 | m_sidebar->setCurrentItem( thumbsBox ); | ||
440 | 442 | | |||
441 | // [left toolbox: Reviews] | [] | 443 | // [left toolbox: Reviews] | [] | ||
442 | m_reviewsWidget = new Reviews( nullptr, m_document ); | 444 | m_reviewsWidget = new Reviews( nullptr, m_document ); | ||
443 | m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme(QStringLiteral("draw-freehand")), i18n("Reviews") ); | 445 | m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme(QStringLiteral("draw-freehand")), i18n("Reviews") ); | ||
444 | m_sidebar->setItemEnabled( m_reviewsWidget, false ); | 446 | m_sidebar->setItemEnabled( m_reviewsWidget, false ); | ||
445 | 447 | | |||
446 | // [left toolbox: Bookmarks] | [] | 448 | // [left toolbox: Bookmarks] | [] | ||
▲ Show 20 Lines • Show All 386 Lines • ▼ Show 20 Line(s) | 821 | { | |||
833 | 835 | | |||
834 | m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel")); | 836 | m_showLeftPanel = ac->add<KToggleAction>(QStringLiteral("show_leftpanel")); | ||
835 | m_showLeftPanel->setText(i18n( "Show &Navigation Panel")); | 837 | m_showLeftPanel->setText(i18n( "Show &Navigation Panel")); | ||
836 | m_showLeftPanel->setIcon(QIcon::fromTheme( QStringLiteral("view-sidetree") )); | 838 | m_showLeftPanel->setIcon(QIcon::fromTheme( QStringLiteral("view-sidetree") )); | ||
837 | connect( m_showLeftPanel, &QAction::toggled, this, &Part::slotShowLeftPanel ); | 839 | connect( m_showLeftPanel, &QAction::toggled, this, &Part::slotShowLeftPanel ); | ||
838 | ac->setDefaultShortcut(m_showLeftPanel, QKeySequence(Qt::Key_F7)); | 840 | ac->setDefaultShortcut(m_showLeftPanel, QKeySequence(Qt::Key_F7)); | ||
839 | m_showLeftPanel->setChecked( Okular::Settings::showLeftPanel() ); | 841 | m_showLeftPanel->setChecked( Okular::Settings::showLeftPanel() ); | ||
840 | slotShowLeftPanel(); | 842 | slotShowLeftPanel(); | ||
843 | // Displaying the side navigation panel based on the last state | ||||
844 | m_sidebar->setCollapsed( Okular::Settings::hideSideContainer() ); | ||||
841 | 845 | | |||
842 | m_showBottomBar = ac->add<KToggleAction>(QStringLiteral("show_bottombar")); | 846 | m_showBottomBar = ac->add<KToggleAction>(QStringLiteral("show_bottombar")); | ||
843 | m_showBottomBar->setText(i18n( "Show &Page Bar")); | 847 | m_showBottomBar->setText(i18n( "Show &Page Bar")); | ||
844 | connect( m_showBottomBar, &QAction::toggled, this, &Part::slotShowBottomBar ); | 848 | connect( m_showBottomBar, &QAction::toggled, this, &Part::slotShowBottomBar ); | ||
845 | m_showBottomBar->setChecked( Okular::Settings::showBottomBar() ); | 849 | m_showBottomBar->setChecked( Okular::Settings::showBottomBar() ); | ||
846 | slotShowBottomBar(); | 850 | slotShowBottomBar(); | ||
847 | 851 | | |||
848 | m_showEmbeddedFiles = ac->addAction(QStringLiteral("embedded_files")); | 852 | m_showEmbeddedFiles = ac->addAction(QStringLiteral("embedded_files")); | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 895 | #endif | |||
910 | 914 | | |||
911 | QAction *playPauseAction = new QAction( i18n( "Play/Pause Presentation" ), ac ); | 915 | QAction *playPauseAction = new QAction( i18n( "Play/Pause Presentation" ), ac ); | ||
912 | ac->addAction( QStringLiteral("presentation_play_pause"), playPauseAction ); | 916 | ac->addAction( QStringLiteral("presentation_play_pause"), playPauseAction ); | ||
913 | playPauseAction->setEnabled( false ); | 917 | playPauseAction->setEnabled( false ); | ||
914 | } | 918 | } | ||
915 | 919 | | |||
916 | Part::~Part() | 920 | Part::~Part() | ||
917 | { | 921 | { | ||
922 | Okular::Settings::setHideSideContainer( m_sidebar->isCollapsed() ); | ||||
923 | Okular::Settings::self()->save(); | ||||
924 | | ||||
918 | QDBusConnection::sessionBus().unregisterObject(m_registerDbusName); | 925 | QDBusConnection::sessionBus().unregisterObject(m_registerDbusName); | ||
919 | 926 | | |||
920 | GuiUtils::removeIconLoader( iconLoader() ); | 927 | GuiUtils::removeIconLoader( iconLoader() ); | ||
921 | m_document->removeObserver( this ); | 928 | m_document->removeObserver( this ); | ||
922 | 929 | | |||
923 | if ( m_document->isOpened() ) | 930 | if ( m_document->isOpened() ) | ||
924 | Part::closeUrl( false ); | 931 | Part::closeUrl( false ); | ||
925 | 932 | | |||
▲ Show 20 Lines • Show All 1219 Lines • ▼ Show 20 Line(s) | 2128 | { | |||
2145 | } | 2152 | } | ||
2146 | } | 2153 | } | ||
2147 | 2154 | | |||
2148 | 2155 | | |||
2149 | void Part::enableTOC(bool enable) | 2156 | void Part::enableTOC(bool enable) | ||
2150 | { | 2157 | { | ||
2151 | m_sidebar->setItemEnabled(m_toc, enable); | 2158 | m_sidebar->setItemEnabled(m_toc, enable); | ||
2152 | 2159 | | |||
2153 | // If present, show the TOC when a document is opened | 2160 | // If present, show the TOC when a document is opened and side navigation panel is visible | ||
2154 | if ( enable && m_sidebar->currentItem() != m_toc ) | 2161 | if ( enable && m_sidebar->currentItem() != m_toc && !Okular::Settings::hideSideContainer() ) | ||
2155 | { | 2162 | { | ||
2156 | m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed ); | 2163 | m_sidebar->setCurrentItem( m_toc, Sidebar::DoNotUncollapseIfCollapsed ); | ||
2157 | } | 2164 | } | ||
2158 | } | 2165 | } | ||
2159 | 2166 | | |||
2160 | void Part::slotRebuildBookmarkMenu() | 2167 | void Part::slotRebuildBookmarkMenu() | ||
2161 | { | 2168 | { | ||
2162 | rebuildBookmarkMenu(); | 2169 | rebuildBookmarkMenu(); | ||
▲ Show 20 Lines • Show All 1384 Lines • Show Last 20 Lines |
can you please change your nomenclarute of "side navigation panel is visible" in this and the other comments, because that is what F7 does, which is sabed with m_sidebar->setSidebarVisibility and what you're saving is the collapsed status.
Also the config option would probably make more sense to be named something like sidebarCollapsed defaulting to false.