Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101832

Add support for creating graphic region from css

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • None
    • 8
    • javafx
    • None

      All labeled controls support a "graphic" property that can be any node. Used for example as the icon on a Button. This is settable as -fx-graphic from CSS but at the moment the only acceptable values are url("http://....") as a url to a image that will be loading into a ImageView and set as the graphic. I want to add the ability to create a styleable region as he graphic that can be style from CSS with SVG etc.

      The proposal is to add a value type for -fx-graphic like:

      #myButton {
            -fx-graphic: region(".graphic");
      }

      where the new region node can be styled with:

      #myButton > .graphic {
          -fx-padding: 10px;
          -fx-background-color: red;
      }

      or you could use a ID for new region rather than styleclass like:

      #myButton {
            -fx-graphic: region("#myGraphic");
      }
      #myButton > #myGraphic {
          -fx-padding: 10px;
          -fx-background-color: red;
      }

      This will allow us to have CSS style-able vector SVG icons that can scale nicely for Retina displays etc.

        1. RT-27804.patch
          6 kB
          Jasper Potts
        2. RT-27804-v2.patch
          6 kB
          Jasper Potts

            jasper Jasper Potts (Inactive)
            jasper Jasper Potts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: