WCAG: Add reduce_motion config, bridge property, OS detection
Config default, reduceMotion Q_PROPERTY on UIBridge, Windows SystemParametersInfo detection for prefers-reduced-motion.
This commit is contained in:
15
main.py
15
main.py
@@ -80,6 +80,21 @@ try:
|
||||
except:
|
||||
pass
|
||||
|
||||
# Detect Windows "Reduce Motion" preference
|
||||
try:
|
||||
import ctypes
|
||||
SPI_GETCLIENTAREAANIMATION = 0x1042
|
||||
animation_enabled = ctypes.c_bool(True)
|
||||
ctypes.windll.user32.SystemParametersInfoW(
|
||||
SPI_GETCLIENTAREAANIMATION, 0,
|
||||
ctypes.byref(animation_enabled), 0
|
||||
)
|
||||
if not animation_enabled.value:
|
||||
ConfigManager().data["reduce_motion"] = True
|
||||
ConfigManager().save()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Configure Logging
|
||||
class QmlLoggingHandler(logging.Handler, QObject):
|
||||
sig_log = Signal(str)
|
||||
|
||||
Reference in New Issue
Block a user