Jump to content

Выпадающее мобильное меню для unimToolbar


x11

Recommended Posts

On 12/10/2021 at 5:07 PM, x11 said:

прошло уже полгода....

так как же все-таки сделать меню шире?

procedure TMainmForm.UnimFormReady(Sender: TObject);
begin
  ...

  with UnimToolButton1.JSInterface do
  begin
    JSConfig('arrow', [False]);
    JSConfig('iconCls', ['fas fa-sort']);
    JSCall('setMenu', [JSArray([UnimRadio1.JSControl, UnimRadio2.JSControl])]);
    JSCode(#1'.getMenu().on("beforeshow", function(){this.setMinWidth(300)});'); //<--------
  end;
end;

 

  • Thanks 1
Link to comment
Share on other sites

On 12/10/2021 at 5:29 PM, x11 said:

как указать Cls для выпадающего меню?

Например, чтобы потом можно было поменять цвет выпадающего меню и др. свойства.

К примеру:

1. 

procedure TMainmForm.UnimFormReady(Sender: TObject);
begin
  ...
  with UnimToolButton1.JSInterface do
  begin
    ...
    JSCode(#1'.getMenu().on("beforeshow", function(){this.setCls("customMenu"); this.setMinWidth(300)});');
  end;
end;

2. CustomCSS

.customMenu .x-body-el {
  background: green;
}

.customMenu .x-label-el {
  color: white;
}

 

  • Thanks 1
Link to comment
Share on other sites

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