Recent

Author Topic: How to make a T[Flow]Panel translucent under Linux  (Read 770 times)

pleumann

  • Jr. Member
  • **
  • Posts: 94
How to make a T[Flow]Panel translucent under Linux
« on: June 05, 2023, 10:19:34 am »
Hi,

I'm using a TFlowPanel to arrange some buttons. The panel is by default translucent on MacOS (where I develop most of the time), but has a light gray background on Raspberry Pi / Linux (where I ultimately need to deploy to). This is bad because my form has a background wallpaper that is then being covered up by the empty parts of the panel. I tried all sorts of tricks already (played with Color/ParentColor, assigned empty OnPaint), but to no avail. Is this a general limitation of the Linux target or the GTK widget set or could it be caused by the older Lazarus 2.0.6 on Raspberry Pi (I use 2.2.6 on MacOS)?

Cheers
Joerg

pleumann

  • Jr. Member
  • **
  • Posts: 94
Re: How to make a T[Flow]Panel translucent under Linux
« Reply #1 on: June 05, 2023, 01:55:34 pm »
Update: It's not the older Lazarus. I installed 2.2.6 on an Ubuntu box and it has the same issue. So it's probably GTK ignoring my attempts to make the panel's background transparent.

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: How to make a T[Flow]Panel translucent under Linux
« Reply #2 on: June 05, 2023, 11:12:11 pm »
Technically speaking, you are most likely to have the transparent background because its not supposed to be.

I suppose if you captured the WM_ERASEBKGRD message and prevent it from painting you may get somewhere.
The only true wisdom is knowing you know nothing

pleumann

  • Jr. Member
  • **
  • Posts: 94
Re: How to make a T[Flow]Panel translucent under Linux
« Reply #3 on: June 06, 2023, 02:43:49 pm »
Technically speaking, you are most likely to have the transparent background because its not supposed to be.

I suppose if you captured the WM_ERASEBKGRD message and prevent it from painting you may get somewhere.

Not sure what you mean. Are you trying to say the behavior on MacOS is actually the buggy one and panels are always supposed to be solid?

Also, capturing the message means subclassing (as far as I can see), in which case I could probably just as well override Paint() as just calling PaintChildren() without cleaning the background. But I'd have to get my changed component into the gallery, which I'd like to avoid. I was hoping there is some easy, defined and portable way of doing this (transparency color or so).

 

TinyPortal © 2005-2018