timeline: Use a single separator widget between layers

Desktop / GNOME / PiTiVi - Alexandru Băluț [gmail.com] - 9 November 2016 07:10 UTC

There was no good reason to keep the two-separator-widgets implementation.

This change simplifies the drag&drop on the separator logic. As a result the _get_separators and __getDroppedLayer methods have been removed.

The widgets hierarchy is now thinner.

One disadvantage is that the position of a layer in the layers box is not directly related to the layer's priority property. The added complexity is covered by new unit tests for layer creation, removal and movement, and they check everything.

As part of the optimization, the __update_layers call from _removeLayer has been removed so __update_layers being used in a single place it has been merged into __layerPriorityChangedCb which if you read the first part of the method fits quite nice.

a99b40a timeline: Use a single separator widget between layers
pitivi/timeline/layer.py | 52 +++----------
pitivi/timeline/timeline.py | 158 +++++++++++++++++++++++----------------
pitivi/utils/timeline.py | 9 ++-
pitivi/utils/ui.py | 2 +
tests/test_timeline_timeline.py | 112 +++++++++++++++++++++++++--
5 files changed, 219 insertions(+), 114 deletions(-)

Upstream: git.gnome.org


  • Share