From 574c9ef66e9ce1de2d3811c26d463f0e78ecdc13 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 17 Apr 2019 09:54:52 +0200 Subject: [PATCH] svg button works as it should work --- .../standalonepublish/widgets/button_from_svgs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pype/tools/standalonepublish/widgets/button_from_svgs.py b/pype/tools/standalonepublish/widgets/button_from_svgs.py index aeeeae5c7a..3a35bcd838 100644 --- a/pype/tools/standalonepublish/widgets/button_from_svgs.py +++ b/pype/tools/standalonepublish/widgets/button_from_svgs.py @@ -87,9 +87,13 @@ class SvgButton(QtWidgets.QFrame): self.mousePressEvent(event) return False - def change_checked(self, in_bool=False): + def change_checked(self, hover=True): if self.checkable: - self.checked = in_bool + self.checked = not self.checked + if hover: + self.hoverEnterEvent() + else: + self.hoverLeaveEvent() def hoverEnterEvent(self, event=None): color = self.c_hover @@ -104,6 +108,4 @@ class SvgButton(QtWidgets.QFrame): self.svg_widget.change_color(color) def mousePressEvent(self, event=None): - self.change_checked(not self.checked) - self.hoverEnterEvent() self.clicked.emit()