From 4b50a09a4c835c23ff0ff389e976f2539d41f61b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 20 May 2021 14:30:24 +0300 Subject: Added a preference variable for UI animations Not yet in the UI, though. --- src/prefs.c | 1 + src/prefs.h | 1 + src/ui/mobile.c | 16 +++++++++------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/prefs.c b/src/prefs.c index e6eba2a6..96fa3c59 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -33,6 +33,7 @@ void init_Prefs(iPrefs *d) { d->accent = cyan_ColorAccent; d->customFrame = iFalse; /* needs some more work to be default */ d->retainWindowSize = iTrue; + d->uiAnimations = iTrue; d->uiScale = 1.0f; /* default set elsewhere */ d->zoomPercent = 100; d->sideIcon = iTrue; diff --git a/src/prefs.h b/src/prefs.h index 0f604ee2..5c01ebda 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -47,6 +47,7 @@ struct Impl_Prefs { enum iColorAccent accent; iBool customFrame; /* when LAGRANGE_ENABLE_CUSTOM_FRAME is defined */ iBool retainWindowSize; + iBool uiAnimations; float uiScale; int zoomPercent; iBool sideIcon; diff --git a/src/ui/mobile.c b/src/ui/mobile.c index d678f3e1..263fc141 100644 --- a/src/ui/mobile.c +++ b/src/ui/mobile.c @@ -788,13 +788,15 @@ void setupMenuTransition_Mobile(iWidget *sheet, iBool isIncoming) { void setupSheetTransition_Mobile(iWidget *sheet, iBool isIncoming) { if (!useMobileSheetLayout_()) { - setFlags_Widget(sheet, horizontalOffset_WidgetFlag, iFalse); - if (isIncoming) { - setVisualOffset_Widget(sheet, -height_Widget(sheet), 0, 0); - setVisualOffset_Widget(sheet, 0, 200, easeOut_AnimFlag | softer_AnimFlag); - } - else { - setVisualOffset_Widget(sheet, -height_Widget(sheet), 200, easeIn_AnimFlag); + if (prefs_App()->uiAnimations) { + setFlags_Widget(sheet, horizontalOffset_WidgetFlag, iFalse); + if (isIncoming) { + setVisualOffset_Widget(sheet, -height_Widget(sheet), 0, 0); + setVisualOffset_Widget(sheet, 0, 200, easeOut_AnimFlag | softer_AnimFlag); + } + else { + setVisualOffset_Widget(sheet, -height_Widget(sheet), 200, easeIn_AnimFlag); + } } return; } -- cgit v1.2.3