macosx: Introduce dynamic sizing for library collection view items, refactor library collection view delegation
This PR introduces dynamic collection view item sizing. The library collection views now optimise available space by resizing collection view items from a minimum of 180px to 300px, and adjusting the number of items on a row when either of these thresholds is met. This allows for a nicer UX that makes things look consistent at different sizes and makes the most of available space, while retaining the benefits of dynamically-changing column counts in the collection view. This is akin to what some native applications like Apple Music do in their collection views.
Video of this PR:
Screen_Recording_2022-12-17_at_14.25.29
Behaviour in master:
Screen_Recording_2022-12-18_at_02.15.58
To reduce duplication in the implementation of this (and as a side-effect reduce existing code duplication in library data sources), library collection view delegation has also been refactored. Instead of this being handled by the audio and video data sources, this is now handled by a single delegate class (VLCLibraryCollectionViewDelegate
). A nice bonus of this is that existing functionality in the video view is now also available in the audio view.
Signed-off-by: Claudio Cambra developer@claudiocambra.com