diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 72430e410..8e4f976f0 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -4489,6 +4489,7 @@ public: menu_entries.push_back (lay::config_menu_item ("show_markers", at, tl::to_string (QObject::tr ("Show Markers")), cfg_markers_visible, "?")); menu_entries.push_back (lay::config_menu_item ("show_texts", at, tl::to_string (QObject::tr ("Show Texts")), cfg_text_visible, "?")); menu_entries.push_back (lay::config_menu_item ("show_cell_boxes", at, tl::to_string (QObject::tr ("Show Cell Frames")), cfg_cell_box_visible, "?")); + menu_entries.push_back (lay::config_menu_item ("show_ghost_cells", at, tl::to_string (QObject::tr ("Show Unresolved References")), cfg_ghost_cells_visible, "?")); menu_entries.push_back (lay::config_menu_item ("no_stipples", at, tl::to_string (QObject::tr ("Show Layers Without Fill")), cfg_no_stipple, "?")); menu_entries.push_back (lay::config_menu_item ("synchronized_views", at, tl::to_string (QObject::tr ("Synchronized Views")), cfg_synchronized_views, "?")); menu_entries.push_back (lay::config_menu_item ("edit_top_level_selection:edit_mode", at, tl::to_string (QObject::tr ("Select Top Level Objects")), edt::cfg_edit_top_level_selection, "?")); diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index f2ed75b5e..8877903bc 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -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) { diff --git a/src/laybasic/laybasic/layLayoutViewBase.h b/src/laybasic/laybasic/layLayoutViewBase.h index eeda5619a..1799a5c20 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.h +++ b/src/laybasic/laybasic/layLayoutViewBase.h @@ -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; diff --git a/src/laybasic/laybasic/layLayoutViewConfig.cc b/src/laybasic/laybasic/layLayoutViewConfig.cc index 30c161f77..7f7908bd8 100644 --- a/src/laybasic/laybasic/layLayoutViewConfig.cc +++ b/src/laybasic/laybasic/layLayoutViewConfig.cc @@ -59,6 +59,7 @@ public: options.push_back (std::pair (cfg_cell_box_text_transform, "true")); options.push_back (std::pair (cfg_cell_box_color, "auto")); options.push_back (std::pair (cfg_cell_box_visible, "true")); + options.push_back (std::pair (cfg_ghost_cells_visible, "true")); options.push_back (std::pair (cfg_text_color, "auto")); options.push_back (std::pair (cfg_text_visible, "true")); options.push_back (std::pair (cfg_text_lazy_rendering, "true")); diff --git a/src/laybasic/laybasic/layRedrawThreadWorker.cc b/src/laybasic/laybasic/layRedrawThreadWorker.cc index fe1275a41..d8a332b50 100644 --- a/src/laybasic/laybasic/layRedrawThreadWorker.cc +++ b/src/laybasic/laybasic/layRedrawThreadWorker.cc @@ -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 &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); diff --git a/src/laybasic/laybasic/laybasicConfig.h b/src/laybasic/laybasic/laybasicConfig.h index 47ec7a75f..681c3c8ac 100644 --- a/src/laybasic/laybasic/laybasicConfig.h +++ b/src/laybasic/laybasic/laybasicConfig.h @@ -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"); diff --git a/src/layui/layui/LayoutViewConfigPage2a.ui b/src/layui/layui/LayoutViewConfigPage2a.ui index 2f4e6911a..23bc34c44 100644 --- a/src/layui/layui/LayoutViewConfigPage2a.ui +++ b/src/layui/layui/LayoutViewConfigPage2a.ui @@ -6,8 +6,8 @@ 0 0 - 631 - 320 + 656 + 397 @@ -21,13 +21,33 @@ 9 - - + + Show cell boxes - + true + + + + + + Show unresolved references (ghost cells) + + + true + + + + + + + Cell box appearance + + + false + 9 diff --git a/src/layui/layui/layLayoutViewConfigPages.cc b/src/layui/layui/layLayoutViewConfigPages.cc index da43a394e..55a766913 100644 --- a/src/layui/layui/layLayoutViewConfigPages.cc +++ b/src/layui/layui/layLayoutViewConfigPages.cc @@ -207,7 +207,10 @@ LayoutViewConfigPage2a::setup (lay::Dispatcher *root) mp_ui->cell_xform_text_cbx->setChecked (flag); root->config_get (cfg_cell_box_visible, flag); - mp_ui->cell_group->setChecked (flag); + mp_ui->cell_boxes_visible->setChecked (flag); + + root->config_get (cfg_ghost_cells_visible, flag); + mp_ui->ghost_cells_visible->setChecked (flag); int font = 0; root->config_get (cfg_cell_box_text_font, font); @@ -247,7 +250,8 @@ LayoutViewConfigPage2a::commit (lay::Dispatcher *root) root->config_set (cfg_cell_box_text_transform, mp_ui->cell_xform_text_cbx->isChecked ()); root->config_set (cfg_cell_box_text_font, mp_ui->cell_font_cb->currentIndex ()); root->config_set (cfg_cell_box_color, mp_ui->cell_box_color_pb->get_color (), ColorConverter ()); - root->config_set (cfg_cell_box_visible, mp_ui->cell_group->isChecked ()); + root->config_set (cfg_cell_box_visible, mp_ui->cell_boxes_visible->isChecked ()); + root->config_set (cfg_ghost_cells_visible, mp_ui->ghost_cells_visible->isChecked ()); root->config_set (cfg_guiding_shape_visible, mp_ui->pcell_gs_group->isChecked ()); root->config_set (cfg_guiding_shape_line_width, mp_ui->pcell_gs_lw->value ());