diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-25 11:52:32 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-25 14:48:26 +0200 |
commit | f3a4b6e1d71ed40d84ef65c6626fb7eb77a13545 (patch) | |
tree | ff58ad9852ba565497f2fe4c937834c9c762d593 /vcl/qt5 | |
parent | e320460f9793608ef79aab402b3a03dc28ba7dd5 (diff) |
tdf#155414 kf a11y: Honor KDE Plasma setting to reduce animation
When using the kf5/kf6 VCL plugin on KDE Plasma, use the animation speed
setting to determine whether animations should be disabled, in line with
what is documented in MDN docs for Firefox using for the
"prefers-reduced-motion" CSS media feature [1] and how
kde-gtk-config maps that to the "gtk-enable-animations" setting [2].
The setting can be set as described in [2]:
> In Plasma/KDE: System Settings > Workspace Behavior -> General Behavior >
> "Animation speed" is set all the way to right to "Instant".
On top of
commit 9d68c794d67259a38de1465090f6f1e7fb588d62
Author: Patrick Luby <plubius@neooffice.org>
Date: Fri Jul 21 19:55:02 2023 -0400
tdf#155414 include system "reduce animation" preferences
, this basically implements the KF5/KDE Plasma equivalent of what that change does
for macOS.
Other than Gtk, Qt does not seem to have a general way to specify
that animations should be reduced/disabled, so evaluate
that based on the desktop environment instead, and implement
for KDE Plasma for the kf5/kf6 VCL plugin only for now, which is
probably the most common use case.
Logically, this would better fit in the qt5/qt6 VCL plugin
than the kf5/kf6 one, but do it in the KF-specific code to avoid
a dependency on KF5/KF6 libraries in qt5/qt6. (And other than
qt5/qt6, kf5/kf6 are auto-selected in Qt-based desktop environments,
so it shouldn't make much of a difference in practice.)
Another alternative - should the need aries - might be to move this
from the VCL plugin to the desktop backend (`shell/source/backends/kf5be/`
for the case of KDE Plasma 5.) and introduce a new property for that.
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
[2] https://docs.gtk.org/gtk4/property.Settings.gtk-enable-animations.html
[3] https://invent.kde.org/plasma/kde-gtk-config/-/blob/881ae01ad361a03396f7f327365f225ef87688e8/kded/gtkconfig.cpp#L205
Change-Id: I35cd6c2568a3716491581e51dfaeaf32cad454aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154888
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index 08d206261b88..0bd436266714 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -1349,6 +1349,8 @@ void QtFrame::ResolveWindowHandle(SystemEnvData& rData) const rData.SetWindowHandle(static_cast<QWidget*>(rData.pWidget)->winId()); } +bool QtFrame::GetUseReducedAnimation() const { return GetQtInstance()->GetUseReducedAnimation(); } + // Drag'n'drop foo void QtFrame::registerDragSource(QtDragSource* pDragSource) |