Fix two bugs in KMessageWidget

Authored by aacid on Aug 15 2018, 8:45 AM.

Description

Fix two bugs in KMessageWidget

Summary:
Bug #1: If you call show() or setVisible() after animatedHide() nothing would happen

This is because animatedHide() does
d->content->move(0, -d->content->height());
so it's moving the contents outside the view. To fix that we watch the Show event
and if the height or the contents position are not the "correct" ones we set them.
There's an exception for that which is when show comes from animatedShow() so we
use a guard variable for that.

Also added a test for this

Bug #2: If you call animatedShow() while animation for animatedHide() was running things would break

This is because animationShow() did: If hideAnimmation running, stop it,
then if visible and no animation running, asume we're done. The problem is that isVisible is not
enough for "it's totally visible", now we also check for height and content pos to be the fully
visible one before saying it's done and doing an early return.

There was a test for this already, but the test wasn't good enough since it was only checking for
visible and not for height and content position.

Along with this i also improved the tests making the visible/not visible checks more thorough
and replacing some busy waits with QTRY_VERIFY

Test Plan:
Tests pass
Now in okular the message widgets show correctly after calling show() on them after the user pressed the [x]

Reviewers: Frameworks, dhaumann

Reviewed By: dhaumann

Subscribers: kde-frameworks-devel, ngraham, dhaumann, anthonyfieroni, Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D8964

Details

Committed
aacidAug 15 2018, 9:03 AM
Reviewer
dhaumann
Differential Revision
D8964: Fix two bugs in KMessageWidget
Parents
R236:14f0fa753e77: GIT_SILENT Upgrade KF5 version to 5.50.0.
Branches
Unknown
Tags
Unknown