From: Andrew G. <ag...@em...> - 2003-04-25 04:05:49
|
I'm checking in a partial fix, finally. A long time ago all controls had well defined bounds, and occupied them fully. The solution I used for rendering the ring around default buttons I stole from MacApp -- we'd put a ZPaneAdorner on default buttons that just drew the ring (ZPaneAdorners are now only used for drawing selection outlines over the top of panes). When the Platinum appearance, um, appeared, a button marked as default actually had a different shape from a regular button, but still needed to be aligned with other controls based on the bounds of the button proper. That's what ZUIButton::GetInsets is for -- it reports the compensating factor that has to be applied to the top left and bottom right corners of the nominal bounds. Those insets I was generating manually. Anyway, I hadn't noticed, but the Appearance Manager some time ago added GetThemeButtonBackgroundBounds, which reports exactly the information we need. With Aqua that larger boundary is now (apparently) 4 pixels on the top, left and right edges and 8(!) on the bottom. Which in our current architecture makes a whole bunch of pixels behave as if they're part of the button when they just look like background. So what I've done is to use GetThemeButtonBackgroundBounds when we're not using Aqua (actually when we're not a Carbon app or are not running on MacOSX), and empirically derived insets of 1, 0, 1 and 3 (left, top, right and bottom) if we are using Aqua. On a related note, rendering default buttons has worsened with Jaguar. It used to be that the Appearance Manager would at least draw a default button in blue, although there was no way to get the pulsing look. Now it won't even do that. I've reported it as a bug, as have others. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |