Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

Description

Button look and feel can be changed on the DSL. The following atributes can be changed:

  • Text can be replaces by an icon

  • An icon can be added in front of the text

  • An icon can be added after the text

  • The button’s color can be changed

Example

...

View XML

Code Block
<submit  
  label="button_examples.label"  
  prependIcon="image" 
  appendIcon="chevron-down" 
  tooltip="button_examples.tooltip"   
  action="submitDummy"></submit>

Background colour

The buttons colour can be set to a DSL enum value. The values are:

...

Code Block
DSL_BUTTON_VARIANT getButtonVariantTonal() {
  return DSL_BUTTON_VARIANT.Tonal;
}

Icon

If the button has an icon it will replace the label and become a round button. You can add the label as a tooltip to the button allowing the button to still be read on hover. The icons that is used can be found in this library: https://pictogrammers.com/library/mdil/

Screenshot 2024-05-03 at 08.49.05.png

Code Block
<submit
  label="button.edit"
  icon="pencil"
  tooltip="button.edit" 
  action="submitDummy">
  <variant function="ButtonDemo:getButtonVariantWarning"/>
</submit>

Icon and text

Screenshot 2024-05-03 at 09.08.41.pngImage Removed

You can combine icons with text and/or other icons to for hybrid buttons.

...

Code Block
<submit
  label="button_examples.label.SMS"
  prependIcon="arrow-right" 
  tooltip="button_examples.tooltip" 
  action="submitDummy">
</submit>

<submit
  label="button_examples.label"
  icon="phone" 
  appendIcon="arrow-right" 
  tooltip="button_examples.tooltip" 
  action="submitDummy">
</submit>