GT Presentation: Auto-Fit Morph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

GT Presentation: Auto-Fit Morph

Sean P. DeNigris
Administrator
For large images, it can really be a drag to have ImageMorphs always open at the full size of the form. I added Fit and Fit-Width actions to my Morph presentations, but I can't figure out how to hook in to have Morphs open Fit-Width by default. As a hack, I was thinking of trying to fire the action when the presentation comes up, but I'm not sure how to do that either! Any suggestions?

I have:
    gtInspectorFormIn: composite
        <gtInspectorPresentationOrder: 0> 
        ^ composite morph
                title: 'Morph';
                display: [ self asMorph ]

The morph looked like this:


But I want to be fit inside the presentation pane, with no parts cut off.

Here's a screencast of the manual process which I'd like to automate: https://youtu.be/EsJA0dp6k8c

Thanks in advance!
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Tudor Girba-2
Hi,

Change GLMMorphPresentation and GLMMorphicMorphRenderer to support this by default and make it configurable :).

You can also try to use GLMPresentation>>initialize: which gets triggered after the presentation is installed.

Cheers,
Doru


> On Feb 16, 2016, at 3:17 AM, Sean P. DeNigris <[hidden email]> wrote:
>
> For large images, it can really be a drag to have ImageMorphs always open at
> the full size of the form. I added Fit and Fit-Width actions to my Morph
> presentations, but I can't figure out how to hook in to have Morphs open
> Fit-Width by default. As a hack, I was thinking of trying to fire the action
> when the presentation comes up, but I'm not sure how to do that either! Any
> suggestions?
>
> I have:
>    gtInspectorFormIn: composite
> <gtInspectorPresentationOrder: 0>  
> ^ composite morph
> title: 'Morph';
> display: [ self asMorph ]
>
> The morph looked like this:
> <http://forum.world.st/file/n4877731/Screenshot_2016-02-15_21.png>
>
> But I want to be fit inside the presentation pane, with no parts cut off.
>
> Here's a screencast of the manual process which I'd like to automate:
> https://youtu.be/EsJA0dp6k8c
>
> Thanks in advance!
>
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/GT-Presentation-Auto-Fit-Morph-tp4877731.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Every now and then stop and ask yourself if the war you're fighting is the right one."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Sean P. DeNigris
Administrator
Tudor Girba-2 wrote
Change GLMMorphPresentation and GLMMorphicMorphRenderer to support this by default and make it configurable :).
Yes, but what I'm asking is how! So far, I've been unsuccessful :/

Tudor Girba-2 wrote
You can also try to use GLMPresentation>>initialize: which gets triggered after the presentation is installed.
But apparently this is sent before #renderGlamorouslyOn:, so the scroll morph and target don't exist yet. Even if I #fitWidth in renderGlamorouslyOn: itself, the morph has still not been added to the pane yet, so it doesn't know what size it needs to adapt to, and seems to "fit" itself into a tiny default size.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Tudor Girba-2
Hi,

> On Feb 16, 2016, at 2:38 PM, Sean P. DeNigris <[hidden email]> wrote:
>
> Tudor Girba-2 wrote
>> Change GLMMorphPresentation and GLMMorphicMorphRenderer to support this by
>> default and make it configurable :).
>
> Yes, but what I'm asking is how! So far, I've been unsuccessful :/

Could you give me the code for "Fit to Width"?

>
> Tudor Girba-2 wrote
>> You can also try to use GLMPresentation>>initialize: which gets triggered
>> after the presentation is installed.
>
> But apparently this is sent before #renderGlamorouslyOn:, so the scroll
> morph and target don't exist yet. Even if I #fitWidth in
> renderGlamorouslyOn: itself, the morph has still not been added to the pane
> yet, so it doesn't know what size it needs to adapt to, and seems to "fit"
> itself into a tiny default size.
>

Aha. Ok, then we have to change GLMMorphPresentation.

Doru

>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/GT-Presentation-Auto-Fit-Morph-tp4877731p4877887.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Beauty is where we see it."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Tudor Girba-2
Hi,

Actually, would it not be possible to do this entirely through the layout?

Doru


> On Feb 16, 2016, at 3:09 PM, Tudor Girba <[hidden email]> wrote:
>
> Hi,
>
>> On Feb 16, 2016, at 2:38 PM, Sean P. DeNigris <[hidden email]> wrote:
>>
>> Tudor Girba-2 wrote
>>> Change GLMMorphPresentation and GLMMorphicMorphRenderer to support this by
>>> default and make it configurable :).
>>
>> Yes, but what I'm asking is how! So far, I've been unsuccessful :/
>
> Could you give me the code for "Fit to Width"?
>
>>
>> Tudor Girba-2 wrote
>>> You can also try to use GLMPresentation>>initialize: which gets triggered
>>> after the presentation is installed.
>>
>> But apparently this is sent before #renderGlamorouslyOn:, so the scroll
>> morph and target don't exist yet. Even if I #fitWidth in
>> renderGlamorouslyOn: itself, the morph has still not been added to the pane
>> yet, so it doesn't know what size it needs to adapt to, and seems to "fit"
>> itself into a tiny default size.
>>
>
> Aha. Ok, then we have to change GLMMorphPresentation.
>
> Doru
>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> View this message in context: http://forum.world.st/GT-Presentation-Auto-Fit-Morph-tp4877731p4877887.html
>> Sent from the Moose mailing list archive at Nabble.com.
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.list.inf.unibe.ch/listinfo/moose-dev
>
> --
> www.tudorgirba.com
> www.feenk.com
>
> "Beauty is where we see it."
>
>
>
>

--
www.tudorgirba.com
www.feenk.com

"Don't give to get. Just give."






_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Tudor Girba-2 wrote
Could you give me the code for "Fit to Width"?
fitWidth
    scrollMorph scrollTarget extent: (scrollMorph width @ (scrollMorph scrollTarget height * (scrollMorph width / scrollMorph scrollTarget width)))
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Tudor Girba-2
Hi,

> On Feb 16, 2016, at 2:49 PM, Sean P. DeNigris <[hidden email]> wrote:
>
> Tudor Girba-2 wrote
>> Could you give me the code for "Fit to Width"?
>
> fitWidth
>    scrollMorph scrollTarget extent: (scrollMorph width @ (scrollMorph
> scrollTarget height * (scrollMorph width / scrollMorph scrollTarget width)))

Ok. This is a one time show. I would more be interested in a persistent state of fitting to width. That is why I thought about the layout. What do you think?

Doru

>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/GT-Presentation-Auto-Fit-Morph-tp4877731p4877896.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Every thing should have the right to be different."




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Sean P. DeNigris
Administrator
Tudor Girba-2 wrote
Ok. This is a one time show. I would more be interested in a persistent state of fitting to width. That is why I thought about the layout. What do you think?
Sounds great. First I'd like to get this working at least as a one-time since I need it for a project, but would love to help explore the layout option if given some pointers.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: GT Presentation: Auto-Fit Morph

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Tudor Girba-2 wrote
Change GLMMorphPresentation and GLMMorphicMorphRenderer to support this by default and make it configurable :).
I created an issue with WIP code last summer (https://github.com/moosetechnology/Moose/issues/11260). I've been hoping for some feedback to polish it ;)
Cheers,
Sean