From 5d517c2f790a38d7fe3c3cc59a1b39fd49e20280 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 18 May 2021 06:57:18 +0300 Subject: SidebarWidget: Don't animate at launch --- src/app.c | 4 ++-- src/ui/sidebarwidget.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/app.c b/src/app.c index 27ce93ce..9697ee2b 100644 --- a/src/app.c +++ b/src/app.c @@ -420,8 +420,8 @@ static iBool loadState_App_(iApp *d) { if (deviceType_App() != phone_AppDeviceType) { setWidth_SidebarWidget(sidebar, widths[0]); setWidth_SidebarWidget(sidebar2, widths[1]); - if (flags & 1) postCommand_Root(root, "sidebar.toggle"); - if (flags & 2) postCommand_Root(root, "sidebar2.toggle"); + if (flags & 1) postCommand_Root(root, "sidebar.toggle noanim:1"); + if (flags & 2) postCommand_Root(root, "sidebar2.toggle noanim:1"); } } } diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 436eb250..cb6dab65 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -878,7 +878,8 @@ static iBool handleSidebarCommand_SidebarWidget_(iSidebarWidget *d, const char * if (arg_Command(cmd) && isVisible_Widget(w)) { return iTrue; } - const iBool isAnimated = (deviceType_App() != phone_AppDeviceType); + const iBool isAnimated = argLabel_Command(cmd, "noanim") == 0 && + (deviceType_App() != phone_AppDeviceType); int visX = 0; if (isVisible_Widget(w)) { visX = left_Rect(bounds_Widget(w)) - left_Rect(w->root->widget->rect); @@ -895,6 +896,7 @@ static iBool handleSidebarCommand_SidebarWidget_(iSidebarWidget *d, const char * } } else if (isAnimated) { + setFlags_Widget(w, horizontalOffset_WidgetFlag, iTrue); if (d->side == right_SideBarSide) { setVisualOffset_Widget(w, visX, 0, 0); setVisualOffset_Widget(w, visX + w->rect.size.x, 300, easeOut_AnimFlag | softer_AnimFlag); -- cgit v1.2.3