artem_niko Posted January 18, 2021 Share Posted January 18, 2021 Hello! How add image in UniPanel1.Title, where exist title text? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2021 Share Posted January 18, 2021 4 minutes ago, Артем said: How add image in UniPanel1.Title, where exist title text? Hello, And which image do you want to add? Maybe you want to add an icon? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted January 18, 2021 Author Share Posted January 18, 2021 2 minutes ago, Sherzod said: Maybe you want to add an icon? Yes, for example, let it be icon... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2021 Share Posted January 18, 2021 41 minutes ago, Артем said: let it be icon... Try this approach: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniPanel1 do if TitleVisible then JSInterface.JSConfig('icon', [UniImageList1.GetImageIconUrl(0)]) end; 1 Quote Link to comment Share on other sites More sharing options...
artem_niko Posted January 18, 2021 Author Share Posted January 18, 2021 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2021 Share Posted January 18, 2021 4 minutes ago, Артем said: And how about load icon from file? procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniPanel5 do if TitleVisible then JSInterface.JSConfig('icon', ['files/filename.ico']) end; Quote Link to comment Share on other sites More sharing options...
artem_niko Posted January 18, 2021 Author Share Posted January 18, 2021 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: How set size of icon? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2021 Share Posted January 18, 2021 10 minutes ago, Артем said: How set size of icon? You can try to use the iconCls config. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted January 18, 2021 Author Share Posted January 18, 2021 4 minutes ago, Sherzod said: You can try to use the iconCls config. How? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2021 Share Posted January 18, 2021 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; } 1 Quote Link to comment Share on other sites More sharing options...
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.