Commit 55ff96a4 authored by Halla Rempt's avatar Halla Rempt

BUG:364208 Fix the interaction between show canvas/only and show dockers

Patch by Bruno Kinoshita. Thanks!
CCMAIL:brunodepaulak@yahoo.com.br
parent 050f8354
......@@ -2212,6 +2212,7 @@ void KisMainWindow::applyDefaultSettings(QPrinter &printer) {
void KisMainWindow::createActions()
{
KisActionManager *actionManager = d->actionManager();
KisConfig cfg;
actionManager->createStandardAction(KStandardAction::New, this, SLOT(slotFileNew()));
actionManager->createStandardAction(KStandardAction::Open, this, SLOT(slotFileOpen()));
......@@ -2274,14 +2275,12 @@ void KisMainWindow::createActions()
d->toggleDockers = actionManager->createAction("view_toggledockers");
cfg.showDockers(true);
d->toggleDockers->setChecked(true);
connect(d->toggleDockers, SIGNAL(toggled(bool)), SLOT(toggleDockersVisibility(bool)));
d->toggleDockerTitleBars = actionManager->createAction("view_toggledockertitlebars");
{
KisConfig cfg;
d->toggleDockerTitleBars->setChecked(cfg.showDockerTitleBars());
}
d->toggleDockerTitleBars->setChecked(cfg.showDockerTitleBars());
connect(d->toggleDockerTitleBars, SIGNAL(toggled(bool)), SLOT(showDockerTitleBars(bool)));
actionCollection()->addAction("settings_dockers_menu", d->dockWidgetMenu);
......
......@@ -1083,9 +1083,18 @@ void KisViewManager::switchCanvasOnly(bool toggled)
if (cfg.hideDockersFullscreen()) {
KisAction* action = qobject_cast<KisAction*>(main->actionCollection()->action("view_toggledockers"));
action->setCheckable(true);
if (action && action->isChecked() == toggled) {
action->setChecked(!toggled);
if (action) {
action->setCheckable(true);
if (toggled) {
if (action->isChecked()) {
cfg.setShowDockers(action->isChecked());
action->setChecked(false);
} else {
cfg.setShowDockers(false);
}
} else {
action->setChecked(cfg.showDockers());
}
}
}
......
......@@ -1096,6 +1096,16 @@ void KisConfig::setShowDockerTitleBars(const bool value) const
m_cfg.writeEntry("showDockerTitleBars", value);
}
bool KisConfig::showDockers(bool defaultValue) const
{
return (defaultValue ? true : m_cfg.readEntry("showDockers", true));
}
void KisConfig::setShowDockers(const bool value) const
{
m_cfg.writeEntry("showDockers", value);
}
bool KisConfig::showStatusBar(bool defaultValue) const
{
return (defaultValue ? true : m_cfg.readEntry("showStatusBar", true));
......
......@@ -292,6 +292,9 @@ public:
bool showDockerTitleBars(bool defaultValue = false) const;
void setShowDockerTitleBars(const bool value) const;
bool showDockers(bool defaultValue = false) const;
void setShowDockers(const bool value) const;
bool showStatusBar(bool defaultValue = false) const;
void setShowStatusBar(const bool value) const;
......
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