-
Notifications
You must be signed in to change notification settings - Fork 169
Improve fade/animation behavior #1291
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
Conversation
8428eb3
to
4f55700
Compare
This seems to be ready now. The most noticeable change is the fades I listed above, which could be taken out if you guys don't like it. I'm on the fence at the moment. |
ef427d4
to
dd4e5b1
Compare
The crash is not related to this PR, I can reproduce it with 3.21.0 version too. Open batch processing window, select few files and close nomacs.
|
The edit panel loses color for bec4d79. |
The Settings tab seems to have fade enabled. I think the previous behavior (no fade) looks better. 2025-04-04.17-18-46.mp4 |
Batch process has the same issue. 2025-04-04.17-28-41.mp4 |
I am using system theme. |
Back to draft, I found some more issues with system theme. |
Fixed a regression from #1140. I think this is ready. |
DkPlayer broken as override of show() with default argument masks DkFadeMixin::show(). Rename this to showTemporarily() to prevent that. This matches the previous behavior except for these changes. 1) If the display mode is changed while playing, the player is not shown. The previous behavior was to show the player and it would not autohide unless restarting the slideshow. 2) The player controls (pause/play) cannot permanently affect the visibility of the player. If the user toggles the player visibility manually (P) then the change is saved.
This is a dialog so it doesn't make sense to use it here, also it has no effect.
The fade is obscured or cut off by showing of the dialog if the window manager animates showing the dialog. Also it is the only widget in the dialog so it isn't transitioning from anything which doesn't make sense.
It is dead code as it was always hidden from view. DkFileInfoLabel has taken over this function and can in the future provide an option to toggle what info is displayed (current file name, date, and star rating)
block() is now dead due to removal of DkRatingLabelBg which was also dead
child of DkFileInfoLabel which is faded already, so this does nothing
definition of virtual hide() makes a conflict with DkFadeMixin because it also declares hide() with one default argument. It is also a conflict with QWidget::hide() as that is not virtual. There is no reason to mask hide()/show() in Qt, as these are not virtual it can cause bugs. The correct method is to override setVisible(bool) which is virtual.
MSVC type resolution seems to be different than gcc/clang so try it another way
always visible so they never fade
Support disabling animations on a per-widget basis. This is desireable when reusing widgets in different contexts e.g. DkThumbScrollWidget. Also disable animations if the parent is animating, which could cause a visual glitch or at best has no effect. Also adds tighter control of timer by using QTimerEvent instead of QTimer.
enter/exit fullscreen uses it to make transition smoother; the hide/show of panels can make panels change position immediately after the animation completes, which looks bad
only possible if plugins are disabled
The other widgets in the tab don't fade so this shouldn't either
don't use the same setting for disabling animation for user and temporarily as it could cause unexpected change of user setting
prevents glitch where layout changes shortly after switch due to widgets becoming hidden, which does not happen until animation ends, which is some time after the switch finishes this also disables animation for the initial startup of nomacs; as the window manager is probably fading in the window anyways we don't want to pile on more animations.
There are some pitfalls when overriding DkFadeMixin::setVisible() due to the recursion through QWidget::setVisible, see comment @ DkFadeMixin::setVisible. Infinite recursion is not possible, but the function body may be executed multiple times per call to setVisible() Currently, none of this is strictly required but in the future it would likely result in bugs.
restores previous behavior
Broken by removal of fade. Was reliant on paint hack in DkFadeWidget. Move the paint hack into DkWidget so it will be used again.
Reverts to previous behavior before refactoring fadewidget
On the system theme, when thumbs grid view is displayed, the background shows through on some widgets. This is most apparent when the thumbnail ribbon is pinned to the top. This is a regression since theme overall PR#1140
We should not be using DkSettings for flags such as this which are not user-modifyable.
Move old functionality into DkRatingLabel so actions work again. Also remove some clutter. - unecessary virtual - excessive inline (inline containing a loop) - use lambdas instead of trival methods - use table/loop to make stars
In this PR I am aiming to improve the fade/animation part of nomacs UI with a couple of objectives.
TODO: Decide if we should be fading things we did not before. The following are now fading because behavior was masked before. I think I am ok with all of this but the animation could be a bit quicker
Full list of widgets now fading:
