Commit 5511e68f authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

Check thumbbar visibility before FullScreen mode and restore it after.

CCBUGS: 214107
CCBUGS: 220739
CCBUGS: 289262
CCBUGS: 236234
CCBUGS: 258180
CCBUGS: 293676
parent d6ddab1d
......@@ -65,6 +65,7 @@ public:
dirtyMainToolBar = false;
fullScreenHideToolBar = false;
fullScreenHideThumbBar = true;
thumbbarVisibility = true;
}
public:
......@@ -91,7 +92,13 @@ public:
*/
bool dirtyMainToolBar;
QMap<KToolBar*, bool> toolbarVisibilityMap;
/** Store previous visibility of toolbars before ful-screen mode.
*/
QMap<KToolBar*, bool> toolbarsVisibility;
/** Store previous visibility of thumbbar before ful-screen mode.
*/
bool thumbbarVisibility;
};
// --------------------------------------------------------------------------------------------------------
......@@ -160,7 +167,7 @@ void DXmlGuiWindow::slotToggleFullScreen(bool set)
showSideBar(true);
if ((d->fsOptions & FS_THUMBBAR) && d->fullScreenHideThumbBar)
showThumbBar(true);
showThumbBar(d->thumbbarVisibility);
// restore toolbars and manage full-screen button
......@@ -187,6 +194,8 @@ void DXmlGuiWindow::slotToggleFullScreen(bool set)
statusBar()->hide();
showSideBar(false);
d->thumbbarVisibility = thumbbarVisibility();
if ((d->fsOptions & FS_THUMBBAR) && d->fullScreenHideThumbBar)
showThumbBar(false);
......@@ -325,23 +334,21 @@ void DXmlGuiWindow::showToolBars(bool visible)
// We will hide toolbars: store previous state for future restoring.
if (!visible)
{
d->toolbarVisibilityMap.clear();
d->toolbarsVisibility.clear();
foreach(KToolBar* const toolbar, toolBars())
{
if (toolbar)
{
bool visibility = toolbar->isVisible();
d->toolbarVisibilityMap.insert(toolbar, visibility);
d->toolbarsVisibility.insert(toolbar, visibility);
}
}
kDebug() << d->toolbarVisibilityMap;
}
// Switch toolbars visibility
for (QMap<KToolBar*, bool>::const_iterator it = d->toolbarVisibilityMap.constBegin(); it != d->toolbarVisibilityMap.constEnd(); ++it)
for (QMap<KToolBar*, bool>::const_iterator it = d->toolbarsVisibility.constBegin(); it != d->toolbarsVisibility.constEnd(); ++it)
{
KToolBar* const toolbar = it.key();
bool visibility = it.value();
......@@ -358,9 +365,7 @@ void DXmlGuiWindow::showToolBars(bool visible)
// We will show toolbars: restore previous state.
if (visible)
{
kDebug() << d->toolbarVisibilityMap;
for (QMap<KToolBar*, bool>::const_iterator it = d->toolbarVisibilityMap.constBegin(); it != d->toolbarVisibilityMap.constEnd(); ++it)
for (QMap<KToolBar*, bool>::const_iterator it = d->toolbarsVisibility.constBegin(); it != d->toolbarsVisibility.constEnd(); ++it)
{
KToolBar* const toolbar = it.key();
bool visibility = it.value();
......@@ -383,4 +388,9 @@ void DXmlGuiWindow::showThumbBar(bool visible)
Q_UNUSED(visible);
}
bool DXmlGuiWindow::thumbbarVisibility() const
{
return true;
}
} // namespace Digikam
......@@ -109,6 +109,10 @@ protected:
*/
virtual void showThumbBar(bool visible);
/** Re-implement this method if managed window has a thumbbar. This must return visibility state of it.
*/
virtual bool thumbbarVisibility() const;
protected Q_SLOTS:
virtual void slotToggleFullScreen(bool);
......
......@@ -2976,4 +2976,9 @@ void EditorWindow::slotToggleFullScreen(bool b)
}
}
bool EditorWindow::thumbbarVisibility() const
{
return thumbBar()->isVisible();
}
} // namespace Digikam
......@@ -331,6 +331,7 @@ private:
void quitWaitingLoop();
void showSideBar(bool visible);
void showThumbBar(bool visible);
bool thumbbarVisibility() const;
void setColorManagedViewIndicatorToolTip(bool available, bool cmv);
void setUnderExposureToolTip(bool uei);
void setOverExposureToolTip(bool oei);
......
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