I created an Expandable Area with a Checkbox as a button in the Header. I can’t use Expandable Area’s own header style to make a button, as it greys it out (despite adjusting the tint) and there’s no hover feature that way.
My problem is, when I use the Checkbox in the Expandable Area, mouse cursor won’t trigger the expandable area, I have to click 1 pixel to the left of the button to expand. I tried putting the Checkbox in an ‘Not Hit-testable’ Overlay but that didn’t work either.
When I make the Checkbox Hidden, the Expandable Area works well, expands when I click where the button should be. It’s only the Checkbox interfering with it.
Anyone knows how to solve this problem? How to I get the Checkbox to keep its hover, etc. but also can click the Expandable Area Header?
Wrap the checkbox in a widget, override onMouseDown and pass Unhandled. May not work due to the input consumption, see below.
Generally speaking using buttons / checkboxes is a nuisance as soon as you try to do something unorthodox. Those controls consume focus; and, unlike the button, the checkbox does not even have a Click Method exposed.
Were I to insert an interactive widget into the Expandable Area’s header, I’d create a user widget - a wrapped border will get you all the control you need.
Thank you, I’ll try this out. On the other hand, why does the Expandable Area Header style greys images out, even when there is no tint on them and when it is enabled? Also is there a way to add a hover function to these in blueprint?
This is what they are meant to look like. The images have transparent background. All other widgets work perfectly with these images, buttons, checkboxes… Only having problem with the expandable header.
ExpandableArea::UExpandableArea(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, bIsExpanded(false)
{
bIsVariable = true;
if (DefaultExpandableAreaStyle == nullptr)
{
// HACK: THIS SHOULD NOT COME FROM CORESTYLE AND SHOULD INSTEAD BE DEFINED BY ENGINE TEXTURES/PROJECT SETTINGS
DefaultExpandableAreaStyle = new FExpandableAreaStyle(FCoreStyle::Get().GetWidgetStyle<FExpandableAreaStyle>("ExpandableArea"));
// Unlink UMG default colors from the editor settings colors.
DefaultExpandableAreaStyle->UnlinkColors();
}
if (DefaultExpandableAreaBorderBrush == nullptr)
{
// HACK: THIS SHOULD NOT COME FROM CORESTYLE AND SHOULD INSTEAD BE DEFINED BY ENGINE TEXTURES/PROJECT SETTINGS
DefaultExpandableAreaBorderBrush = new FSlateBrush(*FCoreStyle::Get().GetBrush("ExpandableArea.Border"));
// Unlink UMG default colors from the editor settings colors.
DefaultExpandableAreaBorderBrush->UnlinkColors();
}
Seems this was a messy job at some point and never got properly fixed. Currently it seems that the Style is not working as it should and not even exposed. It accounts for some other value I cannot find - I’m not versed enough and can’t invest more time into trying to figure this one out.
To hack some more, you could force Tint values above 1:
Thank you so much, it is good to know I’m not doing something wrong at least! I will try everything else you recommended and will let you know the outcome, you’ve been a great help!