• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Resolution-independent toolbar icons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resolution-independent toolbar icons


  • Subject: Re: Resolution-independent toolbar icons
  • From: Shamyl Zakariya <email@hidden>
  • Date: Mon, 18 Jun 2007 10:55:52 -0400

For what it's worth, I've used PDF icons for non-toolbar buttons ( the "Small Square Button" NSButton subtype ) and it's worked quite well for me. This sounds like a bug worth reporting.

email@hidden
    "It's all malarky; even the wonderful part is malarky"
        --Robert Stack


On Jun 16, 2007, at 10:18 AM, Phill Kelley wrote:

I've been experimenting with resolution independence on toolbar icons.

All my icon artwork starts life in Adobe Illustrator and, up until now, has
moved through Photoshop and tiffutil on its way to my application. The
icons were originally drawn within a 128x128 pixel bounding box but I would
scale each to 25% in Illustrator so that I would get 32x32 icons when the
artwork was pasted into Photoshop.


I assumed that "resolution independence" would mean that I could forget
about the 25% scaling step. I just saved each to a PDF, changed the toolbar
item building method to point to the PDFs instead of the tiffs, and rebuilt
the app.


When I launched the app, each toolbar item icon had a white background. I
double-checked that the PDFs had transparent backgrounds - they did. I also
blew away the NSToolbar Configuration stuff in the app's preferences file
in case that was interfering but it made no difference.


This is a document-based app. The next thing I noticed was that the white
backgrounds were only present on the first document opened (whether a
default untitled document or double-clicking a document to cause the app to
launch). For the second and subsequent documents, the toolbar icons get
transparent backgrounds.


I also noticed that anything that caused an icon to redraw would fix the
problem for that icon. Something like customizing the toolbar of the first
document (adding or removing an icon, or changing between small and large
icon sizes), would immediately redraw all the toolbar icons with
transparent backgrounds.


Then I wondered whether the nominal 128x128 starting size was the cause of
my problems so I created 32x32 PDFs. That did cause a change - all toolbar
icons always get white backgrounds.


I am setting the image via:

NSImage *image = [NSImage imageNamed:@"example.pdf"];
[image setBackgroundColor:[NSColor clearColor]]; // should be default
anyway
[toolbarItem setImage:image];


This is all under 10.4.9 but to forestall the obvious questions as to
whether I have tried it with a "later" version of the OS, let's just say
that I have no reason to believe that there are any differences.


Has anyone else been traveling down a similar path to
resolution-independent toolbar icons? Any suggestions?


Regards, PK _______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Resolution-independent toolbar icons
      • From: Chris Suter <email@hidden>
References: 
 >Resolution-independent toolbar icons (From: Phill Kelley <email@hidden>)

  • Prev by Date: Re: Drawing from lower left, why?
  • Next by Date: Re: NSImageView + NSViewAnimation
  • Previous by thread: Re: Resolution-independent toolbar icons
  • Next by thread: Re: Resolution-independent toolbar icons
  • Index(es):
    • Date
    • Thread