Commit 75f1996c authored by Huon Imberger's avatar Huon Imberger Committed by Henrik Fehlauer

Fix thumbnail bar in View resetting to OFF when quitting in fullscreen

Summary:
Quitting Gwenview was saving the current state of the {nav Thumbnail Bar}, which is always
hidden in fullscreen, and therefore was always saving an OFF state to the config.
This patch saves the state of the {nav Thumbnail Bar} before going to fullscreen.

Test Plan:
Go to {nav View}, toggle {nav Thumbnail Bar} on, go to fullscreen, press {key Ctrl Q} to quit.
After launching Gwenview again, {nav View} {nav Thumbnail Bar} should be visible.

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Differential Revision: https://phabricator.kde.org/D10785
parent 14e8e10f
......@@ -162,7 +162,6 @@ struct ViewMainPagePrivate
bool mFullScreenMode;
bool mCompareMode;
bool mThumbnailBarVisibleBeforeFullScreen;
ZoomMode::Enum mZoomMode;
void setupThumbnailBar()
......@@ -402,7 +401,6 @@ ViewMainPage::ViewMainPage(QWidget* parent, SlideShow* slideShow, KActionCollect
d->mGvCore = gvCore;
d->mFullScreenMode = false;
d->mCompareMode = false;
d->mThumbnailBarVisibleBeforeFullScreen = false;
QShortcut* enterKeyShortcut = new QShortcut(Qt::Key_Return, this);
connect(enterKeyShortcut, &QShortcut::activated, this, &ViewMainPage::slotEnterPressed);
......@@ -426,7 +424,6 @@ ViewMainPage::ViewMainPage(QWidget* parent, SlideShow* slideShow, KActionCollect
d->mToggleThumbnailBarAction->setText(i18n("Thumbnail Bar"));
d->mToggleThumbnailBarAction->setIcon(QIcon::fromTheme("folder-image"));
actionCollection->setDefaultShortcut(d->mToggleThumbnailBarAction, Qt::CTRL + Qt::Key_B);
d->mToggleThumbnailBarAction->setChecked(GwenviewConfig::thumbnailBarIsVisible());
connect(d->mToggleThumbnailBarAction, &KToggleAction::triggered, this, &ViewMainPage::setThumbnailBarVisibility);
d->mToggleThumbnailBarButton->setDefaultAction(d->mToggleThumbnailBarAction);
......@@ -460,6 +457,8 @@ void ViewMainPage::loadConfig()
d->mThumbnailSplitter->setOrientation(orientation == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
d->mThumbnailBar->setOrientation(orientation);
d->setupThumbnailBarStyleSheet();
d->mThumbnailBar->setVisible(GwenviewConfig::thumbnailBarIsVisible());
d->mToggleThumbnailBarAction->setChecked(GwenviewConfig::thumbnailBarIsVisible());
int oldRowCount = d->mThumbnailBar->rowCount();
int newRowCount = GwenviewConfig::thumbnailBarRowCount();
......@@ -511,14 +510,9 @@ void ViewMainPage::setFullScreenMode(bool fullScreenMode)
d->mStatusBarContainer->setVisible(!fullScreenMode);
if (fullScreenMode) {
d->mThumbnailBarVisibleBeforeFullScreen = d->mToggleThumbnailBarAction->isChecked();
if (d->mThumbnailBarVisibleBeforeFullScreen) {
d->mToggleThumbnailBarAction->trigger();
}
d->mThumbnailBar->setVisible(false);
} else {
if (d->mThumbnailBarVisibleBeforeFullScreen) {
d->mToggleThumbnailBarAction->trigger();
}
d->mThumbnailBar->setVisible(d->mToggleThumbnailBarAction->isChecked());
}
d->applyPalette(fullScreenMode);
d->mToggleThumbnailBarAction->setEnabled(!fullScreenMode);
......
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