From 12c1b59c791e843e1c05df9c8a3665be6aa0e6c6 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 27 Jan 2015 16:14:54 +0200 Subject: [PATCH] Fixed issue #218. Pattern disappears when Detail icon on icon bar is selected. --HG-- branch : develop --- src/app/mainwindow.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 973045e3c..22fa7668c 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1468,7 +1468,6 @@ void MainWindow::Clear() qCDebug(vMainWindow)<<"Unlocked pattern file."; ui->actionDetails->setChecked(false); - ui->actionDetails->setEnabled(false); ui->actionDraw->setChecked(true); ui->actionDraw->setEnabled(false); qCDebug(vMainWindow)<<"Returned to Draw mode."; @@ -1678,11 +1677,20 @@ void MainWindow::SetEnabledGUI(bool enabled) ui->actionHistory->setEnabled(enabled); ui->actionNewDraw->setEnabled(enabled); ui->actionDraw->setEnabled(enabled); - ui->actionDetails->setEnabled(enabled); ui->actionTable->setEnabled(enabled); - ui->actionLayout->setEnabled(enabled); ui->actionZoomFitBest->setEnabled(enabled); ui->actionZoomOriginal->setEnabled(enabled); + + if (enabled) + { + Layout(); + } + else + { + ui->actionDetails->setEnabled(enabled); + ui->actionLayout->setEnabled(enabled); + } + guiEnabled = enabled; sceneDraw->SetDisable(!enabled); @@ -1708,10 +1716,12 @@ void MainWindow::Layout() const QHash *details = pattern->DataDetails(); if (details->size() > 0) { + ui->actionDetails->setEnabled(true); ui->actionLayout->setEnabled(true); } else { + ui->actionDetails->setEnabled(false); ui->actionLayout->setEnabled(false); } } @@ -1826,12 +1836,12 @@ void MainWindow::SetEnableWidgets(bool enable) { ui->actionSaveAs->setEnabled(enable); ui->actionDraw->setEnabled(enable); - ui->actionDetails->setEnabled(enable); ui->actionOptionDraw->setEnabled(enable); if (enable == true && curFile.isEmpty() == false) { ui->actionSave->setEnabled(enable); } + Layout(); ui->actionTable->setEnabled(enable); ui->actionHistory->setEnabled(enable); ui->actionPattern_properties->setEnabled(enable);