Ismael's blog

Aller au contenu | Aller au menu | Aller à la recherche

Wednesday 20 June 2007

GSOC: tabs improved, other controls started

A debate started (the starting mail) on mac@porting and discuss@ux mailing lists concerning tabs in OOo after I wrote my previous post. Indeed, on Mac OS X, there can't be several lines of tabs, and when it's the case, a popup-menu (named listbox in OOo) is used instead. So I started to modify the general implementation of tabs in VCL. At that time, the result is very unstable and really experimental, but i have a better Mac OS X behaviour for tabs: when there is only one line: normal tabs are used; when there are more than one line, a listbox is used instead.


I also worked on drawing some native controls like text edits or list boxes. For the firsts, i still have some problems: the background is transparent (so grey as windows have grey backgrounds), and the focus rect is not drawn. I have to look at it. Concerning the second, listboxes, the button is correct, but the frame is not yet vertically centered as it should be in Mac OS X.

Example of a listbox and a text edit

Tuesday 12 June 2007

GSOC: two styles of tabs

I fixed the bug i mentioned in the previous post. Now there is no more space between two lines of tabs.


But the tabs hadn't the newest look.

Image from the AHIG

So I investigated. Eric Bachard told me about some undocumented functions and flags to have tabs with MacOSX10.4 look. After some other and deeper investigations, i found how to have them.

I then modified some parts of the platform independent part of VCL to have tabs centered, and to have VCL which asks for the tab size to the native part of it by using getNativeControlRegion. I still have to remove bold text for focused tab which is in the platform independent part of VCL although it is a platform dependent behavior.

Now tabs are drawn correctly, behave normally, and respect fully the AHIG. Their normal height is 20 pixel and a space of 12 pixels is left between the text and the border.

But with this style of tabs, there's a problem. When there are too much tabs, two lines of tabs are drawn, and the result is a bit dirty:

So i don't know yet which style of tabs is most adapted to OOo.

The patch (which contains also a bugfix to prevent AquaSalGraphics::hitTestNativeControl from crashing)
To have the old style of tabs just uncomment //#define OLD_TAB_STYLE

Monday 4 June 2007

GSOC: first days

The Google Summer of Code coding period has started for few days (since May 28). The subject of my GSOC is to complete User Interface respecting Aqua Human Interface Guidelines (which concerns the mac native port).

I started to implement aqua tabs. In most cases, they are well drawn, but when we have two lines of tabs, there's a space between the two lines.

As usual screenshots:




The focused tab has bold text, but according to the AHIG it should not. The problem, in fact, comes from the platform independent part of VCL. Indeed, in the TabControl class (see vcl/source/control/tabctrl.cxx), when a tab is focused, a bold font is selected. This is a platform dependent behavior and so should not be in the platform independent part, IMHO.
The code i was talking about:

void TabControl::ImplShowFocus()
{
   // make sure the focussed item rect is computed using a bold font
   // the font may have changed meanwhile due to mouse over
   Font aOldFont( GetFont() );
   Font aFont( aOldFont );
   aFont.SetWeight( WEIGHT_BOLD );
   SetFont( aFont );
...
}