mirror of https://github.com/KLayout/klayout.git
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:
parent
0016710573
commit
19dc5e8edb
|
|
@ -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, "?"));
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>631</width>
|
||||
<height>320</height>
|
||||
<width>656</width>
|
||||
<height>397</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -21,13 +21,33 @@
|
|||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="cell_group">
|
||||
<property name="title">
|
||||
<widget class="QCheckBox" name="cell_boxes_visible">
|
||||
<property name="text">
|
||||
<string>Show cell boxes</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ghost_cells_visible">
|
||||
<property name="text">
|
||||
<string>Show unresolved references (ghost cells) </string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="cell_group">
|
||||
<property name="title">
|
||||
<string>Cell box appearance</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
|
|
|
|||
|
|
@ -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 ());
|
||||
|
|
|
|||
Loading…
Reference in New Issue