Skip to content

Commit ec2c160

Browse files
author
Matthias Koefferlein
committed
Maybe fixing icon issue on MacOS
1 parent 1e8321d commit ec2c160

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/layui/layui/layWidgets.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,12 @@ LayerSelectionComboBox::do_update_layer_list ()
707707
int icon_width = iconSize ().width ();
708708
int icon_height = iconSize ().height ();
709709

710+
#if QT_VERSION >= 0x050000
711+
double dpr = devicePixelRatio ();
712+
#else
713+
double dpr = 1.0;
714+
#endif
715+
710716
LPIPairCompareOp cmp_op;
711717
std::map<std::pair<db::LayerProperties, int>, std::string, LPIPairCompareOp> name_for_layer (cmp_op);
712718
std::map<std::pair<db::LayerProperties, int>, QIcon, LPIPairCompareOp> icon_for_layer;
@@ -715,7 +721,7 @@ LayerSelectionComboBox::do_update_layer_list ()
715721
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 ()) {
716722
std::pair <db::LayerProperties, int> k (lp->source (true).layer_props (), lp->layer_index ());
717723
name_for_layer.insert (std::make_pair (k, lp->display_string (mp_private->view, true, true /*always show source*/)));
718-
QIcon icon = QIcon (QPixmap::fromImage (mp_private->view->icon_for_layer (lp, icon_width, icon_height).to_image ()));
724+
QIcon icon = QIcon (QPixmap::fromImage (mp_private->view->icon_for_layer (lp, icon_width, icon_height, dpr, 0, true).to_image ()));
719725
icon_for_layer.insert (std::make_pair (k, icon));
720726
mp_private->layers.push_back (k);
721727
}

0 commit comments

Comments
 (0)