macosx: Add a separator to the bottom control bar

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2024-03-16 17:34:42 +08:00 committed by Felix Paul Kühne
parent fc8cec82de
commit 25461a329b
2 changed files with 55 additions and 2 deletions

View File

@ -359,7 +359,7 @@
<rect key="frame" x="0.0" y="0.0" width="896" height="48"/>
<subviews>
<visualEffectView blendingMode="behindWindow" material="titlebar" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="D5i-Pe-TAl">
<rect key="frame" x="0.0" y="0.0" width="896" height="48"/>
<rect key="frame" x="0.0" y="0.0" width="896" height="47"/>
</visualEffectView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="MQH-bI-Zdh" customClass="VLCDragDropView">
<rect key="frame" x="0.0" y="0.0" width="896" height="48"/>
@ -656,7 +656,7 @@
<constraint firstAttribute="bottom" secondItem="MQH-bI-Zdh" secondAttribute="bottom" id="Uo1-sD-OXk"/>
<constraint firstItem="D5i-Pe-TAl" firstAttribute="leading" secondItem="vUy-jt-gjY" secondAttribute="leading" id="WKP-Ke-OrH"/>
<constraint firstItem="MQH-bI-Zdh" firstAttribute="leading" secondItem="vUy-jt-gjY" secondAttribute="leading" id="YVB-nY-sHE"/>
<constraint firstItem="D5i-Pe-TAl" firstAttribute="top" secondItem="vUy-jt-gjY" secondAttribute="top" id="ZD9-R0-yq0"/>
<constraint firstItem="D5i-Pe-TAl" firstAttribute="top" secondItem="vUy-jt-gjY" secondAttribute="top" constant="1" id="ZD9-R0-yq0"/>
<constraint firstAttribute="trailing" secondItem="MQH-bI-Zdh" secondAttribute="trailing" id="aBH-H2-ykp"/>
<constraint firstItem="MQH-bI-Zdh" firstAttribute="top" secondItem="vUy-jt-gjY" secondAttribute="top" id="kba-GQ-94a"/>
<constraint firstAttribute="trailing" secondItem="D5i-Pe-TAl" secondAttribute="trailing" id="lo1-R4-xx4"/>

View File

@ -29,4 +29,57 @@
@implementation VLCBottomBarView
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
[self commonInit];
}
return self;
}
- (instancetype)initWithFrame:(NSRect)frameRect
{
self = [super initWithFrame:frameRect];
if (self) {
[self commonInit];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self ) {
[self commonInit];
}
return self;
}
- (void)commonInit
{
self.wantsLayer = YES;
self.needsDisplay = YES;
}
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
const NSRect barFrame = self.frame;
NSBezierPath * const separatorPath = NSBezierPath.bezierPath;
[separatorPath moveToPoint:NSMakePoint(NSMinX(barFrame), NSMaxY(barFrame) - 0.5)];
[separatorPath lineToPoint:NSMakePoint(NSMaxX(barFrame), NSMaxY(barFrame) - 0.5)];
separatorPath.lineWidth = 1.0;
[NSColor.VLCSubtleBorderColor setStroke];
[separatorPath stroke];
}
@end