wiln / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

tabOffset of TabNavigator not processed by SuperTabNavigator ? #128

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi all,

I'm trying to put an offset in order to not have the left and right buttons
"over" tabs.

I see that : "Inheritance   SuperTabNavigator Inheritance
mx.containers.TabNavigator" so I try the "tabOffset" CSS attribute of
TabNavigator to do my stuff.

But in fact, this doesn't work. There is no compilation error but there is
no offset :/

What is wrong ?

Note : I've try to set the offset by a SuperTabNavigator style in my .css,
and by "offset=X" in the <SuperTabNavigator .../> in my mxml.

Original issue reported on code.google.com by maxime.d...@gmail.com on 28 May 2008 at 2:12

GoogleCodeExporter commented 8 years ago

Original comment by dmcc...@gmail.com on 8 Jan 2009 at 5:11

GoogleCodeExporter commented 8 years ago
Issue 131 has been merged into this issue.

Original comment by dmcc...@gmail.com on 8 Jan 2009 at 5:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have the same issue.

After looking at the sources, I found that SuperTabNavigator.updateDisplayList()
doesn't seem to take in account the tabOffset. Is there any reason for this, or 
is
this just something that was forgotten.

*** from TabNavigator.updateDisplayList() ***
var leftOffset:Number = getStyle("tabOffset");

if(tabBarWidth < canvasWidth) {
        switch (getStyle("horizontalAlign"))
        {
        case "left":
            tabBar.move(0 + leftOffset, tabBar.y);
            break;
        case "right":
            tabBar.move(unscaledWidth - tabBar.width + leftOffset, tabBar.y);
            break;
        case "center":
            tabBar.move((unscaledWidth - tabBar.width) / 2 + leftOffset, tabBar.y);
        }
}
***

Original comment by christophe.herreman on 20 Mar 2009 at 3:24

GoogleCodeExporter commented 8 years ago
hi all

same issue here,
any luck in finding a workaround? 
 ty

Original comment by jer...@gmail.com on 4 May 2009 at 9:59

GoogleCodeExporter commented 8 years ago
I'm not a contributor on this project (ie I don't have access to commit to the 
source
repo). The change that needs to be made is incredibly simple:

Go to the updateDisplayList and replace lines 966 - 980 with the following:

[CODE]
var leftOffset:Number = getStyle("tabOffset");

            /* we only care about horizontalAlign if we're not taking up too
               much space already */
            if(tabBarWidth < canvasWidth) {

                switch (getStyle("horizontalAlign")) {
                    case "left":
                        tabBar.move(0 + leftOffset, tabBar.y);
                        break;
                    case "right":
                        tabBar.move(unscaledWidth - tabBar.width + leftOffset, tabBar.y);
                        break;
                    case "center":
                        tabBar.move((unscaledWidth - tabBar.width) / 2 + leftOffset, tabBar.y);
                }
            }
[/CODE]

Notice that I'm using exactly what Adobe's TabNav ( the parent class ) is doing 
in
their algorithm.

Original comment by johntimo...@gmail.com on 9 Feb 2010 at 10:25