Remove the need to manually add a new layer
In Pitivi we allow adding layers by drag-drop a clip on a separator (and hover for 1 second) and by clicking Add-Layer. Other video editors have a bunch of layers to start with right at the beginning and supposedly it's possible to create new layers by right-clicking or using the menu.
Since we already have some space at the bottom of the layers occupied by the Add-Layer button which is allocated half-full-layer height, that's exactly the height of an empty layer. We could automatically add an empty layer when the last layer is non-empty anymore, allowing the user to simply add clips to it. In this case:
- The Add-Layer button would not be needed anymore, but the logic should be kept and a keyboard shortcut should be added for it
- When loading a project and the last layer is non-empty, a new layer should be added
- The layer button (the layer icon on the left side) items:
- move-layer-to-bottom should move the layer before the last (empty) layer
- move-layer-down for the last but one layer should be enabled
- delete-layer should be disabled for the last (empty) layer
- When the last but one layer becomes empty, we should remove the last layer only if it does not have a changed name
For some starting points, see Timeline.__update_layers
, LayerControls.__createMenuModel
, Layer.__nameIfMeaningful
.
There is a chance this won't be merged, depending on how it works in practice. But if we like it, we should see what unittests would make sense, and cover various cases like loading a project, etc.