mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:39:18 +02:00
gtk: dont erase background of TCustomForm descendants
git-svn-id: trunk@13851 -
This commit is contained in:
parent
3755b7e54a
commit
fff0200dff
@ -29,7 +29,17 @@
|
|||||||
|
|
||||||
function DoDeliverPaintMessage(const Target: TObject; var PaintMsg: TLMPaint): PtrInt;
|
function DoDeliverPaintMessage(const Target: TObject; var PaintMsg: TLMPaint): PtrInt;
|
||||||
begin
|
begin
|
||||||
if (TObject(Target) is TCustomControl) and not (csOpaque in TWinControl(Target).ControlStyle) then
|
{
|
||||||
|
erase backgound of not csOpaque custom controls
|
||||||
|
|
||||||
|
Attention - TCustomForm is also TCustomControl descendant - if we erase its
|
||||||
|
backgound then Form.Color will work, but under gtk1 form background will erase
|
||||||
|
subcontrols. For example checkboxes become unvisible. If this will be solved then
|
||||||
|
remove line "not (TObject(Target) is TCustomForm) and" from condition.
|
||||||
|
}
|
||||||
|
if (TObject(Target) is TCustomControl) and
|
||||||
|
not (TObject(Target) is TCustomForm) and
|
||||||
|
not (csOpaque in TWinControl(Target).ControlStyle) then
|
||||||
begin
|
begin
|
||||||
Include(TWinControlAccess(Target).FWinControlFlags, wcfEraseBackground);
|
Include(TWinControlAccess(Target).FWinControlFlags, wcfEraseBackground);
|
||||||
TWinControl(Target).Perform(LM_ERASEBKGND, PaintMsg.DC, 0);
|
TWinControl(Target).Perform(LM_ERASEBKGND, PaintMsg.DC, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user