Descripton Panel sliding back on closing, in Explore farm animals
ClosedPublic

Authored by amankumargupta on Aug 29 2017, 1:35 PM.

Details

Reviewers
jjazeix
Group Reviewers
GCompris
Summary

In the activity Explore farm animals, when an animal is clicked, a Description Panel appears sliding from left to right containing info and a picture of that animal. And on clicking, it disappears.
The appearance and disappearance of the Panel was governed by its "visibility" property. On clicking the description panel, its visibility was set to false, hence closing animation was not possible to see.
What I've done is, removed appearance and disappearance dependency upon the "visible" property and replaced it with the command to start the respective animations upon appearance and closing the board. Now, the panel slides back in the same manner as it had appeared.

Test Plan

Click on any farm animal to view Description Board. Click it again to hide it with sliding animation.
Tested on my Ubuntu 16.04 LTS. Working fine :)

Diff Detail

Repository
R2 GCompris
Lint
Lint Skipped
Unit
Unit Tests Skipped
amankumargupta created this revision.Aug 29 2017, 1:35 PM
echarruau requested changes to this revision.Aug 29 2017, 1:56 PM
echarruau added inline comments.
src/activities/explore_farm_animals/AnimalDescriptionLevels.qml
101

Description panel does not need capitals here

101

Desc = description ?

110

The variable name is not well choses. It does not say what it does.

This revision now requires changes to proceed.Aug 29 2017, 1:56 PM
amankumargupta edited edge metadata.
amankumargupta marked 3 inline comments as done.

Changed NumberAnimation variable names.

amankumargupta added inline comments.Aug 29 2017, 2:41 PM
src/activities/explore_farm_animals/AnimalDescriptionLevels.qml
101

Yupp. rectangleDesc is the id of the rectangle Description Panel. It was named as rectangleDesc in the original source code .

Changed variable names appropriately. Waiting for review.

jjazeix added inline comments.Aug 30 2017, 6:04 PM
src/activities/explore_farm_animals/AnimalDescriptionLevels.qml
101

comments should be above

109

why having the close animation on this file and the open animation in the other?

113

coding convention (-2 * width : -2 * height)

src/activities/explore_farm_animals/ExploreLevels.qml
143

why removing the onVisibleChanged?

amankumargupta added inline comments.Aug 31 2017, 7:17 AM
src/activities/explore_farm_animals/AnimalDescriptionLevels.qml
109

as in the original source code, the description panel was made visible in ExploreLevels.qml file and was made invisible in the AnimalDescriptionLevels.qml, so i thought to edit in the same manner so as not to disturb the code structure. But if both appearance and disappearance would be better in a single file, i'll do it. :)

src/activities/explore_farm_animals/ExploreLevels.qml
143

as visibility is always true for the description panel (its appearance and disappearance now relies upon the position it is slided to, i.e. it slides to -2*width or -2*height to hide, instead of beinng invisible), i removed onVisibleChanged, cause it wont be doing anything then. Moreover, if the appearance and disappearance was still governed by visibility of the description panel, we could not see the sliding animation on closing the panel as it is made invisible as soon as the panel is closed. That's why i thought to change the way it appears and closes.

amankumargupta marked an inline comment as done.
amankumargupta set the repository for this revision to R2 GCompris.

Moved MouseArea, cancelButton and function close() from AnimalDescriptionLevels.qml to under id: descriptionPanel in ExploreLevels.qml to make it more readable as all the closing and appearance code and animation for the description panel is there.

amankumargupta marked an inline comment as done.Aug 31 2017, 12:10 PM
jjazeix requested changes to this revision.Sep 10 2017, 1:05 PM
jjazeix added inline comments.
src/activities/explore_farm_animals/ExploreLevels.qml
159

all the code is the behaviour of the panel, it should be inside its file

This revision now requires changes to proceed.Sep 10 2017, 1:05 PM
jjazeix accepted this revision.Oct 22 2017, 2:50 PM
jjazeix removed reviewers: echarruau, timotheegiet.
This revision is now accepted and ready to land.Oct 22 2017, 2:51 PM
jjazeix closed this revision.Oct 22 2017, 2:51 PM

applied in another diff