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

[Dialog] Font size of DialogPane content is too big

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8u40
    • 8u40
    • javafx
    • None
    • Mac OS X 10.9, Java 8u20, openjfx-dialog 1.0.2

    Description

      I'm using the openjfx-dialog backport library with JDK 8u20 on Mac OS X, the same problem will occurr with JDK 8u40 pre builds.

      The font size of the DialogPane content is bigger than the content of all other application components. So the look of the dialog is not consistent.
      The reason is the definition of bigger font size in the dialog.css stylesheet:

      .dialog > .dialog-pane {
          -fx-background-color: linear-gradient(#ffffff,#f3f3f4);
          -fx-border-width: 1px;
          -fx-border-color: #b4b4b4 transparent #b4b4b4 transparent;
          -fx-font-size: 1.083333em; /*13px;*/
          -fx-text-fill: #292929;
      }
       
      The bigger font size can make sense when the dialog just displays a message, e.g. in an AlertDialog. But it does not make any sense when the dialog contains custom content (e.g. a pane full of input controls). All the DialogPane controls will have a bigger size than the dialog buttons and all the other application components.

      A simple workaround is too call before showin the dialog, but it would be great when this bug gets fixed:

      dlg.getDialogPane().setStyle("-fx-font-size: 1em;");

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            ssaringjfx Stefan Saring (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: