File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -677,8 +677,14 @@ def _icon(self, name):
677
677
Construct a `.QIcon` from an image file *name*, including the extension
678
678
and relative to Matplotlib's "images" data directory.
679
679
"""
680
- name = name .replace ('.png' , '_large.png' )
681
- pm = QtGui .QPixmap (str (cbook ._get_data_path ('images' , name )))
680
+ # use a high-resolution icon with suffix '_large' if available
681
+ # note: user-provided icons may not have '_large' versions
682
+ path_regular = cbook ._get_data_path ('images' , name )
683
+ path_large = path_regular .with_name (
684
+ path_regular .name .replace ('.png' , '_large.png' ))
685
+ filename = str (path_large if path_large .exists () else path_regular )
686
+
687
+ pm = QtGui .QPixmap (filename )
682
688
_setDevicePixelRatio (pm , _devicePixelRatioF (self ))
683
689
if self .palette ().color (self .backgroundRole ()).value () < 128 :
684
690
icon_color = self .palette ().color (self .foregroundRole ())
You can’t perform that action at this time.
0 commit comments