0
\$\begingroup\$

Background

I am making a CheckButton for toggling sound in my game. I have created an on and off icon for this purpose. I have two other Buttons in a VBoxContainer with this CheckButton, whose icons are the same size as the icons for my CheckButton.

For the regular Buttons, I was able to check the "Expand Icon" option to make the icons shrink to fit the size of the button.

Expand Icon

Problem

However, the same does not appear to work for the CheckButton. For that, I had to override the "icons" in the theme overrides. As far as I can tell, the "Expand Icon" option does not affect these icons.

enter image description here

This results in the following undesirable behavior. All of these icons' backing files are the same size, but only the CheckButton (the speaker button at the top) is not shrinking.

enter image description here

I could easily make the icons just smaller, but that feels like a cop-out. Am I missing a setting somewhere?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

You are not missing any setting. The icons of the CheckButton are not meant to scale with the button. They are meant to have a consistent size for all buttons.

I'm not a fan of not idempotent buttons, and I'd push against anything that can lead to an confusion between state and action, however…

For what you want, I'd suggest to use Buttons and have code to change the icon.

By the way, are you not making these icons huge to begin with? You say cop-out, I say optimization.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .