New versions of LCLCocoa - virtual treeview paints column headers black lazarus / 28-Cocoa ---------------------------------------------------------------------- MISV · 2021-02-17 09:52 Just updated to newest source and all column headers are now painted all black. This happens with both - https://github.com/blikblum/VirtualTreeView-Lazarus/ - And version shipped in Lazarus (just did complete SVN update yesterday) For the rest of this post I will be using the version shipped with Lazarus (laz.virtualtreeview / LazVirtualTreeview) I havde made no code changes and there is no owner-draw or similar in play here. Content/data draws correctly. Here is a link to error report on BlikBlum Github page: https://github.com/blikblum/VirtualTreeView-Lazarus/issues/24 However, since blikblum and lazarus versions are not always fully sync'ed, I guess I will be using laz.virtualtreeview / LazVirtualTreeview for when debugging the issue through this forum. I would appreciate is anyone else could also chip in and see if they experience the same error. -- I do not believe Mac update affects this since my old compiled versions still work correctkly -- ---------------------------------------------------------------------- MISV · 2021-02-17 10:34 Here is screenshot ---------------------------------------------------------------------- balazsszekely · 2021-02-17 12:57 I cannot help you with the bug, since I don't own a Mac. However until the issue is fixed, why don't you owner draw the header background? The text, sort glyph, etc...can remain the same, only change the background color. ---------------------------------------------------------------------- MISV · 2021-02-17 15:53 If I can simply only override background color and that works then... Worth a try. I will report back tonight. ---------------------------------------------------------------------- balazsszekely · 2021-02-17 16:20 @MISV Try this: 1. Set VST->Header->Options hoOwnerDraw to true 2. Create the following events: OnAdvancedHeaderDraw and OnHeaderDrawQueryElements 3. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses LCLType; procedure TForm1.VSTAdvancedHeaderDraw(Sender: TVTHeader;  var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements);begin  if PaintInfo.Column = nil then  begin     PaintInfo.TargetCanvas.Brush.Color := clBtnFace; //change this    PaintInfo.TargetCanvas.FillRect(PaintInfo.PaintRectangle);    PaintInfo.TargetCanvas.FrameRect(PaintInfo.PaintRectangle);  end  else  begin    PaintInfo.TargetCanvas.Brush.Color := $00C4C4C4; //similar to clBtnFace, change this    PaintInfo.PaintRectangle.Left := PaintInfo.PaintRectangle.Left - 1;    PaintInfo.PaintRectangle.Top := PaintInfo.PaintRectangle.Top - 1;    PaintInfo.TargetCanvas.FrameRect(PaintInfo.PaintRectangle);  end;end; procedure TForm1.VSTHeaderDrawQueryElements(Sender: TVTHeader;  var PaintInfo: THeaderPaintInfo; var Elements: THeaderPaintElements);begin  Elements := Elements  + [hpeBackground];end; ---------------------------------------------------------------------- MISV · 2021-02-18 00:24 This solution works. Seems clAppWorkSpace for header/columns background and clActiveBorder for borders/frames/separaters are the way to go... Or clWindow / clWindowFrame (latter for separators instead of frames) I am not entirely sure they color choices will work well with both dark/white mac themes or other Mac OS themning/customization but seem like the two best bets Should I report the original problem here as well: https://bugs.freepascal.org/main_page.php ? ---------------------------------------------------------------------- balazsszekely · 2021-02-18 05:16 Without the possibility of debug, it looks like the theme service fails to get the correct background for the header under cocoa.  Please mention this on the bugreport, maybe it helps with the fix. ---------------------------------------------------------------------- MISV · 2021-02-18 09:00 I have submitted this bug report https://bugs.freepascal.org/view.php?id=38507