Commit 9d2bb7da authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files
parent 09b5c04f
......@@ -3017,7 +3017,7 @@ void DigikamApp::rebuild()
}
}
void DigikamApp::showSideBar(bool visible)
void DigikamApp::showSideBars(bool visible)
{
visible ? d->view->showSideBars()
: d->view->hideSideBars();
......
......@@ -143,7 +143,7 @@ private:
void updateQuickImportAction();
void initGui();
void showThumbBar(bool visible);
void showSideBar(bool visible);
void showSideBars(bool visible);
bool thumbbarVisibility() const;
private Q_SLOTS:
......
......@@ -63,8 +63,9 @@ public:
fullScreenAction = 0;
fullScreenBtn = 0;
dirtyMainToolBar = false;
fullScreenHideToolBar = false;
fullScreenHideToolBars = false;
fullScreenHideThumbBar = true;
fullScreenHideSideBars = false;
thumbbarVisibility = true;
menubarVisibility = true;
statusbarVisibility = true;
......@@ -74,12 +75,16 @@ public:
/** Settings taken from managed window configuration to handle toolbar visibility in full-screen mode
*/
bool fullScreenHideToolBar;
bool fullScreenHideToolBars;
/** Settings taken from managed window configuration to handle thumbbar visibility in full-screen mode
*/
bool fullScreenHideThumbBar;
/** Settings taken from managed window configuration to handle toolbar visibility in full-screen mode
*/
bool fullScreenHideSideBars;
/** Full-Screen options. See FullScreenOptions enum and setFullScreenOptions() for details.
*/
int fsOptions;
......@@ -143,11 +148,14 @@ void DXmlGuiWindow::createFullScreenAction(const QString& name)
void DXmlGuiWindow::readFullScreenSettings(const KConfigGroup& group)
{
if (d->fsOptions & FS_TOOLBAR)
d->fullScreenHideToolBar = group.readEntry(s_configFullScreenHideToolBarEntry, false);
if (d->fsOptions & FS_TOOLBARS)
d->fullScreenHideToolBars = group.readEntry(s_configFullScreenHideToolBarsEntry, false);
if (d->fsOptions & FS_THUMBBAR)
d->fullScreenHideThumbBar = group.readEntry(s_configFullScreenHideThumbBarEntry, true);
if (d->fsOptions & FS_SIDEBARS)
d->fullScreenHideSideBars = group.readEntry(s_configFullScreenHideSideBarsEntry, false);
}
void DXmlGuiWindow::slotToggleFullScreen(bool set)
......@@ -172,7 +180,7 @@ void DXmlGuiWindow::slotToggleFullScreen(bool set)
// restore sidebars
showSideBar(true);
showSideBars(true);
// restore thummbbar
......@@ -210,7 +218,8 @@ void DXmlGuiWindow::slotToggleFullScreen(bool set)
// hide sidebars
showSideBar(false);
if ((d->fsOptions & FS_SIDEBARS) && d->fullScreenHideSideBars)
showSideBars(false);
// hide thummbbar
......@@ -221,7 +230,7 @@ void DXmlGuiWindow::slotToggleFullScreen(bool set)
// hide toolbars and manage full-screen button
if ((d->fsOptions & FS_TOOLBAR) && d->fullScreenHideToolBar)
if ((d->fsOptions & FS_TOOLBARS) && d->fullScreenHideToolBars)
{
showToolBars(false);
}
......@@ -278,7 +287,7 @@ bool DXmlGuiWindow::eventFilter(QObject* obj, QEvent* ev)
if (mainbar)
{
if (((d->fsOptions & FS_TOOLBAR) && d->fullScreenHideToolBar) || !mainbar->isVisible())
if (((d->fsOptions & FS_TOOLBARS) && d->fullScreenHideToolBars) || !mainbar->isVisible())
{
QHoverEvent* const mev = dynamic_cast<QHoverEvent*>(ev);
......@@ -398,7 +407,7 @@ void DXmlGuiWindow::showToolBars(bool visible)
}
}
void DXmlGuiWindow::showSideBar(bool visible)
void DXmlGuiWindow::showSideBars(bool visible)
{
Q_UNUSED(visible);
}
......
......@@ -49,14 +49,16 @@ namespace Digikam
*/
enum FullScreenOptions
{
FS_TOOLBAR = 0x00000001,
FS_TOOLBARS = 0x00000001,
FS_THUMBBAR = 0x00000002,
FS_NONE = 0x00000004,
FS_DEFAULT = FS_TOOLBAR | FS_THUMBBAR // Image Editor config.
FS_SIDEBARS = 0x00000004,
FS_NONE = 0x00000008,
FS_DEFAULT = FS_TOOLBARS | FS_THUMBBAR // Image Editor config.
};
static const QString s_configFullScreenHideToolBarsEntry("FullScreen Hide ToolBars");
static const QString s_configFullScreenHideThumbBarEntry("FullScreen Hide ThumbBar");
static const QString s_configFullScreenHideToolBarEntry("FullScreen Hide ToolBar");
static const QString s_configFullScreenHideSideBarsEntry("FullScreen Hide SideBars");
/** Data container to use in managed window.
*/
......@@ -97,10 +99,10 @@ protected:
bool eventFilter(QObject* obj, QEvent* ev);
void keyPressEvent(QKeyEvent* e);
/** Re-implement this method if you want to manage sidebar visibility in full-screen mode.
/** Re-implement this method if you want to manage sidebars visibility in full-screen mode.
* By default this method do nothing.
*/
virtual void showSideBar(bool visible);
virtual void showSideBars(bool visible);
/** Re-implement this method if you want to manage thumbbar visibility in full-screen mode.
* By default this method do nothing.
......
......@@ -51,12 +51,14 @@ public:
options = FS_DEFAULT;
hideToolBars = 0;
hideThumbBar = 0;
hideSideBars = 0;
}
int options;
QCheckBox* hideToolBars;
QCheckBox* hideThumbBar;
QCheckBox* hideSideBars;
};
FullScreenSettings::FullScreenSettings(int options, QWidget* const parent)
......@@ -70,13 +72,17 @@ FullScreenSettings::FullScreenSettings(int options, QWidget* const parent)
d->hideThumbBar = new QCheckBox(i18n("Hide &thumbbar"), this);
d->hideThumbBar->setWhatsThis(i18n("Hide thumbbar view when window switch in full-screen mode."));
d->hideSideBars = new QCheckBox(i18n("Hide &sidebars"), this);
d->hideSideBars->setWhatsThis(i18n("Hide all side-bars when window switch in full-screen mode."));
vlay->addWidget(d->hideToolBars);
vlay->addWidget(d->hideThumbBar);
vlay->setMargin(0);
vlay->setSpacing(KDialog::spacingHint());
if (!(options & FS_TOOLBAR)) d->hideToolBars->hide();
if (!(options & FS_TOOLBARS)) d->hideToolBars->hide();
if (!(options & FS_THUMBBAR)) d->hideThumbBar->hide();
if (!(options & FS_SIDEBARS)) d->hideSideBars->hide();
}
FullScreenSettings::~FullScreenSettings()
......@@ -86,21 +92,27 @@ FullScreenSettings::~FullScreenSettings()
void FullScreenSettings::readSettings(const KConfigGroup& group)
{
if (d->options & FS_TOOLBAR)
d->hideToolBars->setChecked(group.readEntry(s_configFullScreenHideToolBarEntry, false));
if (d->options & FS_TOOLBARS)
d->hideToolBars->setChecked(group.readEntry(s_configFullScreenHideToolBarsEntry, false));
if (d->options & FS_THUMBBAR)
d->hideThumbBar->setChecked(group.readEntry(s_configFullScreenHideThumbBarEntry, true));
if (d->options & FS_SIDEBARS)
d->hideSideBars->setChecked(group.readEntry(s_configFullScreenHideSideBarsEntry, false));
}
void FullScreenSettings::saveSettings(KConfigGroup& group)
{
if (d->options & FS_TOOLBAR)
group.writeEntry(s_configFullScreenHideToolBarEntry, d->hideToolBars->isChecked());
if (d->options & FS_TOOLBARS)
group.writeEntry(s_configFullScreenHideToolBarsEntry, d->hideToolBars->isChecked());
if (d->options & FS_THUMBBAR)
group.writeEntry(s_configFullScreenHideThumbBarEntry, d->hideThumbBar->isChecked());
if (d->options & FS_SIDEBARS)
group.writeEntry(s_configFullScreenHideSideBarsEntry, d->hideSideBars->isChecked());
group.sync();
}
......
......@@ -2935,7 +2935,7 @@ void EditorWindow::addAction2ContextMenu(const QString& actionName, bool addDisa
}
}
void EditorWindow::showSideBar(bool visible)
void EditorWindow::showSideBars(bool visible)
{
if (visible)
{
......
......@@ -327,7 +327,7 @@ private:
void enterWaitingLoop();
void quitWaitingLoop();
void showSideBar(bool visible);
void showSideBars(bool visible);
void showThumbBar(bool visible);
void showCustomizedView(bool visible);
bool thumbbarVisibility() const;
......
......@@ -2575,7 +2575,7 @@ void ImportUI::slotHistoryEntryClicked(const QVariant& metadata)
d->view->scrollTo(folder, file);
}
void ImportUI::showSideBar(bool visible)
void ImportUI::showSideBars(bool visible)
{
visible ? d->rightSideBar->restore()
: d->rightSideBar->backup();
......
......@@ -145,7 +145,7 @@ private:
bool createExtBasedSubAlbum(KUrl &downloadUrl, const CamItemInfo& info);
void showThumbBar(bool visible);
void showSideBar(bool visible);
void showSideBars(bool visible);
bool thumbbarVisibility() const;
private Q_SLOTS:
......
......@@ -127,7 +127,7 @@ LightTableWindow::LightTableWindow()
setCaption(i18n("Light Table"));
// We don't want to be deleted on close
setAttribute(Qt::WA_DeleteOnClose, false);
setFullScreenOptions(FS_TOOLBAR);
setFullScreenOptions(FS_TOOLBARS);
// -- Build the GUI -------------------------------
......@@ -1609,7 +1609,7 @@ void LightTableWindow::slotThemeChanged()
d->previewView->checkForSelection(d->previewView->rightImageInfo());
}
void LightTableWindow::showSideBar(bool visible)
void LightTableWindow::showSideBars(bool visible)
{
if (visible)
{
......
......@@ -81,7 +81,7 @@ protected:
private:
void showSideBar(bool visible);
void showSideBars(bool visible);
void closeEvent(QCloseEvent* e);
void showEvent(QShowEvent*);
void setupActions();
......
......@@ -573,26 +573,6 @@ void QueueMgrWindow::refreshStatusBar()
}
}
void QueueMgrWindow::showToolBars()
{
QList<KToolBar*> toolbars = toolBars();
foreach(KToolBar* const toolbar, toolbars)
{
toolbar->show();
}
}
void QueueMgrWindow::hideToolBars()
{
QList<KToolBar*> toolbars = toolBars();
foreach(KToolBar* const toolbar, toolbars)
{
toolbar->hide();
}
}
void QueueMgrWindow::slotEditKeys()
{
KShortcutsDialog dialog(KShortcutsEditor::AllActions,
......
......@@ -100,8 +100,6 @@ private:
void setupConnections();
void setupUserArea();
void setupStatusBar();
void showToolBars();
void hideToolBars();
void readSettings();
void writeSettings();
void refreshStatusBar();
......
......@@ -127,7 +127,7 @@ SetupLightTable::SetupLightTable(QWidget* const parent)
// --------------------------------------------------------
d->fullScreenSettings = new FullScreenSettings(FS_TOOLBAR, panel);
d->fullScreenSettings = new FullScreenSettings(FS_TOOLBARS, panel);
// --------------------------------------------------------
......
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