Grid layout have been re-worked using GridView without disturbing/changing the UI, as with the GridView's keyboard properties, it's more easy to implement the controls.
Details
- Reviewers
jjazeix timotheegiet - Group Reviewers
GCompris: Improvements - Maniphest Tasks
- T8395: Mosaic activity, implement keyboard control support.
- Checked on several window sizes and the cell sizes are almost exactly same as the original ones.
- Tested on mobile and the ratio of images are same as the original ones.
Diff Detail
- Repository
- R2 GCompris
- Lint
Lint Skipped - Unit
Unit Tests Skipped
src/activities/mosaic/Mosaic.qml | ||
---|---|---|
44 | why don't you directly store the area? |
src/activities/mosaic/Mosaic.qml | ||
---|---|---|
44 | Updated in the fresh diff. |
I did some calculations and after trying several combinations around the theoretical values, the layout with these values and calculations seemed optimal and best to me and is closest to the original ratio and looks exactly similar to the original images sizes.
On full screens:
- Level 1: a.) With Grid: https://pasteboard.co/Hg7LFEs.png b.) After reworkwith GridView: https://pasteboard.co/Hg7M7kH.png
- Level 5: a.) With Grid: https://pasteboard.co/Hg7MBj6.png b.) After reworkwith GridView: https://pasteboard.co/Hg7N9i2.png
- Level 16: a.) With Grid: https://pasteboard.co/Hg7NJav.png b.) After reworkwith GridView: https://pasteboard.co/Hg7O9qL.png
On half screens:
- Level1: (GridView rework on left and original Grid on right) --> https://pasteboard.co/Hg7Pp6i.png
- Level5: (GridView rework on left and original Grid on right) --> https://pasteboard.co/Hg7Uk8T.png
- Level16: (GridView rework on left and original Grid on right) --> https://pasteboard.co/Hg7Q00V.png
On smaller screen sizes:
- Level1: (GridView rework on left and original Grid on right) --> https://pasteboard.co/Hg7UJNs.png
- Level16: (GridView rework on left and original Grid on right) --> https://pasteboard.co/Hg7RrfE.png
As I told you on irc, for all images, please:
-use fillMode: Image.PreserveAspectFit
-set sourceSize.height and sourceSize.width to image height and width
Yes I noticed the message on IRC after attaching the screenshots. Thanks for the instruction. Will update it.
- sourceSize.width and sourceSize.height are set to width and height.
- Used Image.PreserveAspectFit to fit the images.
Pushed to master.
Commit link: https://cgit.kde.org/gcompris.git/commit/?id=e2cf508a39168c30c0ca0289c1d002e5251d23f5