summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-20 14:30:24 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-20 14:30:24 +0300
commit4b50a09a4c835c23ff0ff389e976f2539d41f61b (patch)
tree49c076d28c518eb9573e8641d839cf40767d22c5
parente9ef84a9ef0ff65332071f8fbe8bd49f498324fe (diff)
Added a preference variable for UI animations
Not yet in the UI, though.
-rw-r--r--src/prefs.c1
-rw-r--r--src/prefs.h1
-rw-r--r--src/ui/mobile.c16
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) {
33 d->accent = cyan_ColorAccent; 33 d->accent = cyan_ColorAccent;
34 d->customFrame = iFalse; /* needs some more work to be default */ 34 d->customFrame = iFalse; /* needs some more work to be default */
35 d->retainWindowSize = iTrue; 35 d->retainWindowSize = iTrue;
36 d->uiAnimations = iTrue;
36 d->uiScale = 1.0f; /* default set elsewhere */ 37 d->uiScale = 1.0f; /* default set elsewhere */
37 d->zoomPercent = 100; 38 d->zoomPercent = 100;
38 d->sideIcon = iTrue; 39 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 {
47 enum iColorAccent accent; 47 enum iColorAccent accent;
48 iBool customFrame; /* when LAGRANGE_ENABLE_CUSTOM_FRAME is defined */ 48 iBool customFrame; /* when LAGRANGE_ENABLE_CUSTOM_FRAME is defined */
49 iBool retainWindowSize; 49 iBool retainWindowSize;
50 iBool uiAnimations;
50 float uiScale; 51 float uiScale;
51 int zoomPercent; 52 int zoomPercent;
52 iBool sideIcon; 53 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) {
788 788
789void setupSheetTransition_Mobile(iWidget *sheet, iBool isIncoming) { 789void setupSheetTransition_Mobile(iWidget *sheet, iBool isIncoming) {
790 if (!useMobileSheetLayout_()) { 790 if (!useMobileSheetLayout_()) {
791 setFlags_Widget(sheet, horizontalOffset_WidgetFlag, iFalse); 791 if (prefs_App()->uiAnimations) {
792 if (isIncoming) { 792 setFlags_Widget(sheet, horizontalOffset_WidgetFlag, iFalse);
793 setVisualOffset_Widget(sheet, -height_Widget(sheet), 0, 0); 793 if (isIncoming) {
794 setVisualOffset_Widget(sheet, 0, 200, easeOut_AnimFlag | softer_AnimFlag); 794 setVisualOffset_Widget(sheet, -height_Widget(sheet), 0, 0);
795 } 795 setVisualOffset_Widget(sheet, 0, 200, easeOut_AnimFlag | softer_AnimFlag);
796 else { 796 }
797 setVisualOffset_Widget(sheet, -height_Widget(sheet), 200, easeIn_AnimFlag); 797 else {
798 setVisualOffset_Widget(sheet, -height_Widget(sheet), 200, easeIn_AnimFlag);
799 }
798 } 800 }
799 return; 801 return;
800 } 802 }