-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: tabs move animation for duplicated tabs #5426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -407,30 +408,32 @@ void NotebookTab::hideTabXChanged() | |||
this->update(); | |||
} | |||
|
|||
void NotebookTab::moveAnimated(QPoint pos, bool animated) | |||
void NotebookTab::moveAnimated(QPoint targetPos, bool animated) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "QPoint" is directly included [misc-include-cleaner]
src/widgets/helper/NotebookTab.cpp:26:
+ #include <qpoint.h>
return; | ||
} | ||
|
||
if (this->positionChangedAnimation_.endValue() == pos) | ||
if (this->positionChangedAnimation_.state() == | ||
QAbstractAnimation::Running && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "QAbstractAnimation" is directly included [misc-include-cleaner]
src/widgets/helper/NotebookTab.cpp:26:
+ #include <qabstractanimation.h>
@@ -65,7 +65,7 @@ class NotebookTab : public Button | |||
void setHighlightsEnabled(const bool &newVal); | |||
bool hasHighlightsEnabled() const; | |||
|
|||
void moveAnimated(QPoint pos, bool animated = true); | |||
void moveAnimated(QPoint targetPos, bool animated = true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "QPoint" is directly included [misc-include-cleaner]
src/widgets/helper/NotebookTab.hpp:10:
+ #include <qpoint.h>
Repro steps
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
endValue
for animation is now only checked for running animations (adf0458)added some minor refactors too