programmingMaze, code clean-up revision #2
ClosedPublic

Authored by amankumargupta on Apr 20 2018, 1:36 PM.

Details

Summary

This diff focuses entirely on:

  1. Renamed files to more meaningful name.
  1. Moved large codes to their individual new file to make main file small, clean and readible.
  1. Generealised code and made common files for repeated elements.

Comments in the diff will make it easy to follow up with all the changes.

Diff Detail

Repository
R2 GCompris
Lint
Lint Skipped
Unit
Unit Tests Skipped
amankumargupta created this revision.Apr 20 2018, 1:36 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptApr 20 2018, 1:36 PM
Restricted Application added a subscriber: KDE Edu. · View Herald Transcript
amankumargupta added inline comments.Apr 20 2018, 1:46 PM
src/activities/programmingMaze/HeaderArea.qml
2

This is a new file for header area which was previously repeated 3 times in the file ProgrammingMaze.qml for all the three areas: instruction area, main area and procedure area (line 483 - 604 in the diff).

This is now generalized thus making the code much cleaner and less-redundant.

Much of the content in this file is same as previous, except two new properties are defined to specify the header text and vary opacity according to different area's needs.

src/activities/programmingMaze/InstructionArea.qml
2

This is the file for instruction area.

The entire code is moved here from line 256 - 399 in the diff, making the main file shorter and more readible.

jjazeix added inline comments.
src/activities/programmingMaze/HeaderArea.qml
42

is it a margin? Better use margins than x/y positions.

src/activities/programmingMaze/InstructionArea.qml
70

anchors?

106

2 spaces

amankumargupta marked 3 inline comments as done.Apr 20 2018, 8:21 PM
amankumargupta added inline comments.
src/activities/programmingMaze/HeaderArea.qml
42

yes, it's a margin. But anyways, anchors.centerIn does the job :)

src/activities/programmingMaze/InstructionArea.qml
70

On testing now, I felt there's no need for the additional 1.5 * ApplicationInfo.ratio. Removed it in the updated diff.

amankumargupta marked 2 inline comments as done.
jjazeix accepted this revision.Apr 21 2018, 6:32 AM
This revision is now accepted and ready to land.Apr 21 2018, 6:32 AM