Update the MultipleStaff view to automatically add more staffs when more notes are added.
ClosedPublic

Authored by amankumargupta on May 16 2018, 7:47 PM.

Details

Summary

The following things are improved/updated in this revision:

  1. MultipleStaff placed inside a Flickable and it automatically adds one more staff if the last staff is full and flicks to the bottom of the view when done.
  2. GCButtonScroll added to let the user know that it's flickable (and also flick up/down through it).
  3. Previous overridings have been fixed.
  4. Piano placed below staves on vertical mode.
  5. Improved the save feature function (getAllNotes()). However this is temporary to get the things work as per current notation. Will be easily updated when I update the activity with it.

Vertical screen layout: https://pasteboard.co/Hlysp9P.png

Horizontal screen layout: https://pasteboard.co/Hlyt0Jg.png

Test Plan
  1. Tested on various screen sizes on laptop. Result --> Everything looks fine, no overridings encountered, elements are well sized and placed.
  2. Tested on 4.5 and 5 inch mobile devices. Result --> Everything looks fine, no overridings encountered, elements are well sized and placed.

Diff Detail

Repository
R2 GCompris
Lint
Lint Skipped
Unit
Unit Tests Skipped
amankumargupta created this revision.May 16 2018, 7:47 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMay 16 2018, 7:47 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
amankumargupta edited the summary of this revision. (Show Details)May 16 2018, 8:59 PM
amankumargupta edited the summary of this revision. (Show Details)May 17 2018, 6:21 AM
jjazeix accepted this revision.May 18 2018, 7:30 PM
jjazeix added a subscriber: jjazeix.
jjazeix added inline comments.
src/activities/piano_composition/MultipleStaff.qml
81

is there a way to not have to save/load every time we add a staff?

83

there was a else before, it is normal that it is removed?

This revision is now accepted and ready to land.May 18 2018, 7:30 PM
amankumargupta added inline comments.May 18 2018, 7:52 PM
src/activities/piano_composition/MultipleStaff.qml
81

I think it's not. Cause when we increase the number of staves (model), the entire model gets refreshed and the notes are erased. So we need to store the notes temporarily and when then put it back into the model.

Regarding saving, we don't actually save it. We just temporarily store it in var melody and then feed this data to loadFromData() to insert them back into the staves.

83

yes it is normal. Previously since we had fixed number of staff so if the staff were full, we would return else we increment the currentStaff. But now since we don't have limitations on staff numbers, we always increment it when the last staff is full (as we add a new staff at the end).