x11 Posted September 28, 2020 Share Posted September 28, 2020 У компоненты TunimPanel можно включить в заголовке кнопку сворачивания/разворачивания панели. Это свойства Collapsible и CollapseDirection. Так вот, эффект сворачивания/разворачивания не очень приятный визуально, т.к. панель или заголовок мелькает через весь экран особенно, если панель находится внизу экрана. Т.е. как будто-то панель быстро падает сверху вниз или подпрыгивает вверх, что создает неприятное мелькание на экране. Нельзя ли как-то упростить эффект, чтобы панель просто на месте сворачивалась/разворачивалась, чтобы панель никуда не улетала, не падала, и не подпрыгивала? Спасибо. Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2020 Share 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 Link to comment Share on other sites More sharing options...
55143681 Posted February 22, 2021 Share 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. Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2021 Share Posted February 22, 2021 1 hour ago, 55143681 said: Sorry,No effects. Should work, check again please. Link to comment Share on other sites More sharing options...
55143681 Posted February 22, 2021 Share Posted February 22, 2021 3 hours ago, Sherzod said: Should work, check again please. No,it works well. thanks a lot. Link to comment Share on other sites More sharing options...
PS1 Posted January 11 Share Posted January 11 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 ? Link to comment Share on other sites More sharing options...
Sherzod Posted January 11 Share Posted January 11 58 minutes ago, PS1 said: if i do this, it animate collapse on show of the form. Can you please explain in more detail? Link to comment Share on other sites More sharing options...
PS1 Posted January 11 Share Posted January 11 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. Link to comment Share on other sites More sharing options...
Sherzod Posted January 11 Share Posted January 11 Ok, I will try to check. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted January 11 Share Posted January 11 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? Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 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. Link to comment Share on other sites More sharing options...
PS1 Posted January 12 Share Posted January 12 Sorry for my mistake, u need to create new form and there you should put unimpanel. I attach testCase project. testCase_UnimPanel_collapse.zip Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 Ok, no problem. I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 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; Link to comment Share on other sites More sharing options...
PS1 Posted January 12 Share Posted January 12 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. Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 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 Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 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 Link to comment Share on other sites More sharing options...
PS1 Posted January 12 Share Posted January 12 It works ! Thanks a lot. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 We will try to fix this in future versions and let you know. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now