mirror of https://github.com/KLayout/klayout.git
Maybe fixing icon issue on MacOS
This commit is contained in:
parent
1e8321d8fb
commit
ec2c160792
|
|
@ -707,6 +707,12 @@ LayerSelectionComboBox::do_update_layer_list ()
|
|||
int icon_width = iconSize ().width ();
|
||||
int icon_height = iconSize ().height ();
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
double dpr = devicePixelRatio ();
|
||||
#else
|
||||
double dpr = 1.0;
|
||||
#endif
|
||||
|
||||
LPIPairCompareOp cmp_op;
|
||||
std::map<std::pair<db::LayerProperties, int>, std::string, LPIPairCompareOp> name_for_layer (cmp_op);
|
||||
std::map<std::pair<db::LayerProperties, int>, QIcon, LPIPairCompareOp> icon_for_layer;
|
||||
|
|
@ -715,7 +721,7 @@ LayerSelectionComboBox::do_update_layer_list ()
|
|||
if (lp->cellview_index () == mp_private->cv_index && ! lp->has_children () && (mp_private->all_layers || lp->layer_index () >= 0) && lp->source (true).layer_props () != db::LayerProperties ()) {
|
||||
std::pair <db::LayerProperties, int> k (lp->source (true).layer_props (), lp->layer_index ());
|
||||
name_for_layer.insert (std::make_pair (k, lp->display_string (mp_private->view, true, true /*always show source*/)));
|
||||
QIcon icon = QIcon (QPixmap::fromImage (mp_private->view->icon_for_layer (lp, icon_width, icon_height).to_image ()));
|
||||
QIcon icon = QIcon (QPixmap::fromImage (mp_private->view->icon_for_layer (lp, icon_width, icon_height, dpr, 0, true).to_image ()));
|
||||
icon_for_layer.insert (std::make_pair (k, icon));
|
||||
mp_private->layers.push_back (k);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue