Config option: disable generation of new layers

The name of the config option is "auto-create-new-layers".
It is a per-view option and can be edited on the
"Application/Layer Properties" page.

With this option set to true (default), new layers
are automatically added to the layer list on

1. Paste of cells and shapes
2. Placing of instances

Manually adding new layers to the layer list is always possible.
This commit is contained in:
Matthias Koefferlein
2026-04-04 15:28:05 +02:00
parent 65fec36902
commit 60a210c264
10 changed files with 129 additions and 56 deletions
+15 -1
View File
@@ -362,6 +362,7 @@ LayoutViewBase::init (db::Manager *mgr)
m_clear_ruler_new_cell = false;
m_dbu_coordinates = false;
m_absolute_coordinates = false;
m_auto_create_new_layers = true;
m_drop_small_cells = false;
m_drop_small_cells_value = 10;
m_drop_small_cells_cond = DSC_Max;
@@ -1099,6 +1100,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
absolute_coordinates (flag);
return true;
} else if (name == cfg_auto_create_new_layers) {
bool flag;
tl::from_string (value, flag);
auto_create_new_layers (flag);
return true;
} else if (name == cfg_guiding_shape_visible) {
bool v = false;
@@ -4965,7 +4973,13 @@ LayoutViewBase::absolute_coordinates (bool f)
m_absolute_coordinates = f;
}
void
void
LayoutViewBase::auto_create_new_layers (bool f)
{
m_auto_create_new_layers = f;
}
void
LayoutViewBase::select_cellviews_fit (const std::list <CellView> &cvs)
{
if (m_cellviews != cvs) {
+17
View File
@@ -1884,6 +1884,22 @@ public:
*/
void absolute_coordinates (bool f);
/**
* @brief Gets a value indicating whether new layer entries shall be created in the view
*
* Certain operations such as paste or creation of instances establish new layers.
* This flag controls whether such new layers are automatically added to the layer list.
*/
bool auto_create_new_layers () const
{
return m_auto_create_new_layers;
}
/**
* @brief Sets a value indicating whether new layer entries shall be created in the view
*/
void auto_create_new_layers (bool f);
/**
* @brief Gets the canvas object (where the layout is drawn and view objects are placed)
*/
@@ -3092,6 +3108,7 @@ private:
bool m_clear_ruler_new_cell;
bool m_dbu_coordinates;
bool m_absolute_coordinates;
bool m_auto_create_new_layers;
bool m_dirty;
bool m_prop_changed;
@@ -114,6 +114,7 @@ public:
options.push_back (std::pair<std::string, std::string> (cfg_guiding_shape_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_guiding_shape_vertex_size, "5"));
options.push_back (std::pair<std::string, std::string> (cfg_abs_units, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_auto_create_new_layers, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_dbu_units, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_drawing_workers, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_drop_small_cells, "false"));
+1
View File
@@ -119,6 +119,7 @@ static const std::string cfg_stipple_palette ("stipple-palette");
static const std::string cfg_line_style_palette ("line-style-palette");
static const std::string cfg_dbu_units ("dbu-units");
static const std::string cfg_abs_units ("absolute-units");
static const std::string cfg_auto_create_new_layers ("auto-create-new-layers");
static const std::string cfg_drawing_workers ("drawing-workers");
static const std::string cfg_drop_small_cells ("drop-small-cells");
static const std::string cfg_drop_small_cells_cond ("drop-small-cells-condition");