Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac: Fix setting background of cells on Sonoma #2563

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Eto.Mac/Forms/Cells/CustomCellHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public override void DrawRect(CGRect dirtyRect)
if (DrawsBackground && BackgroundColor != null && BackgroundColor.AlphaComponent > 0)
{
BackgroundColor.Set();
NSGraphics.RectFill(dirtyRect);
NSGraphics.RectFill(Bounds);
}
base.DrawRect(dirtyRect);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Eto.Mac/Forms/Cells/DrawableCellHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ public override void DrawRect(CGRect dirtyRect)
var nscontext = NSGraphicsContext.CurrentContext;
var isFirstResponder = Window?.FirstResponder == this;

var cellFrame = Bounds;
if (DrawsBackground)
{
var context = nscontext.CGContext;
context.SetFillColor(BackgroundColor.ToCG());
context.FillRect(dirtyRect);
context.FillRect(cellFrame);
}
var cellFrame = Bounds;

var handler = Handler;
if (handler == null)
Expand Down
2 changes: 1 addition & 1 deletion src/Eto.Mac/Forms/Cells/ImageViewCellHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public override void DrawRect(CGRect dirtyRect)
if (BackgroundColor != null && BackgroundColor.AlphaComponent > 0)
{
BackgroundColor.Set();
NSGraphics.RectFill(dirtyRect);
NSGraphics.RectFill(Bounds);
}
base.DrawRect(dirtyRect);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Eto.Mac/Forms/Controls/GridViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override void DrawBackground(CGRect clipRect)
if (backgroundColor != Colors.Transparent)
{
backgroundColor.ToNSUI().Set();
NSGraphics.RectFill(clipRect);
NSGraphics.RectFill(Bounds);
}
else
base.DrawBackground(clipRect);
Expand Down
4 changes: 2 additions & 2 deletions src/Eto.Mac/Forms/Controls/MacImageTextView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ NSTextField CreateTextFieldInternal()

public override void DrawRect(CGRect dirtyRect)
{
var bounds = Bounds;
if (BetterBackgroundColor != null)
{
BetterBackgroundColor.SetFill();
NSGraphics.RectFill(dirtyRect);
NSGraphics.RectFill(bounds);
}

if (_image != null)
{
var context = NSGraphicsContext.CurrentContext;
var bounds = Bounds;

var imageRect = new CGRect(0, bounds.Y, _imageSize.Width, _imageSize.Height);
imageRect.Y += (bounds.Height - _imageSize.Height) / 2;
Expand Down
2 changes: 1 addition & 1 deletion src/Eto.Mac/Forms/Controls/TreeViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public override void DrawBackground(CGRect clipRect)
if (backgroundColor != Colors.Transparent)
{
backgroundColor.ToNSUI().Set();
NSGraphics.RectFill(clipRect);
NSGraphics.RectFill(Bounds);
return;
}
}
Expand Down
Loading