Jump to content

Image in UniPanel1.Title


artem_niko

Recommended Posts

1 minute ago, Sherzod said:

Try this approach:


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniPanel1 do
    if TitleVisible then
      JSInterface.JSConfig('icon', [UniImageList1.GetImageIconUrl(0)])
end;

 

Ok, this is if I will be use UniImageList...

And how about load icon from file?

Link to comment
Share on other sites

50 minutes ago, Sherzod said:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniPanel5 do
    if TitleVisible then
      JSInterface.JSConfig('icon', ['files/filename.ico'])
end;

 

Ok, it's work, but, size of icon not full, if title have two rows:

image.png.2eb03fc6e12ef0fa17a42ce1cebaf486.png

How set size of icon?

Link to comment
Share on other sites

8 minutes ago, Артем said:

How?

For example:

1. 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniPanel1 do
    if TitleVisible then
    begin
      JSInterface.JSConfig('icon', ['files/truck.ico']);
      JSInterface.JSConfig('iconCls', ['panelIconCls']);
    end;
end;

2. CustomCSS:

.panelIconCls {
  background-size: 100% auto;
}

 

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