Implemented #560 (multiple technologies on libraries) (#576)

* First implementation.

* PORT BACK: fixed a few flaws (fixed-width side panel ..)

1. On "save as" the filename displayed in the cell view selection box
   was not updated
2. The width of the library and cellview panel could not be reduced
   below the width of the combo boxes in the headers. So the
   panels might have become pretty wide without being able to reduce
   them.

* Implemented #560 (multiple techs on libraries)
This commit is contained in:
Matthias Köfferlein
2020-06-05 10:58:53 +02:00
committed by GitHub
parent 8db1e3577f
commit 852f5c438b
13 changed files with 499 additions and 226 deletions
@@ -213,6 +213,7 @@ HierarchyControlPanel::HierarchyControlPanel (lay::LayoutView *view, QWidget *pa
mp_selector = new QComboBox (this);
mp_selector->setObjectName (QString::fromUtf8 ("cellview_selection"));
mp_selector->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Fixed);
ly->addWidget (mp_selector);
mp_search_frame = new QFrame (this);
+2
View File
@@ -4739,6 +4739,8 @@ LayoutView::active_library_changed (int /*index*/)
void
LayoutView::cellview_changed (unsigned int index)
{
mp_hierarchy_panel->do_update_content (index);
cellview_changed_event (index);
if (m_title.empty ()) {
+5 -3
View File
@@ -210,7 +210,8 @@ LibrariesView::LibrariesView (lay::LayoutView *view, QWidget *parent, const char
ly->setContentsMargins (0, 0, 0, 0);
mp_selector = new QComboBox (this);
mp_selector->setObjectName (QString::fromUtf8 ("cellview_selection"));
mp_selector->setObjectName (QString::fromUtf8 ("library_selection"));
mp_selector->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Fixed);
ly->addWidget (mp_selector);
mp_search_frame = new QFrame (this);
@@ -771,9 +772,10 @@ LibrariesView::display_string (int n) const
if (! lib->get_description ().empty ()) {
text += " - " + lib->get_description ();
}
if (! lib->get_technology ().empty ()) {
if (lib->for_technologies ()) {
text += " ";
text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (lib->get_technology ())));
std::string tn = tl::join (std::vector<std::string> (lib->get_technologies ().begin (), lib->get_technologies ().end ()), ",");
text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (tn)));
}
return text;
}
+4 -3
View File
@@ -600,15 +600,16 @@ LibrarySelectionComboBox::update_list ()
for (db::LibraryManager::iterator l = db::LibraryManager::instance ().begin (); l != db::LibraryManager::instance ().end (); ++l) {
db::Library *lib = db::LibraryManager::instance ().lib (l->second);
if (! m_tech_set || lib->get_technology ().empty () || m_tech == lib->get_technology ()) {
if (! m_tech_set || !lib->for_technologies ()|| lib->is_for_technology (m_tech)) {
std::string item_text = lib->get_name ();
if (! lib->get_description ().empty ()) {
item_text += " - " + lib->get_description ();
}
if (m_tech_set && !lib->get_technology ().empty ()) {
if (m_tech_set && lib->for_technologies ()) {
item_text += " ";
item_text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (lib->get_technology ())));
std::string tn = tl::join (std::vector<std::string> (lib->get_technologies ().begin (), lib->get_technologies ().end ()), ",");
item_text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (tn)));
}
addItem (tl::to_qstring (item_text), QVariant ((unsigned int) lib->get_id ()));