2021-09-12 11:14 PM
Hi,
I'm working on a project that has to support highlighting "focused" components with a frame around them.
The buttons have images, so I need the "inside" of the frame to be transparent.
BoxWithBorder doesn't suit my needs, as I can't set the inside to be transparent and the border not to be (right?)
Is there a recommended way to do this without creating a widget from scratch?
Thank you!
Solved! Go to Solution.
2021-09-13 04:06 AM
Hi,
Unfortunately not that I am aware of. What I would do instead of creating a widget through code is to do a custom container instead where you use 4 box widgets to do the borders without alpha and either nothing or a box for the inside with alpha. You could always make it more intelligent through user code to have it adapt to the size of the images.
/Romain
2021-09-13 04:06 AM
Hi,
Unfortunately not that I am aware of. What I would do instead of creating a widget through code is to do a custom container instead where you use 4 box widgets to do the borders without alpha and either nothing or a box for the inside with alpha. You could always make it more intelligent through user code to have it adapt to the size of the images.
/Romain
2021-09-13 07:39 AM
It's easy to derive class from that widget, and override draw() function, like this
virtual void draw(const touchgfx::Rect& invalidatedArea) const;
{
parent widget‘s draw();
draw your box; //your box will NOT exceed the width and height of widget
}
may not work, just a hint.