You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. package nova.monadic_sfx.implicits
  2. import javafx.{scene => jfxs}
  3. import org.kordamp.ikonli.{javafx => ikonlifx}
  4. import scalafx.scene.paint.Paint
  5. import scalafx.scene.text.Text
  6. object FontIcon {
  7. implicit def sfxText2jfx(v: FontIcon): jfxs.text.Text =
  8. if (v != null) v.delegate else null
  9. }
  10. // extends Shape(delegate)
  11. // with PositionDelegate[ikonlifx.FontIcon]
  12. // with SFXDelegate[ikonlifx.FontIcon]
  13. class FontIcon(override val delegate: ikonlifx.FontIcon = new ikonlifx.FontIcon)
  14. extends Text(delegate) {
  15. // def iconCode_=(v: Ikon) = delegate.setIconCode(v)
  16. def iconColor = delegate.getIconColor()
  17. def iconColor_=(color: Paint) = delegate.setIconColor(color)
  18. def iconSize = delegate.getIconSize()
  19. def iconSize_=(size: Int) = delegate.setIconSize(size)
  20. def iconLiteral = delegate.getIconLiteral()
  21. def iconLiteral_=(literal: IconLiteral) =
  22. delegate.setIconLiteral(literal.value)
  23. def iconLiteral_=(literal: String) = delegate.setIconLiteral(literal)
  24. }
  25. sealed abstract class IconLiteral(val value: String)
  26. object IconLiteral {
  27. // fab-accusoft
  28. case object Gmi10k extends IconLiteral("gmi-10k")
  29. }