Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Munn <greg@sgmunn.com>2015-01-29 19:41:45 +0300
committerGreg Munn <greg@sgmunn.com>2015-01-29 21:49:58 +0300
commit87bfb9b9939997d47ab035d279d27dbea3d76b1d (patch)
tree88d1e617818917a61c62887fbe64ca7fdc831bbe /main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
parentd0e0b364d9f617f4503d5b580c0cdc13f3022c58 (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.cs12
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;