Disabled text color with HTML

Hey folks,

8.1.24

I feel like I'm missing something simple here, but I've been banging my head against this issue for over an hour now. I've tried implementing fixes proposed in other topics on this matter (short of using UIManager scripting). Hoping one of you can help direct me.

The problem:

  • Component disabled resulting foreground color change varies between HTML and non-HTML foreground
  • Attempts to override this have been unsuccessful.

I've attempted to:

  • Embed the color into the HTML foreground (ex:<font color="red">), but it only evaluates when the component is enabled
  • Change the foreground color, but it only evaluates when the component is enabled.
  • Using a custom property to drive the style customizer

#808080 seems to be the standard foreground color for disabled HTML objects. Is there some other way access and manipulate this color? If nothing else, I just want the color to be consistent between HTML and non-HTML foreground.

Thank you in advance.

Example: Top buttons, no HTML. Bottom buttons HTML. Left are disabled, right are enabled.

I don't know why you would be using HTML for colors in Vision.

Is this actually in regard to perspective?

Nope, this is definitely Vision, and I'm not using HTML for color.

I'm using HTML to wrap the text on the button (not shown in this example for simplicity). In doing so, I encounter the issue of the colors being different when disabled and needing a consistent product.

I think the easy answer is to make all text HTML or not use the "Enabled" property and instead script the disable. But that still doesn't answer the question of whether the HTML disabled color can be overridden or manipulated.

Am I at an dead-end here? I feel like there's got to be a way to change this.

The difference is down to the LaF implementing the disabling color tinting differently, and there's only so many knobs you have to turn.

You could try adding a client property named Synthetica.textField.locked.textColor, set to an explicit color you want to use; I don't know whether that will do anything on a button, let alone be consistent when HTML formatting is used or not. (Reference: Synthetica - Java Look And Feel)

1 Like

Thank you, Paul. I will play around and see what comes of it.

Quick sanity check: there's no way to wrap text on a button without using HTML, correct? Trying to avoid the issue entirely, if possible.

I had never noticed this issue. As a possible work around, you could use labels for your button text, and bind the enabled property of the label to the enabled property of the button. To me, it sounds like a tedious task for hundreds of buttons, but if you were able to implement this in a template in some creative way, perhaps it wouldn't be so bad.

1 Like