Using Expandable Area with Checkboxes

Hi,

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?

It does?

image

image

Can you demonstrate?


Once you get a user widget:

image

You can do pretty much anything:

Hover is just button’s way of initiating Mouse enter / Leave - but now you get to decide what happens with a lot of granularity.


Clicking on such widget will tunnel by default and reach the expandable widget below.

1 Like

image
image
The colours get muted like this.

Something else is causing this. Can you test it with another image?

The colours get muted like this.

Ha, this gets flipped real hard! Or the colours are international but desaturated?

Does this image have transparency? What else is there? As in, can you show the widget hierarchy so I can better understand what we’re dealing with.

image
PLAY_Selected
PLAY_Unselected
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.

Hm, that image behaves spot on on my, inside and out of the Expandable.


Are you inheriting tint by any chance:

image

How odd. All the inherits on mine are unchecked.

I also created a brand new expandable area with different images in the header and same problem occured.

So Tint & Color and Opacity above are also fine?


What if you create a brand new widget - just to test it out?


All good I think, tell me if I’m missing something?

image
and this is the border brush, in case this would have an effect?

OK, we’re talking 2 different things. You’re using a style. I just added an Image to the Header:


I’ll have a look at what Style is up to.

Huh, started digging in Slate and found these:

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 :expressionless: - 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:

This may seem like blasphemy for someone with artistic background but it’s clamped at 1 it seems anyway. Still looks a bit off.

1 Like

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!