Opened 8 years ago

Closed 4 years ago

#10256 closed Patch - Feature (Fixed)

Animation support

Reported by: Jonatan <mythtv@…> Owned by: Jonatan Lindblad
Priority: minor Milestone: 0.28
Component: MythTV - User Interface Library Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patch adds the possibility to animate the showing and hiding of windows. Supported parameters are position, alpha, zoom, and angle, plus duration and easing curve. It's partially based on the patch in #8975 that adds an Effects struct.

Extending this to support other events should be possible by using signals (i.e. TakingFocus?, LosingFocus?, etc.) and slots.

Here's an example of how to add a position and alpha animation to the popup dialog in Arclight:

<window name="MythPopupBox">
    <area>1320,0,600,1080</area>                 
    <animation type="position" when="AboutToShow" start="1920,-1" end="-1,-1" easingcurve="OutQuart" duration="500"/>
    <animation type="alpha" when="AboutToShow" start="0" end="255" easingcurve="OutQuart" duration="500"/>
    <animation type="position" when="AboutToHide" end="1920,-1" start="-1,-1" easingcurve="InQuart" duration="500"/>
    <animation type="alpha" when="AboutToHide" end="0" start="255" easingcurve="InQuart" duration="500"/>
    ...
</window>

Attachments (1)

animation.patch (26.8 KB) - added by Jonatan <mythtv@…> 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by Jonatan <mythtv@…>

Attachment: animation.patch added

comment:1 Changed 8 years ago by stuartm

Milestone: unknown0.25
Version: UnspecifiedTrunk Head

Thanks for the patch.

I once proposed a different xml markup for animations, I think it would be worth getting it right from the start. I don't have the original to hand but it went something like this:

<animation name="showing" trigger="AboutToShow">
    <unit duration="500"> <!-- duration can also be specified per item if different -->
        <move start="x,y" end="x2,y2" path="linear" easingcurve="OutQuart" />
        <alpha start="0" end="255" />
    </unit>
    <wait duration="100">
    <unit>
        <!-- No second unit in your example, but units would occur in sequence instead of parallel -->
    </unit> 
</animation>

<animation name="hiding" trigger="AboutToHide">
    <!-- Well you get the idea -->
</animation>

I wonder if we can't find a more readily understandable names for easingcurve and it's various values, not essential since their meaning can be found through google but for example 'outQuart' could be 'decelerating' which no-one would need to google.

comment:2 Changed 8 years ago by markk

The more I look at this, the more I like it:)

My main concern is the fallback behaviour when the painter does not support animation (MythQtPainter? and MythQImagePainter). If a themer relies on a certain effect being in place and it is not available, it may effectively break the theme. (Largely thinking ahead - as it's unlikely to be a big issue until extended to individual ui types)

comment:3 Changed 8 years ago by markk

See f39fa3b626d98c06295 for initial commit.

Amongst other things, I still intend to rework the timing so that it is consistent between the OSD and main UI without reference to MythMainWindow?.

comment:4 Changed 8 years ago by stuartm

Milestone: 0.250.26
Owner: changed from stuartm to Jonatan Lindblad
Status: newassigned

comment:5 Changed 7 years ago by Kenni Lund [kenni a kelu dot dk]

Milestone: 0.260.27

comment:6 Changed 6 years ago by paulh

Milestone: 0.270.28

comment:7 Changed 4 years ago by paulh

Resolution: Fixed
Status: assignedclosed

This is already done.

Note: See TracTickets for help on using tickets.