Calling animatedHide() on a not yet shown KMessageWidget instance was
ignored when the parent
And instant counter-direction updates (like it can happen due to complicated signal
handling on UI updates) resulted in the last calls being ignored,
so an instant hide after a show or an instant show after a hide were
ineffective, resulting in wrong messages or wrongly no messages shown.
Details
- Reviewers
dhaumann - Group Reviewers
Frameworks - Commits
- R236:ec02ee4b85a4: KMessageWidget: fix behaviour on overlapping calls of animatedShow/animatedHide
Works now in WIP KDevelop code,
and new unit tests no longer fail.
Diff Detail
- Repository
- R236 KWidgetsAddons
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
First of all a general note: Unfortunately, we have had quite some issues with getting the geometry right in KMessageWidget over the past few years. Essentially, the problem is that KMessageWidgets animates its show and hide events, and therefore caches its initial and its final geometry, as well as the pixmap to render to avoid stretching the KMessageWidget's contents. That said, doing this caching too early results in a final geometry that is wrong (we had this issue in Kate a lot).
This may sound a bit off-topic, but the point is: it's easy to break things. If you in addition also run the unit test 'messagetest' of KTextEditor and if it passes, then I'm fine with this change. It looks reasonable after all :-)
messagetest for me always ran with this result:
Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted, 3603ms
Though I had to hack into KTextEditor to make it actually also call animatedShow & animatedHide(), to test if there is any effect ;)
true -> false here in KTextEditor::ViewPrivate::postMessage(...):
m_floatTopMessageWidget = new KateMessageWidget(m_viewInternal, false);
KTextEditor uses KMessageWidget 4 times: floating inside on top right or bottom right. This is what you hacked.
And 2 times above and below. These two times use the animation, but given the unit test runs fine, I think this is ok.