diff --git a/GUI/View/Sample/LayerForm.cpp b/GUI/View/Sample/LayerForm.cpp index f28080118f624231623bd5a2b07aa0759d5deec1..fd11d4e359333b68d69396f13bab0b3d53490f5f 100644 --- a/GUI/View/Sample/LayerForm.cpp +++ b/GUI/View/Sample/LayerForm.cpp @@ -181,8 +181,7 @@ void LayerForm::updateLayerPositionDependentElements() m_layout->insertValue(m_thicknessRow, m_layer->thickness()); } - if (m_ec->sampleItem()->layerItems().size() < 2) - m_moveButton->setVisible(false); + m_moveButton->setVisible(m_ec->sampleItem()->layerItems().size() > 1); } void LayerForm::onLayoutAdded(ParticleLayoutItem* newLayoutItem) diff --git a/GUI/View/Sample/SampleEditorController.cpp b/GUI/View/Sample/SampleEditorController.cpp index 5e09295a31c96f5ad5f81ebdfda61c8818604aa3..4865058e5b3d0a91de7d14d46f8c76874627fb9e 100644 --- a/GUI/View/Sample/SampleEditorController.cpp +++ b/GUI/View/Sample/SampleEditorController.cpp @@ -123,6 +123,7 @@ void SampleEditorController::removeLayerItem(LayerItem* layer) emit aboutToRemoveItem(layer); m_sampleForm->onAboutToRemoveLayer(layer); m_sampleItem->removeLayer(layer); + m_sampleForm->updateRowVisibilities(); emit modified(); } diff --git a/GUI/View/Sample/SampleForm.cpp b/GUI/View/Sample/SampleForm.cpp index 36ead1e7f728096f5a28188fef8e6aac528cb43b..b93d12dc2a59d80215c04499350f7e7e4004cd76 100644 --- a/GUI/View/Sample/SampleForm.cpp +++ b/GUI/View/Sample/SampleForm.cpp @@ -182,8 +182,9 @@ void SampleForm::onAboutToRemoveLayer(LayerItem* layerItem) void SampleForm::updateRowVisibilities() { - for (auto* c : findChildren<LayerForm*>()) + for (auto* c : findChildren<LayerForm*>()) { c->updateLayerPositionDependentElements(); + } } LayerForm* SampleForm::findNextLayerForm(QWidget* w)