You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Greg Brown <gk...@mac.com> on 2009/08/31 16:40:47 UTC

Re: Form Label Vertical Alignment

I think a few things have changed since you started working on it -  
not sure how it was implemented, but I think you mentioned adding a  
new value to the VerticalAlignment enum. If so, I'd like to suggest a  
different approach - adding a boolean "alignToBaseline" style to  
containers that support it. I think this will be more consistent with  
how baseline alignment is handled in AWT.

Containers that I imagine might want to support this style include:

- FlowPane ("alignToBaseline")
- Form ("alignLabelsToBaseline")

I don't think it belongs in BoxPane since it would conflict with the  
"verticalAlignment" style.

Are there others?

G


On Aug 31, 2009, at 10:36 AM, Noel Grandin wrote:

>  Hi
>
> Yeah, I started work on doing baseline support, but I didn't get  
> around to finishing it.
>
> I'm surprised it's that noticeable - it's normally only graphic- 
> design people who spot the mis-alignment, since it's generally only  
> off by 1 or 2 pixels.
>
> The relevant issue is
>   http://issues.apache.org/jira/browse/PIVOT-99
> if you want to add yourself to the CC list.
>
> I'll see if I can dig the patch out - maybe with some hindsight I  
> can sort out the nigglies I had then :-)
>
> Regards, Noel.
>
>
> On Aug 30, 2009, at 5:43 PM, Scott Lanham wrote:
>
> > Hi,
> >
> > On my Linux system the text of Form Labels sits higher than the text
> > in an
> > associated TextInput. Does anyone else see this effect on their
> > system?
> >
> > Cheers,
> >
> > Scott.
>


Re: Form Label Vertical Alignment

Posted by Greg Brown <gk...@mac.com>.
Now that I think of it, I'm wondering if it is even necessary to make  
this configurable in TerraFormSkin. Is there actually a case where we  
would not want the form labels to be baseline-aligned? I do think that  
a style is appropriate for FlowPane, though.


On Aug 31, 2009, at 10:56 AM, Greg Brown wrote:

>> The problem I had was figuring out how to get a baseline value out  
>> of a TextArea - any suggestion on where to start?
>
> I think a similar question applies to a vertical BoxPane, for  
> example, or a TablePane. I imagine that a common requirement would  
> be to align the form label with the baseline of the first component  
> in a vertical box pane, or the first row of a table pane. Similarly,  
> we'd probably want to define the baseline of a TextArea as the  
> baseline of the first row.
>
> However, each of these components could make its definition of  
> baseline configurable. For example, BoxPaneSkin could provide a  
> style that allowed a caller to define the baseline as the baseline  
> of the last component instead. I'm not sure we'd need to support  
> that right away, though. We could easily add it later, if it made  
> sense.
>
> G
>


Re: Form Label Vertical Alignment

Posted by Greg Brown <gk...@mac.com>.
Now that I think of it, I'm wondering if it is even necessary to make  
this configurable in TerraFormSkin. Is there actually a case where we  
would not want the form labels to be baseline-aligned? I do think that  
a style is appropriate for FlowPane, though.


On Aug 31, 2009, at 10:56 AM, Greg Brown wrote:

>> The problem I had was figuring out how to get a baseline value out  
>> of a TextArea - any suggestion on where to start?
>
> I think a similar question applies to a vertical BoxPane, for  
> example, or a TablePane. I imagine that a common requirement would  
> be to align the form label with the baseline of the first component  
> in a vertical box pane, or the first row of a table pane. Similarly,  
> we'd probably want to define the baseline of a TextArea as the  
> baseline of the first row.
>
> However, each of these components could make its definition of  
> baseline configurable. For example, BoxPaneSkin could provide a  
> style that allowed a caller to define the baseline as the baseline  
> of the last component instead. I'm not sure we'd need to support  
> that right away, though. We could easily add it later, if it made  
> sense.
>
> G
>


Re: Form Label Vertical Alignment

Posted by Greg Brown <gk...@mac.com>.
> The problem I had was figuring out how to get a baseline value out  
> of a TextArea - any suggestion on where to start?

I think a similar question applies to a vertical BoxPane, for example,  
or a TablePane. I imagine that a common requirement would be to align  
the form label with the baseline of the first component in a vertical  
box pane, or the first row of a table pane. Similarly, we'd probably  
want to define the baseline of a TextArea as the baseline of the first  
row.

However, each of these components could make its definition of  
baseline configurable. For example, BoxPaneSkin could provide a style  
that allowed a caller to define the baseline as the baseline of the  
last component instead. I'm not sure we'd need to support that right  
away, though. We could easily add it later, if it made sense.

