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.
Details
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
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 . |
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? |
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. |
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.
src/activities/explore_farm_animals/ExploreLevels.qml | ||
---|---|---|
159 | all the code is the behaviour of the panel, it should be inside its file |