Implemented a solution for #2180

Implements a new option to show/hide unresolved references
(ghost cells). The option is found in "Display/Cells"
in the Setup dialog and also in the View menu.
This commit is contained in:
Matthias Koefferlein
2025-10-18 23:40:50 +02:00
parent 0016710573
commit 19dc5e8edb
8 changed files with 70 additions and 12 deletions
+19 -2
View File
@@ -343,6 +343,7 @@ LayoutViewBase::init (db::Manager *mgr)
m_box_font = 0;
m_min_size_for_label = 16;
m_cell_box_visible = true;
m_ghost_cells_visible = true;
m_text_visible = true;
m_default_font_size = lay::FixedFont::default_font_size ();
m_text_lazy_rendering = true;
@@ -958,6 +959,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
cell_box_visible (flag);
return true;
} else if (name == cfg_ghost_cells_visible) {
bool flag;
tl::from_string (value, flag);
ghost_cells_visible (flag);
return true;
} else if (name == cfg_cell_box_color) {
tl::Color color;
@@ -4328,7 +4336,7 @@ LayoutViewBase::set_view_ops ()
}
// ghost cells
if (m_cell_box_visible) { // @@@
if (m_ghost_cells_visible) {
lay::ViewOp vop, vopv;
@@ -5422,7 +5430,16 @@ LayoutViewBase::cell_box_visible (bool vis)
}
}
void
void
LayoutViewBase::ghost_cells_visible (bool vis)
{
if (m_ghost_cells_visible != vis) {
m_ghost_cells_visible = vis;
update_content ();
}
}
void
LayoutViewBase::text_font (unsigned int f)
{
if (m_text_font != f) {
+14
View File
@@ -1115,6 +1115,19 @@ public:
return m_cell_box_visible;
}
/**
* @brief Visibility of ghost cells
*/
void ghost_cells_visible (bool vis);
/**
* @brief Visibility of ghost cells
*/
bool ghost_cells_visible () const
{
return m_ghost_cells_visible;
}
/**
* @brief Min instance label size setter
*/
@@ -2910,6 +2923,7 @@ private:
unsigned int m_box_font;
int m_min_size_for_label;
bool m_cell_box_visible;
bool m_ghost_cells_visible;
tl::Color m_marker_color;
int m_marker_line_width;
@@ -59,6 +59,7 @@ public:
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_text_transform, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_color, "auto"));
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_visible, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_ghost_cells_visible, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_text_color, "auto"));
options.push_back (std::pair<std::string, std::string> (cfg_text_visible, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_text_lazy_rendering, "true"));
@@ -841,7 +841,7 @@ RedrawThreadWorker::draw_boxes_impl (bool drawing_context, db::cell_index_type c
// paint the box on this level
draw_cell (drawing_context, level, trans, bbox, empty_cell, mp_layout->display_name (ci));
} else if (! for_ghosts && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
} else if (! for_ghosts && ! cell.is_ghost_cell () && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
// paint the box on this level
draw_cell (drawing_context, level, trans, bbox, empty_cell, mp_layout->display_name (ci));
@@ -1003,7 +1003,7 @@ RedrawThreadWorker::draw_box_properties (bool drawing_context, db::cell_index_ty
void
RedrawThreadWorker::draw_box_properties_for_ghosts (bool drawing_context, db::cell_index_type ci, const db::CplxTrans &trans, const std::vector<db::Box> &vp, int level)
{
draw_box_properties_impl (drawing_context, ci, trans, vp, level, false);
draw_box_properties_impl (drawing_context, ci, trans, vp, level, true);
}
void
@@ -1057,7 +1057,7 @@ RedrawThreadWorker::draw_box_properties_impl (bool drawing_context, db::cell_ind
// paint the box on this level
draw_cell_properties (drawing_context, level, trans, bbox, prop_id);
} else if (! for_ghosts && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
} else if (! for_ghosts && ! cell.is_ghost_cell () && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
// paint the box on this level
draw_cell_properties (drawing_context, level, trans, bbox, prop_id);
+1
View File
@@ -95,6 +95,7 @@ static const std::string cfg_cell_box_text_font ("inst-label-font");
static const std::string cfg_cell_box_text_transform ("inst-label-transform");
static const std::string cfg_cell_box_color ("inst-color");
static const std::string cfg_cell_box_visible ("inst-visible");
static const std::string cfg_ghost_cells_visible ("ghost-cells-visible");
static const std::string cfg_text_color ("text-color");
static const std::string cfg_text_visible ("text-visible");
static const std::string cfg_text_lazy_rendering ("text-lazy-rendering");