diff options
author | Greg Munn <greg@sgmunn.com> | 2015-01-29 19:41:45 +0300 |
---|---|---|
committer | Greg Munn <greg@sgmunn.com> | 2015-01-29 21:49:58 +0300 |
commit | 87bfb9b9939997d47ab035d279d27dbea3d76b1d (patch) | |
tree | 88d1e617818917a61c62887fbe64ca7fdc831bbe /main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs | |
parent | d0e0b364d9f617f4503d5b580c0cdc13f3022c58 (diff) |
[MacPlatform] Fix blurry icons in AlertDialogs.
Diffstat (limited to 'main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs')
-rw-r--r-- | main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs index 3dc2186219..6dae47989f 100644 --- a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs +++ b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs @@ -58,16 +58,10 @@ namespace MonoDevelop.MacIntegration alert.AlertStyle = NSAlertStyle.Informational; stockIcon = data.Message.Icon == MonoDevelop.Ide.Gui.Stock.Information; } - - //FIXME: use correct size so we don't get horrible scaling? + if (!stockIcon && !string.IsNullOrEmpty (data.Message.Icon)) { - var pix = ImageService.GetIcon (data.Message.Icon, Gtk.IconSize.Dialog).ToPixbuf(); - byte[] buf = pix.SaveToBuffer ("tiff"); - unsafe { - fixed (byte* b = buf) { - alert.Icon = new NSImage (NSData.FromBytes ((IntPtr)b, (uint)buf.Length)); - } - } + var img = ImageService.GetIcon (data.Message.Icon, Gtk.IconSize.Dialog); + alert.Icon = img.ToNSImage (); } else { //for some reason the NSAlert doesn't pick up the app icon by default alert.Icon = NSApplication.SharedApplication.ApplicationIconImage; |