# Momentary Button - Disabled by Permissions Text Color

**URL:** <https://forum.inductiveautomation.com/t/momentary-button-disabled-by-permissions-text-color/26224>\
**Category:** Ignition\
**Created:** [July 2, 2019, 1:28pm UTC](https://forum.inductiveautomation.com/t/momentary-button-disabled-by-permissions-text-color/26224 "2019-07-02T13:28:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brian\_whitacre](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@brian\_whitacre](https://forum.inductiveautomation.com/u/brian_whitacre)\
**Post date:** [July 2, 2019, 1:28pm UTC](https://forum.inductiveautomation.com/t/momentary-button-disabled-by-permissions-text-color/26224/1 "2019-07-02T13:28:45Z")

</div>

When upgrading to 8.0.2 (from 7.9.2), I noticed that Momentary buttons look different when disabled. I’m curious if there is a way to override the text color similarly to how other components look. I found a couple threads that discussed this, but the solutions seem geared toward pre-8 versions of Ignition.

Here’s how I’d like the disabled text to appear:  
 ![Others](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ed56aa87e25d654ee1078b7d09f2501b2a178f63.png)

Here’s how the Momentary button currently looks:  
 ![Momentary](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/aa3a45b05222973ae92a741a56e6026e614d222a.png)

I believe the numeric text field and label components are setup in the UIManager to set their Synthetica.background.alpha when disabled, but I can’t figure out how to do the same for the Momentary button. I tried setting the Button.disabledText color in the UIManager using a client script, but that didn’t seem to change anything.

Thanks in advance for any help you can provide!

---

<div class="post-metadata">

**Author:** ![brian\_whitacre](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@brian\_whitacre](https://forum.inductiveautomation.com/u/brian_whitacre)\
**Post date:** [July 8, 2019, 5:53pm UTC](https://forum.inductiveautomation.com/t/momentary-button-disabled-by-permissions-text-color/26224/2 "2019-07-08T17:53:18Z")

</div>

I think if I can add a change listener on DISABLED\_BY\_PERMISSIONS, I may be able to work around this limitation. Does anyone know if it is possible to add a change listener to the UIManager and recolor the text of momentary buttons this way?

---

<div class="post-metadata">

**Author:** ![brian\_whitacre](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@brian\_whitacre](https://forum.inductiveautomation.com/u/brian_whitacre)\
**Post date:** [July 16, 2019, 1:35pm UTC](https://forum.inductiveautomation.com/t/momentary-button-disabled-by-permissions-text-color/26224/3 "2019-07-16T13:35:10Z")

</div>

I contacted support and they suggested I create a template with the button in it and add a property change script. Here’s the script I added:

```auto
from javax.swing.plaf import ColorUIResource

if event.propertyName == 'enabled':
	if event.newValue == 1:
		event.source.foreground = system.gui.color(0,0,0,255)
	else:
		event.source.foreground = ColorUIResource(128,128,128)

```

This seems to correct the problem. If you use the ColorUIResource function, it doesn’t seem to matter what RGB values you send in. I think it pulls the color from the UIManager based on the Look and Feel settings. If you want a specific color, rather than to match the other disabled objects, use system.gui.color.
