On Wed, 16 Apr 2025 08:51:36 GMT, John Hendrikx <[email protected]> wrote:

> 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()"
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 6270767b
Author:    John Hendrikx <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/6270767b17b1ee9229143be7fff86b46e0374e51
Stats:     18 lines in 1 file changed: 3 ins; 5 del; 10 mod

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

Reviewed-by: mhanl, angorya

-------------

PR: https://git.openjdk.org/jfx/pull/1779

Reply via email to