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

DialogPane show details button wipes out base style class "hyperlink"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx24
    • javafx
    • None
    • In Review

      The "show details" hyperlink button in an alert dialog that has an expandable detail area wipes out its base style class by overwriting all styles. This means styling in modena.css that targets `.hyperlink` is no longer applied, like the default text fill colors.

      The culprit is this code in DialogPane:

              InvalidationListener expandedListener = o -> {
                  final boolean isExpanded = isExpanded();
                  detailsButton.setText(isExpanded ? lessText : moreText);
                  detailsButton.getStyleClass().setAll("details-button", (isExpanded ? "less" : "more")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
              };

      Here it uses `setAll` to set styles, wiping out the default `.hyperlink` style from "Hyperlink detailsButton = new HyperLink()"

      Solution:

      Don't wipe out this style.


            jhendrikx John Hendrikx
            jhendrikx John Hendrikx
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: