Skip to content

Commit

Permalink
Revert "refactor: impl hover and click animation of SiPushButton ba…
Browse files Browse the repository at this point in the history
…sed on `paintEvent`"
  • Loading branch information
ChinaIceF authored Oct 25, 2024
1 parent a2e442f commit bf08c38
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, *args, **kwargs):

self.background = SiLabel(self)
self.background.setFixedStyleSheet("border-radius: 8px")
self.background.setColor(SiColor.trans(self.getColor(SiColor.INTERFACE_BG_A), 0.8))
self.background.setColor("#E0202020")

def resizeEvent(self, event):
super().resizeEvent(event)
Expand Down Expand Up @@ -64,15 +64,14 @@ def __init__(self, *args, **kwargs):
self.container.addPlaceholder(16)
self.container.addWidget(self.div)
self.container.addPlaceholder(10)
self.container.addPlaceholder(16, side="bottom")
self.container.addWidget(self.tip, side="bottom")
self.container.addWidget(self.tip)

self.setAttachment(self.container)

self.fade_out_timer = QTimer(self)
self.fade_out_timer.setSingleShot(True)
self.fade_out_timer.setInterval(2000)
self.fade_out_timer.timeout.connect(lambda: self.expandTo(0.8))
self.fade_out_timer.timeout.connect(lambda: self.expandTo(0))
self.fade_out_timer.timeout.connect(lambda: self.setOpacityTo(0))

self.animationGroup().fromToken("expand").setAccelerateFunction(lambda x: (x / 10) ** 5)
Expand Down

0 comments on commit bf08c38

Please sign in to comment.