Commit 401b75e3 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Scale large system tray icons down to fit status bar.

parent 787a937e
...@@ -149,8 +149,21 @@ void macdrv_set_status_item_image(macdrv_status_item s, CGImageRef cgimage) ...@@ -149,8 +149,21 @@ void macdrv_set_status_item_image(macdrv_status_item s, CGImageRef cgimage)
NSImage* image = nil; NSImage* image = nil;
if (cgimage) if (cgimage)
{ {
NSSize size;
CGFloat maxSize = [[NSStatusBar systemStatusBar] thickness];
BOOL changed = FALSE;
image = [[NSImage alloc] initWithCGImage:cgimage size:NSZeroSize]; image = [[NSImage alloc] initWithCGImage:cgimage size:NSZeroSize];
CGImageRelease(cgimage); CGImageRelease(cgimage);
size = [image size];
while (size.width > maxSize || size.height > maxSize)
{
size.width /= 2.0;
size.height /= 2.0;
changed = TRUE;
}
if (changed)
[image setSize:size];
} }
[statusItem.item setImage:image]; [statusItem.item setImage:image];
[image release]; [image release];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment