CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Fontawesome

by cyracks » 12 Sep 2018 21:02

Hello,

I would like to use icons from fontawesome as icon on button, is that possible ?

I managed to show fontawesome icons on labels with the following code:
1) In servercontroller event on create the following is executed
Code: Select all
HTMLHeaders.Add('<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">');

2) Configure label
Code: Select all
Label.caption := '<i class="fas fa-mobile-alt"></i> Mobile'
Label.RawText := True;


Button does not have RawText property so tekst <i class="fas fa-mobile-alt"></i> is not shown as picture but as regular text.

Regards,
Tomaž
cyracks
 
Posts: 92
Joined: 09 Feb 2016 12:47

by Alexander Bulei » 18 Sep 2018 10:12

Hi cyracks,

For the html parse in button, please check the JQButtonOptions.Wrap property.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by cyracks » 18 Sep 2018 23:18

Hi Alexander,

thank you for the tip it solved the problem.

ps: if wrap = True then padding is automatically set to .4em 1em (.ui-button-text-only .ui-button-text) which is not ok because button must be at least 25 in height for text to be shown in the middle. With default value of 21 text is aligned to the bottom.
text-padding.png


Regards,
Tomaž
You do not have the required permissions to view the files attached to this post.
cyracks
 
Posts: 92
Joined: 09 Feb 2016 12:47

by Alexander Bulei » 21 Sep 2018 09:13

Hi cyracks,

The padding come from the theme style, if you want use the smaller buttons, use the custom css style to override that style(padding) of span.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQButton & JQButtonSet

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.