Set button's text color when it's pressed and on keyboard focus

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Modley

Basically, let’s say we have a Button with Toggle Mode on. We can give the button’s text some color when it’s focused, and when it’s pressed. But when the button is pressed (and it will stay that way because of toggle), the color will always be the “Pressed” color, and it will never have the “Focus” color, unless it’s toggled off.

So, what I mean, is that I need a way to make it so that if the button is pressed AND that it has focus to make it’s text color the pressed color.

It’s not clear to me what colors you’re looking for each unique button state. So, what colors do you want for each of these?

  • Pressed / Focused
  • Pressed / Not Focused
  • Not Pressed / Focused
  • Not Pressed / Not Focused

jgodfrey | 2023-03-30 22:34

Pretty much all of them.

Modley | 2023-03-31 10:42

:bust_in_silhouette: Reply From: spaceyjase

Apologies if I’ve read this incorrectly; I think you’re describing ‘Theme Overrides’. They can certainly do what you want, overriding the button style for each state:

For a button, there are Hover, Pressed, Focus, Disabled and Normal states where new StyleBox resources can be created to change the way the button looks.