The ability to CSS style a JavaFX Button using the -fx-graphic to accept an SVG path.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8u40
    • Component/s: javafx
    • Environment:

      Windows 7, MacOSX, Linux

      Typically when styling JavaFX Button controls a user of the API can use the CSS -fx-graphic attribute to point to a url of an image file. However, it would be nice if the same attribute could use SVG paths.

      For example, you could create a plus sign like so:
       
      -fx-graphic: "M0,-1 V1 M-1,0 H1";


      NOTE: Currently in JavaFX this can be acheived like the following:
          StackPane buttonGraphic = new StackPane();
          buttonGraphic.getStyleClass().add("plus");
          Button button = new Button("blah");
          button.setGraphic(buttonGraphic);

          /* A button with a plus sign */
          .button .plus { -fx-shape: "M0,-1 V1 M-1,0 H1"; }


            Assignee:
            Unassigned
            Reporter:
            Carl Dea
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: