Skip to content

RadioButton.CheckedImage #486

@dudule73

Description

@dudule73

Hello,
I found a problem with RadioButton : setting the CheckedImage property doesn't change the checked appearence.
The CheckedImage property set the _checkedImage value, then calls CheckButtonBase.UpdateImage()
But the CheckButtonBase.UpdateImage() function only set the Renderable value :
private void UpdateImage() { _check.Renderable = IsPressed ? _checkedImage : _uncheckedImage; }
And in the Image.InternalRenderer() function, the drawn image is set to the PressedRenderable property (that is equal to _pressedImage value) if IsPressed value is on.
But RadioButton (and CheckButtonBase) doesn't have _pressedImage value, only _checkedImage.

Rendering CheckButtonBase should call _checkedImage and not _pressedImage.

For now, a way to bypass the problem is adding this line in CheckButtonBase.UpdateImage()
private void UpdateImage() { _check.Renderable = IsPressed ? _checkedImage : _uncheckedImage; _check.PressedRenderable = _checkedImage; }
That will set the _pressedImage equal to the _checkedImage

Don't think it's the best solution, but it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions