You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Noel Grandin <no...@gmail.com> on 2009/10/27 14:43:51 UTC

resizing support for Sheet

Hi

I'm looking at resizing support for Sheet, which is so far a pretty
copy'n'paste of the code from Frame, but one thing I don't get - the way
Pivot handles preferred-size.

Why is resizing support on Frame conditional on a preferred-width or a
preferred-height being set?

Thanks, Noel.

Re: resizing support for Sheet

Posted by Todd Volkert <tv...@gmail.com>.
Just found an instance of resizable sheets on the Mac, and they solved this
issue very nicely - they manage the both reposition the sheet as it's
resized *and* keep the mouse pointer over the resize handle :)

They do this by resizing the width by 2 pixels for every 1 pixel in
x-coordinate change.  So if you move the mouse 5 pixels to the right, the
sheet becomes 10 pixels wider, and due to the auto-resizing, 5 pixels get
allocated to the left, and 5 to the right -- thus keeping the mouse cursor
correctly over the resize handle.

-R

On Tue, Oct 27, 2009 at 9:59 AM, Todd Volkert <tv...@gmail.com> wrote:

> Noel, if you're working on resizable sheets, the real tricky part is going
> to be reconciling the position of the sheet with respect to the mouse cursor
> (because the sheet will automatically re-center itself over its owner when
> it's resized).
>
> Usually, when you resize a window, your cursor stays over the resize handle
> while you resize the window.  But if the window were to reposition itself
> underneath you while you were dragging, this would change things -- and make
> it fairly confusing for the user.  It's almost as if you want the sheet to
> hold off on repositioning itself until you release the mouse, and then
> transition smoothly to its new position.
>
> -T
>
>
> On Tue, Oct 27, 2009 at 9:50 AM, Greg Brown <gk...@mac.com> wrote:
>
>> If the preferred size is not explicitly set, the window is set to its
>> default size and we disallow resizing. Otherwise, we allow the user to
>> change the size.
>>
>> We could allow the user to resize the window in either case, but then
>> there would be no way for the user to tell the window to revert to its
>> automatically calculated preferred size. We could add a button to the window
>> trim that supported this, but for now we just disallow resizing in this
>> case.
>>
>>
>> On Tuesday, October 27, 2009, at 09:43AM, "Noel Grandin" <
>> noelgrandin@gmail.com> wrote:
>> >Hi
>> >
>> >I'm looking at resizing support for Sheet, which is so far a pretty
>> >copy'n'paste of the code from Frame, but one thing I don't get - the way
>> >Pivot handles preferred-size.
>> >
>> >Why is resizing support on Frame conditional on a preferred-width or a
>> >preferred-height being set?
>> >
>> >Thanks, Noel.
>> >
>> >
>>
>
>

Re: resizing support for Sheet

Posted by Todd Volkert <tv...@gmail.com>.
Noel, if you're working on resizable sheets, the real tricky part is going
to be reconciling the position of the sheet with respect to the mouse cursor
(because the sheet will automatically re-center itself over its owner when
it's resized).

Usually, when you resize a window, your cursor stays over the resize handle
while you resize the window.  But if the window were to reposition itself
underneath you while you were dragging, this would change things -- and make
it fairly confusing for the user.  It's almost as if you want the sheet to
hold off on repositioning itself until you release the mouse, and then
transition smoothly to its new position.

-T

On Tue, Oct 27, 2009 at 9:50 AM, Greg Brown <gk...@mac.com> wrote:

> If the preferred size is not explicitly set, the window is set to its
> default size and we disallow resizing. Otherwise, we allow the user to
> change the size.
>
> We could allow the user to resize the window in either case, but then there
> would be no way for the user to tell the window to revert to its
> automatically calculated preferred size. We could add a button to the window
> trim that supported this, but for now we just disallow resizing in this
> case.
>
>
> On Tuesday, October 27, 2009, at 09:43AM, "Noel Grandin" <
> noelgrandin@gmail.com> wrote:
> >Hi
> >
> >I'm looking at resizing support for Sheet, which is so far a pretty
> >copy'n'paste of the code from Frame, but one thing I don't get - the way
> >Pivot handles preferred-size.
> >
> >Why is resizing support on Frame conditional on a preferred-width or a
> >preferred-height being set?
> >
> >Thanks, Noel.
> >
> >
>

Re: resizing support for Sheet

Posted by Noel Grandin <no...@gmail.com>.
I must be slow today - I don't get it.

If there is a preferred width or height set, the window can use that to
implement the restore function.

Surely, if there is no explicitly set width/height, the restore function
will just restore to the "natural" size??


Greg Brown wrote:
> If the preferred size is not explicitly set, the window is set to its default size and we disallow resizing. Otherwise, we allow the user to change the size.
>
> We could allow the user to resize the window in either case, but then there would be no way for the user to tell the window to revert to its automatically calculated preferred size. We could add a button to the window trim that supported this, but for now we just disallow resizing in this case.
>
>  
> On Tuesday, October 27, 2009, at 09:43AM, "Noel Grandin" <no...@gmail.com> wrote:
>   
>> Hi
>>
>> I'm looking at resizing support for Sheet, which is so far a pretty
>> copy'n'paste of the code from Frame, but one thing I don't get - the way
>> Pivot handles preferred-size.
>>
>> Why is resizing support on Frame conditional on a preferred-width or a
>> preferred-height being set?
>>
>> Thanks, Noel.
>>
>>
>>     


Re: resizing support for Sheet

Posted by Greg Brown <gk...@mac.com>.
If the preferred size is not explicitly set, the window is set to its default size and we disallow resizing. Otherwise, we allow the user to change the size.

We could allow the user to resize the window in either case, but then there would be no way for the user to tell the window to revert to its automatically calculated preferred size. We could add a button to the window trim that supported this, but for now we just disallow resizing in this case.

 
On Tuesday, October 27, 2009, at 09:43AM, "Noel Grandin" <no...@gmail.com> wrote:
>Hi
>
>I'm looking at resizing support for Sheet, which is so far a pretty
>copy'n'paste of the code from Frame, but one thing I don't get - the way
>Pivot handles preferred-size.
>
>Why is resizing support on Frame conditional on a preferred-width or a
>preferred-height being set?
>
>Thanks, Noel.
>
>