x11 Posted September 28, 2020 Posted September 28, 2020 У компоненты TunimPanel можно включить в заголовке кнопку сворачивания/разворачивания панели. Это свойства Collapsible и CollapseDirection. Так вот, эффект сворачивания/разворачивания не очень приятный визуально, т.к. панель или заголовок мелькает через весь экран особенно, если панель находится внизу экрана. Т.е. как будто-то панель быстро падает сверху вниз или подпрыгивает вверх, что создает неприятное мелькание на экране. Нельзя ли как-то упростить эффект, чтобы панель просто на месте сворачивалась/разворачивалась, чтобы панель никуда не улетала, не падала, и не подпрыгивала? Спасибо. Quote
Sherzod Posted September 29, 2020 Posted September 29, 2020 On 9/28/2020 at 12:03 PM, x11 said: Нельзя ли как-то упростить эффект, чтобы панель просто на месте сворачивалась/разворачивалась, чтобы панель никуда не улетала, не падала, и не подпрыгивала? procedure TMainmForm.UnimFormCreate(Sender: TObject); begin with UnimPanel1 do if Collapsible then JSInterface.JSAddListener('painted', 'function(){this.getCollapsible().setAnimation(null)}'); end; 1 Quote
55143681 Posted February 22, 2021 Posted February 22, 2021 On 9/29/2020 at 10:29 PM, Sherzod said: procedure TMainmForm.UnimFormCreate(Sender: TObject); begin with UnimPanel1 do if Collapsible then JSInterface.JSAddListener('painted', 'function(){this.getCollapsible().setAnimation(null)}'); end; Sorry,No effects. Quote
Sherzod Posted February 22, 2021 Posted February 22, 2021 1 hour ago, 55143681 said: Sorry,No effects. Should work, check again please. Quote
55143681 Posted February 22, 2021 Posted February 22, 2021 3 hours ago, Sherzod said: Should work, check again please. No,it works well. thanks a lot. Quote
PS1 Posted January 11, 2024 Posted January 11, 2024 It works well, but not when i assign property collapsed = true in design. if i do this, it animate collapse on show of the form. Is there any solution for this ? Quote
Sherzod Posted January 11, 2024 Posted January 11, 2024 58 minutes ago, PS1 said: if i do this, it animate collapse on show of the form. Can you please explain in more detail? Quote
PS1 Posted January 11, 2024 Posted January 11, 2024 Yes. The solution works ok when panel at design time have property "collapsed" set to false. But when you set collapsed = true, it starts animation of collapsing when you show the form. Even without this solution unimpanel is doing it ^. To test this you can just add unimpanel on form, and set collapsible=true and collapsed=true. Quote
Sherzod Posted January 11, 2024 Posted January 11, 2024 5 hours ago, PS1 said: To test this you can just add unimpanel on form, and set collapsible=true and collapsed=true. Are you checking on a mobile device? Quote
Sherzod Posted January 12, 2024 Posted January 12, 2024 19 hours ago, PS1 said: The solution works ok when panel at design time have property "collapsed" set to false. But when you set collapsed = true, it starts animation of collapsing when you show the form. I couldn't reproduce, works for me. Quote
PS1 Posted January 12, 2024 Posted January 12, 2024 Sorry for my mistake, u need to create new form and there you should put unimpanel. I attach testCase project. testCase_UnimPanel_collapse.zip Quote
Sherzod Posted January 12, 2024 Posted January 12, 2024 4 hours ago, PS1 said: testCase_UnimPanel_collapse.zip 94.3 kB · 0 downloads As a workaround for now, try this: procedure TUnimForm2.UnimFormCreate(Sender: TObject); begin with UnimPanel1 do if Collapsible then ClientEvents.UniEvents.Values['afterCreate'] := 'function afterCreate(sender){sender.getCollapsible().setAnimation(null)}'; end; Quote
PS1 Posted January 12, 2024 Posted January 12, 2024 ok, it works. But in a meantime i found a bug. if you click on the ARROW on the panel's title it expands correctly, but if you click on panel's TITLE it expands like in image below. You can test it on the previous testcase. Quote
Sherzod Posted January 12, 2024 Posted January 12, 2024 51 minutes ago, PS1 said: if you click on the ARROW on the panel's title it expands correctly, but if you click on panel's TITLE it expands like in image below. Ok, I have a workaround I will post now... 1 Quote
Sherzod Posted January 12, 2024 Posted January 12, 2024 Try this solution for all UnimPanels, and for both cases: 1. unit MainModule; 2. uses ..., unimPanel; 3. OnNewComponent event -> procedure TUniMainModule.UniGUIMainModuleNewComponent(AComponent: TComponent); var PnlJSName: string; begin if (AComponent is TUnimPanel) then begin PnlJSName := (AComponent as TUnimPanel).JSName; UniSession.JSCode( ' try {'+ PnlJSName + '.setTitleCollapse(true);'+ PnlJSName + '.getCollapsible().setAnimation(null);'+ ' }'+ ' catch(err){};' ); end; end; 1 Quote
Sherzod Posted January 12, 2024 Posted January 12, 2024 We will try to fix this in future versions and let you know. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.