Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
1.97k stars 442 forks source link

Fix: tabs move animation for duplicated tabs #5426

Closed kornes closed 1 month ago

kornes commented 1 month ago

Repro steps

  1. duplicate a tab which is not last
  2. close duplicated tab (might require 2 attempts)
  3. removed tab will leave blank gap, following tab wont start animation to blank space

Issue positionChangedAnimation_ (QAbstractAnimation) for tabs is kept between animations, if endValue() of previously run animation match current targetPos - animation won't fire even though it should because current starting position might be different. This results in a gap which will stay until next notebook layout happen (where all tabs are moved again without animation). There are also a lot of unnecessary Notebook layouts (like creating new tab results in 5x layouts of whole notebook) so that's something to fix too.

Fix

  1. endValue for animation is now only checked for running animations (adf0458b8bcaa0d749f650e431822e1c91c316c5)
  2. returning early when move is not needed also fixes the problem alone (72f48b9e80288be941aff503dea5eaf9fe033472)

added some minor refactors too