mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-01 18:37:50 +02:00
WIP: lib-browser - icons for lib cells.
This commit is contained in:
@@ -737,6 +737,17 @@ CellTreeModel::data (const QModelIndex &index, int role) const
|
||||
return QVariant ();
|
||||
#endif
|
||||
|
||||
} else if (role == Qt::DecorationRole && (m_flags & WithIcons) != 0) {
|
||||
|
||||
// TODO: icons for normal cells too?
|
||||
if (item->is_pcell ()) {
|
||||
QIcon icon (":/setup.png");
|
||||
return QVariant (icon);
|
||||
} else {
|
||||
QIcon icon (":/instance.png");
|
||||
return QVariant (icon);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
return QVariant ();
|
||||
|
||||
@@ -67,7 +67,8 @@ public:
|
||||
TopCells = 8, // show top cells only
|
||||
BasicCells = 16, // show basic cells (PCells included, no proxies)
|
||||
WithVariants = 32, // show PCell variants below PCells
|
||||
NoPadding = 64 // disable padding of display string with a blank at the beginning and end
|
||||
WithIcons = 64, // show icons for the top level cell type
|
||||
NoPadding = 128 // disable padding of display string with a blank at the beginning and end
|
||||
};
|
||||
|
||||
enum Sorting {
|
||||
|
||||
@@ -790,7 +790,7 @@ LibrariesView::do_update_content (int lib_index)
|
||||
|
||||
LibraryTreeWidget *cell_list = new LibraryTreeWidget (cl_frame, "tree", mp_view->view_object_widget ());
|
||||
cl_ly->addWidget (cell_list);
|
||||
cell_list->setModel (new CellTreeModel (cell_list, m_libraries [i].get (), CellTreeModel::Flat | CellTreeModel::TopCells | CellTreeModel::BasicCells | CellTreeModel::WithVariants, 0));
|
||||
cell_list->setModel (new CellTreeModel (cell_list, m_libraries [i].get (), CellTreeModel::Flat | CellTreeModel::TopCells | CellTreeModel::BasicCells | CellTreeModel::WithVariants | CellTreeModel::WithIcons, 0));
|
||||
cell_list->setUniformRowHeights (true);
|
||||
|
||||
pl = cell_list->palette ();
|
||||
@@ -865,7 +865,7 @@ LibrariesView::do_update_content (int lib_index)
|
||||
|
||||
CellTreeModel *model = dynamic_cast <CellTreeModel *> (mp_cell_lists [i]->model ());
|
||||
if (model) {
|
||||
model->configure (m_libraries [i].get (), CellTreeModel::Flat | CellTreeModel::TopCells | CellTreeModel::BasicCells | CellTreeModel::WithVariants, 0);
|
||||
model->configure (m_libraries [i].get (), CellTreeModel::Flat | CellTreeModel::TopCells | CellTreeModel::BasicCells | CellTreeModel::WithVariants | CellTreeModel::WithIcons, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user