MCPcopy Create free account
hub / github.com/KLayout/klayout / update_title

Method update_title

src/laybasic/laybasic/layLayoutViewBase.cc:722–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722void
723LayoutViewBase::update_title ()
724{
725 if (! m_title.empty ()) {
726
727 if (m_title != m_current_title) {
728 m_current_title = m_title;
729 emit_title_changed ();
730 }
731
732 } else if (cellviews () == 0) {
733
734 static std::string empty_title = tl::to_string (tr ("<empty>"));
735 if (m_current_title != empty_title) {
736 m_current_title = empty_title;
737 emit_title_changed ();
738 }
739
740 } else {
741
742 int cv_index = active_cellview_index ();
743 if (cv_index < 0 || cv_index >= int (cellviews ())) {
744 cv_index = 0;
745 }
746
747 const lay::CellView &cv0 = cellview (cv_index);
748
749 std::string t;
750
751 t += cv0->name ();
752 if (cv0->layout ().is_valid_cell_index (cv0.cell_index ())) {
753 t += " [";
754 t += cv0->layout ().cell_name (cv0.cell_index ());
755 t += "]";
756 }
757
758 if (cellviews () > 1) {
759 t += " ...";
760 }
761
762 if (t != m_current_title) {
763 m_current_title = t;
764 emit_title_changed ();
765 }
766 }
767}
768
769void
770LayoutViewBase::set_title (const std::string &t)

Callers

nothing calls this directly

Calls 10

cellviewsFunction · 0.85
is_valid_cell_indexMethod · 0.80
emit_title_changedFunction · 0.70
to_stringFunction · 0.50
trFunction · 0.50
emptyMethod · 0.45
nameMethod · 0.45
layoutMethod · 0.45
cell_indexMethod · 0.45
cell_nameMethod · 0.45

Tested by

no test coverage detected