[info-mcl] Tab views
Octav Popescu
octav at cmu.edu
Sun Sep 7 18:17:29 CDT 2008
Octav Popescu wrote:
> Octav Popescu wrote:
>> Terje Norderhaug wrote:
>>> On Sep 6, 2008, at 7:24 PM, Octav Popescu wrote:
>>>>>> More important, this is not the standard tab aspect in OS X
>>>>>> 10.5. You can see in the second capture what they look like in
>>>>>> one of the System Preferences panes. Any chance to make it look
>>>>>> that way? I don't know if that look is available in Carbon
>>>>>> though. Here's the HIG page that talks about it:
>>>>>>
>>>>>> http://developer.apple.com/DOCUMENTATION/UserExperience/Conceptual/
>>>>>> AppleHIGuidelines/XHIGControls/chapter_19_section_7.html
>>>>>>
>>>>>
>>>>> The style of the tabs can be controlled through the :version
>>>>> attribute of the :HIThemeTabDrawInfo record passed to
>>>>> #_HiThemeDrawTextBox as inDrawInfo. Setting :version to 1 makes
>>>>> the tabs appear as segmented controls (modern appearance) while
>>>>> a :version of 0 produces traditional tabs (legacy appearance).
>>>>> The clipping or size of the tab view will have to be changed to
>>>>> make segmented controls fit.
>>>>
>>>> This does make a change, see test-mpv3. I can move the text to the
>>>> right position, but as you see the text and the tabs don't overlap.
>>>> How can I fix this? It also seems like each button starts with a
>>>> round left side, they're not part of one continuous segmented control.
>>>
>>> The text and tab aligns in the enclosed demo. Getting the proper
>>> round sides requires upgrading the HIThemeTabDrawInfo to have
>>> additional properties for :kind and :position. The latter can be
>>> used to specify whether the tab is should have a rounded side before
>>> and/or after. -- Terje
>>>
>>
>> This does get the right continuous look for the tab bar, but the text
>> and tab bar still don't align. See attached capture (after I also put
>> the #$kHIThemeOrientationInverted back). I tried it on two different
>> computers, both running 10.5.4, and I got the same result. So
>> something is different in 10.5. Maybe it needs different origins for
>> text and tab rectangles?
>>
>> Octav
>
> Wait, I just fixed this. :) I put #$kHIThemeOrientationInverted
> instead of #$kHIThemeOrientationNormal in #_HiThemeDrawTab and now
> they align, see test-mpv5. But it seems the text is a little high in
> the tab. So I also changed $kHIThemeTextVerticalFlushCenter to
> $kHIThemeTextVerticalFlushBottom in the :HIThemeTextInfo for
> #_HiThemeDrawTextBox, and it looks better, see test-mpv6.
>
> Now the only thing left is positioning the tab bar correctly. Getting
> it lower is easy, but the HIG says it should also be centered over the
> pane. How can I do that? I don't know the width of the tab bar so I
> can compute a horizontal offset.
>
> Octav
>
I played with the offsets a little more to position things better. See
the result in test-mpv7. It still has two problems. One is the centering
of the tab bar that I was talking about above. The other is that when
you click on the tabs, one of them is losing the lower black line, as
you can see with tab 3 in test-mpv8. Any idea how to fix that?
I also think that in the final version it would be useful if the version
parameter that allows you to choose between modern and legacy tab style
would be a method parameter available for the user. And the tab offsets
should of course be conditioned on it.
Octav
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-tabs.lisp
URL: <http://clozure.com/pipermail/info-mcl/attachments/20080907/54a23665/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-mpv7.tiff
Type: image/tiff
Size: 20002 bytes
Desc: not available
URL: <http://clozure.com/pipermail/info-mcl/attachments/20080907/54a23665/attachment.tiff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-mpv8.tiff
Type: image/tiff
Size: 20176 bytes
Desc: not available
URL: <http://clozure.com/pipermail/info-mcl/attachments/20080907/54a23665/attachment-0001.tiff>
More information about the info-mcl
mailing list