Skip to content

Commit

Permalink
Set mouse event transparency on ItemThumbs (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel authored Jun 12, 2024
1 parent 9b13e33 commit 37ff35f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tagstudio/src/qt/widgets/item_thumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,15 @@ def __init__(

def set_mode(self, mode: Optional[ItemType]) -> None:
if mode is None:
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, True)
self.unsetCursor()
self.thumb_button.setHidden(True)
# self.check_badges.setHidden(True)
# self.ext_badge.setHidden(True)
# self.item_type_badge.setHidden(True)
pass
elif mode == ItemType.ENTRY and self.mode != ItemType.ENTRY:
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, False)
self.setCursor(Qt.CursorShape.PointingHandCursor)
self.thumb_button.setHidden(False)
self.cb_container.setHidden(False)
Expand All @@ -327,6 +329,7 @@ def set_mode(self, mode: Optional[ItemType]) -> None:
self.count_badge.setHidden(True)
self.ext_badge.setHidden(True)
elif mode == ItemType.COLLATION and self.mode != ItemType.COLLATION:
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, False)
self.setCursor(Qt.CursorShape.PointingHandCursor)
self.thumb_button.setHidden(False)
self.cb_container.setHidden(True)
Expand All @@ -335,6 +338,7 @@ def set_mode(self, mode: Optional[ItemType]) -> None:
self.count_badge.setHidden(False)
self.item_type_badge.setHidden(False)
elif mode == ItemType.TAG_GROUP and self.mode != ItemType.TAG_GROUP:
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, False)
self.setCursor(Qt.CursorShape.PointingHandCursor)
self.thumb_button.setHidden(False)
# self.cb_container.setHidden(True)
Expand Down

0 comments on commit 37ff35f

Please sign in to comment.