shiv19 / nativescript-cfalert-dialog

CFAlertDialog Wrapper for NativeScript
Apache License 2.0
42 stars 21 forks source link

[Feature Request] include icon in button text #19

Closed stevenspiel closed 5 years ago

stevenspiel commented 5 years ago

What would it take to include an icon image next to the text in the buttons? Maybe something like this?:

let options: DialogOptions = {
  dialogStyle: CFAlertStyle.BOTTOM_SHEET,
  title: '',
  buttons: [
    {
      text: 'Edit',
      buttonStyle: CFAlertActionStyle.POSITIVE,
      icon: 'res://edit',
      iconPosition: CFAlertButtonIconPosition.LEFT,
      onClick: (() => console.log('Edit'))
    },
    {
      text: 'Delete',
      buttonStyle: CFAlertActionStyle.NEGATIVE,
      icon: 'res://trash',
      iconPosition: CFAlertButtonIconPosition.RIGHT,
      onClick: (() => console.log('Delete'))
    }
  ]
}
shiv19 commented 5 years ago

It's not trivial as the underlying library doesn't support it.

stevenspiel commented 5 years ago

ok. thanks!