Skip to content

Commit

Permalink
call get_icon to cast to QIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed May 16, 2020
1 parent 81bd680 commit c40a24f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msl/qt/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _create_menu(self):
self.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)

def _set_icon(self, icon, icon_size):
icon = io.get_icon(icon) # make sure that it's a QIcon
if icon_size is not None:
icon = io.rescale_icon(icon, icon_size)
self.setIconSize(icon.size())
Expand All @@ -149,7 +150,7 @@ def _set_icon(self, icon, icon_size):
if self.iconSize().width() < available.width() or \
self.iconSize().height() < available.height():
self.setIconSize(available)
self.setIcon(io.get_icon(icon))
self.setIcon(icon)


class ButtonMenu(QtWidgets.QMenu):
Expand Down

0 comments on commit c40a24f

Please sign in to comment.