Skip to content

Commit

Permalink
Merge pull request #2440 from cwensley/curtis/mac-fix-treeview-nre
Browse files Browse the repository at this point in the history
Mac: Fix occasional NRE with TreeView
  • Loading branch information
cwensley authored Mar 8, 2023
2 parents 7bc5c5b + db3d44c commit 5e4f31d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Eto.Mac/Forms/Controls/TreeViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,18 @@ public TreeViewHandler Handler
/// </summary>
public override void DrawBackground(CGRect clipRect)
{
var backgroundColor = Handler.BackgroundColor;
if (backgroundColor != Colors.Transparent) {
backgroundColor.ToNSUI ().Set ();
NSGraphics.RectFill (clipRect);
} else
base.DrawBackground (clipRect);
var h = Handler;
if (h != null)
{
var backgroundColor = h.BackgroundColor;
if (backgroundColor != Colors.Transparent)
{
backgroundColor.ToNSUI().Set();
NSGraphics.RectFill(clipRect);
return;
}
}
base.DrawBackground (clipRect);
}

public EtoOutlineView()
Expand Down

0 comments on commit 5e4f31d

Please sign in to comment.