From e1ad2133302a11d4f9f66d2013d43f23759faf1e Mon Sep 17 00:00:00 2001 From: Lukas K Date: Sat, 24 Apr 2021 19:49:36 +0200 Subject: [PATCH] properties: hide layer editor if there's only one layer --- src/core/core_properties.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/core_properties.cpp b/src/core/core_properties.cpp index 09b34f604..d6e3a664b 100644 --- a/src/core/core_properties.cpp +++ b/src/core/core_properties.cpp @@ -486,9 +486,11 @@ void Core::layers_to_meta(PropertyMeta &meta) { PropertyMetaLayers &m = dynamic_cast(meta); m.layers.clear(); - for (const auto &it : get_layer_provider().get_layers()) { + const auto &prv = get_layer_provider(); + for (const auto &it : prv.get_layers()) { m.layers.emplace(it.first, it.second); } + m.is_visible = prv.get_layers().size() > 1; } void Core::get_placement(const Placement &placement, class PropertyValue &value, ObjectProperty::ID property)