GSoC 2017: VLC for macOS interface redesign
This summer I’ve participated in the Google Summer of Code program, contributing to the VLC media player project by VideoLAN.
My project was the macOS interface redesign, below can be found a summary of the things that I did for my GSoC project:
Native HUD UI
In the past VLC used BGHUDAppKit for the controls on dark panels (HUD style), this library is not maintained since a very long time, so continuing to use it on recent macOS versions was not desired, given that since macOS 10.10+ the standard controls adapt accordingly, when used on HUD panels. Therefore BGHUDAppKit was removed and the relevant controll subclassed we needed were copied from BGHUDAppKit and adapted, to only use them on macOS versions lower than 10.10, where the native controls do not adapt.
Relevant commits:
- macOS: Add VLCHUDScroller
- macOS: Use VLCHUDScroller in MediaInfo panel
- macOS: Add VLCHUDOutlineView
- macOS: Use VLCHUDOutlineView in MediaInfo panel
- macOS: Add VLCHUDSegmentedCell
- macOS: Fix VLCHUDSegmentedCell text drawing
- macOS: Use VLCHUDSegmentedCell in MediaInfo panel
- macOS: Draw dividers for VLCHUDSegmentedCell
- macOS: Don’t draw custom VLCHUDSegmentedCell on 10.10+
- macOS: Fix drawing of VLCHUDSliderCell track
- macOS: Fix drawing of VLCHUDTextFieldCell
- macOS: Do not draw custom VLCHUDTextFieldCell on 10.10+
- macOS: Use VLCHUDButtonCell on MediaInfo panel
- macOS: Change license of some VLCHUD classes
- macOS: Correct colors of VLCHUDCheckboxCell
- macOS: Draw focus ring for VLCHUDCheckboxCell
- macOS: Simplify copying of VLCHUDRadiobuttonCell title
- macOS: Adjust stroke color of VLCHUDTextFieldCell
- macOS: Draw focus ring for VLCHUDSegmentedCell
- macOS: Draw focus ring for VLCHUDRadiobuttonCell
- macOS: Use more of the custom HUD classes
- macOS: Minor code style adjustments for VLCHUD classes
- macOS: Add VLCPopUpButtonCell
- macOS: Use VLCPopUpButtonCell in VideoEffects panel
- macOS: Add swapoutOverride function to CompatibilityFixes
- macOS: Don’t draw custom VLCHUDCheckboxCell on 10.10+
- macOS: Add VLCHUDStepperCell
- macOS: Use VLCHUDStepperCell in SyncTracks panel
- macOS: Use HUD classes in panels
- macOS: Rename VLCPopUpButtonCell to VLCHUDPopUpButtonCell
- macOS: Change box style in MediaInfo panel
- macOS: No custom HUD drawing on macOS 10.10+
- macOS: Remove unused VLCHUDRadiobuttonCell
- macOS: Add VLCHUDTableView
- macOS: Remove broken VLCHUDTableHeaderCell
- macOS: Use VLCHUDTableView and Scroller in Bookmarks panel
- macOS: Fix typos in BGHUDAppKit license headers
- macOS: Use dark appearance for panel modals
- macOS: Fix partial availability error in VLCHUDSliderCell
Custom tinted image buttons
On some views, like the fullscreen controller HUD, tinted buttons are necessary on < 10.10.
- macOS: Add VLCTintedImageButtonCell
- macOS: Fix hardly visible buttons on <10.10
- macosx: Fix image tinting
Renderer menu
A new feature in 3.0 will be renderers, for easy selection of renderers in the macOS interface, I’ve implemented a menu that shows all available renderers. It works similar to the macOS WiFi menu.
- macOS: Implement isEqual for VLCRendererItem
- macOS: Add missing array initialization
- macOS: Fix logical flaws in VLCRendererDiscovery
- macosx: Implement renderer discovery as NSMenu
- rd/bonjour: Use Chromecast name and model from TXT record
- macosx: Add helper to set rd item demux filter
- macosx: Add helper to unset rd demux filter
- macosx: Set/unset demux filter for renderers
Time Slider
VLC has a completely custom slider at the bottom of the main window. In the past this was done by overlaying multiple image views over the actual slider. I removed this and instead made a subclass of NSSliderCell, which uses custom drawing to look how it is needed.
- macosx: Add VLCSlider(Cell)
- macosx: Update VLCControlsBarCommon to use new VLCSlider
- macosx: Update main window to use new slider
- macosx: Update detached window to use new slider
- macosx: Remove no longer required TimeLineSlider subclass
- macosx: Remove no longer required outlets to views
- macosx: Improve VLCSlider knob positioning
- macosx: Remove unnecessary graphics
- macosx: Remove VLCSliderCell filled track inset
- macosx: Make filled part of VLCSliderCell darker
- macosx: Add dark style to VLCSliderCell
- macosx: Set dark style of time slider for dark interface
- macosx: Add ability to hide knob to VLCSlider
- macosx: Hide VLCSlider knob when nothing is playing
- macosx: Remove MPSlider
- macosx: Remove VLCProgressView
- macosx: Remove unnecessary progressbar images
Volume Slider
The Volume slider of VLC can go further than 100%, the user needs a indication when 100% were reached. For this purpose the slider has a tickmark at 100%, but in the past the snapping to the tickmark was not working properly, snapping at the position of the cursor instead of the center of the knob, which could lead to it snapping to values that are not 100%, but 102% or 98%.
NSSlider does not allow an arbitrary positioned tickmark, therefore I had to write a subclass of NSSliderCell which allows that.
Additionally the volume slider uses a custom look, therefore I wrote another subclass, which is a subclass of the VLCDefaultSliderCell
- macosx: Replace volume slider with VLCDefaultValueSlider
- macosx: Remove now unused ITSlider and VLCVolumeSliderCommon
- macosx: Add VLCVolumeSlider(Cell) classes
- macosx: Use VLCVolumeSlider
- macosx: Remove unnecessary volume slider images
- macosx: Improve DefaultValueSlider snapping logic
- macosx: Correct drawing of Volume slider in RTL mode
- macosx: Fix DefaultValueSlider tickmark position in RTL layout
Window bottom bar
The bottom part of the VLC window has a border, which resembles the macOS window border. In the past this was done using images, I’ve replaced this with a simple NSGradient drawing view.
- macosx: Add VLCBottomBarView
- macosx: Use VLCBottomBarView
- macosx: Remove now unnecessary bottom bar assets
Code cleanup
In addition to the new things I’ve added, I did a lot of minor code cleanup and fixes:
- macOS: Move VLCOpenTextField out of misc
- macOS: Remove unnecessary styling from VLCTimeField
- macOS: Move VLCTimeField out of misc
- macOS: Unify VLCHUDToggleButton/VLCHUDImageButton to VLCImageButton
- macOS: Minor VLCHelpWindowController codestyle changes
- macOS: Use system font for help window HTML
- macOS: Clarify useless-looking code in VLCDocumentController
- Revert “macOS: Set correct fullscreen window level”
- macOS: Fix copy/paste mistake in license header
- macOS: Change label font on MediaInfo panel
- macOS: Change MediaInfo panel xib target to 10.7
- macOS: Do not use weak delegate
- freetype: Fix copying char buffer of CStringRef on darwin
- freetype: Prevent creating font with NULL path
- freetype: Simplify path check
- macOS: Remove unused variable
- macOS: Correct target to 10.7 for AudioEffects xib
- macOS: Disallow tabbing for main window
- macOS: Set deployment target to 10.7 for MainWindow xib
- macOS: Reorder files in Xcode project
- macOS: Do not form weak reference to NSWindowController
- macOS: Correct invalid Objective C code
- notify/osx_notifications: Fix build
- contrib: Update Breakpad git hash
- macosx: Reorder XIBs in Xcode project
- macosx: Remove unnecessary comments in VLCMainWindowSplitView
- macosx: Use doxygen comments in VLCScrollingClipView
- macosx: Correct description of VLCStatusBarIcon class
- macosx: More class description clarifications
- macosx: Reorder files in Xcode project
- macosx: Remove CIFilters from MainWindow.xib
- macosx: Specify preferred layout width for MainWindow
- NSIS: Enable HiDPI support
- macosx: Add missing super awakeFromNib call
- extras/macosx: Disable sdl-image in configure.sh
- macosx: Fix incorrectly saved XIB
- vout/macosx: Do not use passed video_format_t for CROP/ASPECT_RATIO changes
- vout/caopengllayer: Do not use passed video_format_t for CROP/ASPECT_RATIO changes
- access/cdda: Do not discard const qualifier
- macosx: Remove unused variable
- macosx: Rename variables
- macosx: Rename and invert isNotEmbedded
- macosx: Replace NSInvocations with block dispatch
- macosx: Correct camel case method name
- macosx: Replace NSInvocation with dispatch_sync block
- macosx: Rename VLCDebugMessageWindowController to VLCLogWindowController
- macosx: Clarify VLCLogWindowController description
- macosx: Remove unused variable
- macosx: Fix missing colon when copying log message
- macosx: Improve truncation of log messages