Jump to content

Recommended Posts

Posted

У компоненты TunimPanel можно включить в заголовке кнопку сворачивания/разворачивания панели. Это свойства Collapsible и CollapseDirection.

Так вот, эффект сворачивания/разворачивания не очень приятный визуально, т.к. панель или заголовок мелькает через весь экран особенно, если панель находится внизу экрана. Т.е. как будто-то панель быстро падает сверху вниз или подпрыгивает вверх, что создает неприятное мелькание на экране.

Нельзя ли как-то упростить эффект, чтобы панель просто на месте сворачивалась/разворачивалась, чтобы панель никуда не улетала, не падала, и не подпрыгивала?

Спасибо.

Posted
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;

 

  • Like 1
  • 4 months later...
Posted
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.

  • 2 years later...
Posted

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 ?

Posted

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.

Posted
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?

Posted
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.

Posted
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;

 

Posted

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. 

image.png.1696cbe520d3dae9677378f85a3c8f59.png

Posted
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...

  • Like 1
Posted

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;

 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...