Visitar URL original
After recent change, labels and the text from text update widgets disappear · Issue #3891 · ControlSystemStudio/phoebus · GitHub
Skip to content

After recent change, labels and the text from text update widgets disappear #3891

Open

Description

@kasemir

After a recent change, labels and textupdate widgets have their text disappear because their foreground color turns transparent .

Image Image

Activity

  1. kasemir commented on Jul 20, 2026

    @kasemir
    CollaboratorAuthor

    The problem is somehow related to the change in JFXRepresentation from #3887.

    When I disable the updateBackground() change, labels show up fine.
    As JFXRepresentation.updateBackground () is written in #3887, labels and text update use transparent foreground colors.

  2. changed the title [-]After recent change, "transparent" labels disappear[/-] [+]After recent change, labels and the text from text update widgets disappear[/+] on Jul 20, 2026
  3. kasemir commented on Jul 20, 2026

    @kasemir
    CollaboratorAuthor

    It comes down to this one line from the JFXRepresentation change in #3887

    // Now make the scroll pane transparent to see the parent background
    model_root.setStyle("-fx-background: transparent; -fx-background-color: transparent; ");

    // Now make the scroll pane transparent to see the parent background
    model_root.setStyle("-fx-background: transparent; -fx-background-color: transparent; ");
    

    With setStyle ... transparent, the text in labels and text update widgets becomes transparent as shown in the screenshot above or here:

    Image

    When I comment that line, the text shows up as expected:

    Image
  4. rjwills28 commented on Jul 21, 2026

    @rjwills28
    Contributor

    @kasemir - thanks for catching this! I was wondering why I hadn't seen this as I did a significant amount of testing. It turns out I had tested that my PR fixed the scroll bar issues in both JFX21 and JFX25, BUT my tests on how it affected the widgets was done on JFX 25 only.

    This issue is not there with JFX25, that is to say that the foreground text does render correctly and is not invisible. That's my bad for not fully testing it against JFX21 - sorry. How do we want to proceed - revert the commits until Phoebus moves to JFX25 - how far away from that are we?

  5. kasemir commented on Jul 21, 2026

    @kasemir
    CollaboratorAuthor

    This issue is not there with JFX25

    Good! I can wait 1-2 weeks, for now I've pointed our Jenkins to the last git hash before this change.

    Do you understand what's going on? Is the style sheet handling in JFX21 simply broken?
    Or are we just lucky that the updateBackground() changes happen to work with JFX25, and they might again break with JFX26?

  6. rjwills28 commented on Jul 21, 2026

    @rjwills28
    Contributor

    If I understand correctly I think it relates to this bug: https://bugs.openjdk.org/browse/JDK-8336097, which was fixed in JFX24. It relates to the priority of styles and what can override what, (see also https://bugs.openjdk.org/browse/JDK-8317434 which is related).

    I have just tested against JFX26 as well for good measure and there are no problems with invisible labels.

  7. kasemir commented on Jul 21, 2026

    @kasemir
    CollaboratorAuthor

    From that it looks like you're doing the right thing, the problem is in JFX21.
    Since you're not doing anything wrong, I'd hate to revert.
    On the other hand this does mean that people who do "git clone.. mvn .. run" right now get a broken display.

  8. rjwills28 commented on Jul 21, 2026

    @rjwills28
    Contributor

    The other option might be to put in a 'quick fix' now for JFX21 and make a note to revert that once we've moved to JFX25?

    We can work round the bug by setting the foreground color using inline CSS, which has the highest priority in terms of CSS. That would look like:

    label.setStyle("-fx-text-fill: "+JFXUtil.webHex(model_widget.propForegroundColor().getValue()));
    

    We'd have to do that in both TextUpdateRepresentation and LabelRepresentation.

  9. kasemir commented on Jul 21, 2026

    @kasemir
    CollaboratorAuthor

    I like that, with a // TODO Remove .... comment, so the main branch will again run without this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions