pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lello <rborre...@gmail.com>
Subject Re: TabPane corner and button style
Date Wed, 06 Apr 2011 08:17:23 GMT
Sorry I gave a wrong information,
the right arrow is not hidden, it's there. So the only problem is the size
of the corner component
which is almost the double of its actual component, and of course the fact
that I had to add
a new method to the basic skin, unless I want to rewrite the entire skin.

lello wrote:
> Unfortunately the problem is not so simple to solve.
> First, I have modified TerraTabPaneSkin adding a getButtonPanorama()
> method,
> as I need to access the buttonPanorama.
> Second, following your suggestion I used the code:
> int cornerWidth = corner.getPreferredSize().width;
> int buttonPanoramaWidth = width - cornerWidth;
> The final layout is a bit weird, with a very large area for the corner
> component, and,
> furthermore, I loose the right arrow which allows me to move along the
> opened tabs
> (the arrow that appears when you have completely filled the width of the
> tabPane).
> Do you think it is possible to change the design of the basic
> TerraTabPaneSkin to meet the
> requirement that the corner component should never be hidden?
> Greg Brown-2 wrote:
>>>>> First: I am trying to use the "corner" component of a tabpane to
>>>>> display
>>>>> a
>>>>> menubutton. However I noticed that if I open a large number of tabs,
>>>>> the
>>>>> corner component gets hidden by the tabs, is this a bug?
>>>> Possibly. It was originally done this way by design, but that may not
>>>> have
>>>> been the right approach.
>>> Could you suggest me a simple way to modify/extend TabPaneSkin so to
>>> have
>>> the desired behaviour?
>>> Or just the functions that I have to override.
>> You'll have to modify TerraTabPaneSkin#layout(). The corner width is
>> currently determined as follows:
>> int buttonPanoramaWidth = Math.min(width, buttonPanoramaSize.width);
>> ...
>> int cornerWidth = width - buttonPanoramaWidth;
>> You'll probably want to calculate the corner width first (by calling
>> corner.getPreferredSize()) and then calculate the panorama width from
>> that.

View this message in context: http://apache-pivot-users.399431.n3.nabble.com/TabPane-corner-and-button-style-tp2778983p2784110.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

View raw message