diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 3106403fb..efe78ec7c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1340,6 +1340,11 @@ void MainWindow::ActionLayout(bool checked) ui->dockWidgetToolOptions->setVisible(false); ShowPaper(ui->listWidget->currentRow()); + + if (scenes.isEmpty()) + { + ui->toolButtonLayoutSettings->click(); + } } else { diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index fb00a38b4..08b06c8de 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -57,6 +57,9 @@ MainWindowsNoGUI::~MainWindowsNoGUI() //--------------------------------------------------------------------------------------------------------------------- void MainWindowsNoGUI::ToolLayoutSettings(bool checked) { + QToolButton *tButton = qobject_cast< QToolButton * >(this->sender()); + SCASSERT(tButton != nullptr) + if (checked) { VLayoutGenerator lGenerator(this); @@ -65,6 +68,7 @@ void MainWindowsNoGUI::ToolLayoutSettings(bool checked) DialogLayoutSettings layout(&lGenerator, this); if (layout.exec() == QDialog::Rejected) { + tButton->setChecked(false); return; } @@ -98,13 +102,11 @@ void MainWindowsNoGUI::ToolLayoutSettings(bool checked) default: break; } + tButton->setChecked(false); } else { - if (QToolButton *tButton = qobject_cast< QToolButton * >(this->sender())) - { - tButton->setChecked(true); - } + tButton->setChecked(true); } }