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()"

Yeah, you tend to run into this when you want to style your app for dark mode 
(which my current app is). Modena is surprisingly well set-up to make a dark 
theme by just changing some colors and ladders, but the link color one needed a 
specific exception.  Let's reopen.

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

PR Comment: https://git.openjdk.org/jfx/pull/1779#issuecomment-6770332920

Reply via email to