G


Re: Form Label Vertical Alignment

Posted by Greg Brown <gk...@mac.com>.
> The problem I had was figuring out how to get a baseline value out  
> of a TextArea - any suggestion on where to start?

I think a similar question applies to a vertical BoxPane, for example,  
or a TablePane. I imagine that a common requirement would be to align  
the form label with the baseline of the first component in a vertical  
box pane, or the first row of a table pane. Similarly, we'd probably  
want to define the baseline of a TextArea as the baseline of the first  
row.

However, each of these components could make its definition of  
baseline configurable. For example, BoxPaneSkin could provide a style  
that allowed a caller to define the baseline as the baseline of the  
last component instead. I'm not sure we'd need to support that right  
away, though. We could easily add it later, if it made sense.

G


Re: Form Label Vertical Alignment

Posted by Noel Grandin <no...@gmail.com>.
Looking at the patch I still have....

Yeah, those were the containers where it made most sense.

The problem I had was figuring out how to get a baseline value out of a
TextArea - any suggestion on where to start?

-- Noel.

Greg Brown wrote:
> I think a few things have changed since you started working on it -
> not sure how it was implemented, but I think you mentioned adding a
> new value to the VerticalAlignment enum. If so, I'd like to suggest a
> different approach - adding a boolean "alignToBaseline" style to
> containers that support it. I think this will be more consistent with
> how baseline alignment is handled in AWT.
>
> Containers that I imagine might want to support this style include:
>
> - FlowPane ("alignToBaseline")
> - Form ("alignLabelsToBaseline")
>
> I don't think it belongs in BoxPane since it would conflict with the
> "verticalAlignment" style.
>
> Are there others?
>
> G
>
>
> On Aug 31, 2009, at 10:36 AM, Noel Grandin wrote:
>
>> Hi
>>
>> Yeah, I started work on doing baseline support, but I didn't get around to finishing it.
>>
>> I'm surprised it's that noticeable - it's normally only graphic-design people who spot the mis-alignment, since it's generally only off by 1 or 2 pixels.
>>
>> The relevant issue is 
>>   http://issues.apache.org/jira/browse/PIVOT-99
>> if you want to add yourself to the CC list.
>>
>> I'll see if I can dig the patch out - maybe with some hindsight I can sort out the nigglies I had then :-)
>>
>> Regards, Noel.
>>
>>
>> On Aug 30, 2009, at 5:43 PM, Scott Lanham wrote:
>>
>> > Hi,
>> >
>> > On my Linux system the text of Form Labels sits higher than the text  
>> > in an
>> > associated TextInput. Does anyone else see this effect on their  
>> > system?
>> >
>> > Cheers,
>> >
>> > Scott.
>>     
>>
>


Re: Form Label Vertical Alignment

Posted by Noel Grandin <no...@gmail.com>.
Looking at the patch I still have....

Yeah, those were the containers where it made most sense.

The problem I had was figuring out how to get a baseline value out of a
TextArea - any suggestion on where to start?

-- Noel.

Greg Brown wrote:
> I think a few things have changed since you started working on it -
> not sure how it was implemented, but I think you mentioned adding a
> new value to the VerticalAlignment enum. If so, I'd like to suggest a
> different approach - adding a boolean "alignToBaseline" style to
> containers that support it. I think this will be more consistent with
> how baseline alignment is handled in AWT.
>
> Containers that I imagine might want to support this style include:
>
> - FlowPane ("alignToBaseline")
> - Form ("alignLabelsToBaseline")
>
> I don't think it belongs in BoxPane since it would conflict with the
> "verticalAlignment" style.
>
> Are there others?
>
> G
>
>
> On Aug 31, 2009, at 10:36 AM, Noel Grandin wrote:
>
>> Hi
>>
>> Yeah, I started work on doing baseline support, but I didn't get around to finishing it.
>>
>> I'm surprised it's that noticeable - it's normally only graphic-design people who spot the mis-alignment, since it's generally only off by 1 or 2 pixels.
>>
>> The relevant issue is 
>>   http://issues.apache.org/jira/browse/PIVOT-99
>> if you want to add yourself to the CC list.
>>
>> I'll see if I can dig the patch out - maybe with some hindsight I can sort out the nigglies I had then :-)
>>
>> Regards, Noel.
>>
>>
>> On Aug 30, 2009, at 5:43 PM, Scott Lanham wrote:
>>
>> > Hi,
>> >
>> > On my Linux system the text of Form Labels sits higher than the text  
>> > in an
>> > associated TextInput. Does anyone else see this effect on their  
>> > system?
>> >
>> > Cheers,
>> >
>> > Scott.
>>     
>>
>