Commit 89398b63 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

UI: call view border

Hide split view divider and remove blur border on call view.

Change-Id: I3422b98cd7d02508d2e314d07884ebf17a28fc4d
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent 91c17998
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
// Main container // Main container
@property (unsafe_unretained) IBOutlet NSSplitView* splitView; @property (unsafe_unretained) IBOutlet NSSplitView* splitView;
@property (unsafe_unretained) IBOutlet NSImageView* backgroundImage; @property (unsafe_unretained) IBOutlet NSView* backgroundImage;
@property (unsafe_unretained) IBOutlet NSBox* bluerBackgroundEffect; @property (unsafe_unretained) IBOutlet NSBox* bluerBackgroundEffect;
// Header info // Header info
...@@ -201,6 +201,8 @@ ...@@ -201,6 +201,8 @@
bluerBackgroundEffect.alphaValue = 0.6; bluerBackgroundEffect.alphaValue = 0.6;
[audioCallView setWantsLayer:YES]; [audioCallView setWantsLayer:YES];
[audioCallView.layer setBackgroundColor: [[NSColor clearColor] CGColor]]; [audioCallView.layer setBackgroundColor: [[NSColor clearColor] CGColor]];
[backgroundImage setWantsLayer: YES];
backgroundImage.layer.contentsGravity = kCAGravityResizeAspectFill;
} }
-(void) updateDurationLabel -(void) updateDurationLabel
...@@ -332,7 +334,6 @@ ...@@ -332,7 +334,6 @@
[headerContainer setHidden:NO]; [headerContainer setHidden:NO];
[previewView setHidden: NO]; [previewView setHidden: NO];
[bluerBackgroundEffect setHidden:YES]; [bluerBackgroundEffect setHidden:YES];
[bluerBackgroundEffect.layer setBackgroundFilters: nil];
[backgroundImage setHidden:YES]; [backgroundImage setHidden:YES];
} }
...@@ -347,17 +348,24 @@ ...@@ -347,17 +348,24 @@
auto it = getConversationFromUid(convUid_, *convModel); auto it = getConversationFromUid(convUid_, *convModel);
NSImage *image= [self getContactImageOfSize:120.0 withDefaultAvatar:NO]; NSImage *image= [self getContactImageOfSize:120.0 withDefaultAvatar:NO];
if(image) { if(image) {
CIImage * ciImage = [[CIImage alloc] initWithData:[image TIFFRepresentation]];
CIContext *context = [[CIContext alloc] init];
CIFilter *clamp = [CIFilter filterWithName:@"CIAffineClamp"];
[clamp setValue:[NSAffineTransform transform] forKey:@"inputTransform"];
[clamp setValue:ciImage forKey: kCIInputImageKey];
CIFilter* bluerFilter = [CIFilter filterWithName:@"CIGaussianBlur"]; CIFilter* bluerFilter = [CIFilter filterWithName:@"CIGaussianBlur"];
[bluerFilter setDefaults]; [bluerFilter setDefaults];
[bluerFilter setValue:[NSNumber numberWithFloat: 30] forKey:@"inputRadius"]; [bluerFilter setValue:[NSNumber numberWithFloat: 9] forKey:@"inputRadius"];
[bluerBackgroundEffect.layer setBackgroundFilters:@[bluerFilter]]; [bluerFilter setValue:[clamp valueForKey:kCIOutputImageKey] forKey: kCIInputImageKey];
[backgroundImage setImage: image]; CIImage *result = [bluerFilter valueForKey:kCIOutputImageKey];
CGRect extent = [result extent];
CGImageRef cgImage = [context createCGImage:result fromRect: [ciImage extent]];
NSImage *bluredImage = [[NSImage alloc] initWithCGImage:cgImage size:NSSizeFromCGSize(CGSizeMake(image.size.width, image.size.height))];
backgroundImage.layer.contents = bluredImage;
[backgroundImage setHidden:NO]; [backgroundImage setHidden:NO];
} else { } else {
[bluerBackgroundEffect.layer setBackgroundFilters:nil];
[bluerBackgroundEffect setFillColor:[NSColor ringDarkGrey]]; [bluerBackgroundEffect setFillColor:[NSColor ringDarkGrey]];
[backgroundImage setHidden:YES]; [backgroundImage setHidden:YES];
[backgroundImage setImage:nil];
} }
} }
...@@ -653,8 +661,6 @@ ...@@ -653,8 +661,6 @@
//background view //background view
[bluerBackgroundEffect setHidden:NO]; [bluerBackgroundEffect setHidden:NO];
[backgroundImage setHidden:NO]; [backgroundImage setHidden:NO];
[backgroundImage setImage:nil];
[bluerBackgroundEffect setBackgroundFilters:nil];
//outgoing view //outgoing view
[outgoingPersonLabel setStringValue:@""]; [outgoingPersonLabel setStringValue:@""];
[outgoingStateLabel setStringValue:@""]; [outgoingStateLabel setStringValue:@""];
...@@ -1004,4 +1010,9 @@ ...@@ -1004,4 +1010,9 @@
[[headerContainer animator] setAlphaValue:move]; [[headerContainer animator] setAlphaValue:move];
} }
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex
{
return YES;
}
@end @end
This diff is collapsed.
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
<rect key="frame" x="0.0" y="0.0" width="1053" height="658"/> <rect key="frame" x="0.0" y="0.0" width="1053" height="658"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="Pav-Bw-GgK">
<rect key="frame" x="322" y="0.0" width="5" height="658"/>
</box>
<customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YgH-CN-tkB" userLabel="Left Panel"> <customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YgH-CN-tkB" userLabel="Left Panel">
<rect key="frame" x="0.0" y="0.0" width="324" height="658"/> <rect key="frame" x="0.0" y="0.0" width="324" height="658"/>
<subviews> <subviews>
...@@ -564,16 +561,16 @@ ...@@ -564,16 +561,16 @@
</constraints> </constraints>
</customView> </customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Fzg-MB-mlx" userLabel="HomeView"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="Fzg-MB-mlx" userLabel="HomeView">
<rect key="frame" x="325" y="0.0" width="728" height="658"/> <rect key="frame" x="324" y="0.0" width="729" height="658"/>
<subviews> <subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="6bh-ow-nJO"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="6bh-ow-nJO">
<rect key="frame" x="0.0" y="0.0" width="728" height="172"/> <rect key="frame" x="0.0" y="0.0" width="729" height="172"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="172" id="hCN-uz-Nmc"/> <constraint firstAttribute="height" constant="172" id="hCN-uz-Nmc"/>
</constraints> </constraints>
</customView> </customView>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dZR-JL-MY4"> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dZR-JL-MY4">
<rect key="frame" x="264" y="229" width="200" height="200"/> <rect key="frame" x="265" y="229" width="200" height="200"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="200" id="RCZ-Wt-iKD"/> <constraint firstAttribute="width" constant="200" id="RCZ-Wt-iKD"/>
<constraint firstAttribute="height" constant="200" id="tSn-OT-Zn8"/> <constraint firstAttribute="height" constant="200" id="tSn-OT-Zn8"/>
...@@ -586,7 +583,7 @@ ...@@ -586,7 +583,7 @@
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</imageView> </imageView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="D6e-KX-8gC"> <customView translatesAutoresizingMaskIntoConstraints="NO" id="D6e-KX-8gC">
<rect key="frame" x="104" y="194" width="520" height="270"/> <rect key="frame" x="105" y="194" width="520" height="270"/>
<subviews> <subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kFj-Sh-o5u"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kFj-Sh-o5u">
<rect key="frame" x="95" y="98" width="330" height="19"/> <rect key="frame" x="95" y="98" width="330" height="19"/>
...@@ -628,7 +625,7 @@ ...@@ -628,7 +625,7 @@
</connections> </connections>
</customView> </customView>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="f62-JV-dgr"> <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="f62-JV-dgr">
<rect key="frame" x="148" y="175" width="225" height="75"/> <rect key="frame" x="147" y="175" width="225" height="75"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="75" id="mWM-v0-n2w"/> <constraint firstAttribute="height" constant="75" id="mWM-v0-n2w"/>
<constraint firstAttribute="width" constant="225" id="paw-4z-Zbv"/> <constraint firstAttribute="width" constant="225" id="paw-4z-Zbv"/>
...@@ -670,7 +667,7 @@ ...@@ -670,7 +667,7 @@
</connections> </connections>
</button> </button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VJ1-xk-v5e"> <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VJ1-xk-v5e">
<rect key="frame" x="24" y="125" width="473" height="42"/> <rect key="frame" x="23" y="125" width="473" height="42"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Ring is free software for universal communication which respects the freedoms and privacy of its users." id="eln-Vm-t0d"> <textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Ring is free software for universal communication which respects the freedoms and privacy of its users." id="eln-Vm-t0d">
<font key="font" size="15" name="HelveticaNeue"/> <font key="font" size="15" name="HelveticaNeue"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
...@@ -697,7 +694,7 @@ ...@@ -697,7 +694,7 @@
</constraints> </constraints>
</customView> </customView>
<customView focusRingType="none" translatesAutoresizingMaskIntoConstraints="NO" id="tSW-YT-asL"> <customView focusRingType="none" translatesAutoresizingMaskIntoConstraints="NO" id="tSW-YT-asL">
<rect key="frame" x="0.0" y="0.0" width="728" height="658"/> <rect key="frame" x="0.0" y="0.0" width="729" height="658"/>
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="340" id="5yo-rb-X1O"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="340" id="5yo-rb-X1O"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="725" id="ccX-uq-zuj"/> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="725" id="ccX-uq-zuj"/>
...@@ -723,12 +720,9 @@ ...@@ -723,12 +720,9 @@
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="YgH-CN-tkB" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="H99-2E-fs4"/> <constraint firstItem="YgH-CN-tkB" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="H99-2E-fs4"/>
<constraint firstAttribute="bottom" secondItem="Pav-Bw-GgK" secondAttribute="bottom" id="QrG-jO-ix7"/>
<constraint firstItem="Pav-Bw-GgK" firstAttribute="leading" secondItem="YgH-CN-tkB" secondAttribute="trailing" id="RdH-bx-3aI"/>
<constraint firstAttribute="trailing" secondItem="Fzg-MB-mlx" secondAttribute="trailing" id="T3I-2c-Eto"/> <constraint firstAttribute="trailing" secondItem="Fzg-MB-mlx" secondAttribute="trailing" id="T3I-2c-Eto"/>
<constraint firstItem="Fzg-MB-mlx" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="VUS-o0-RNY"/> <constraint firstItem="Fzg-MB-mlx" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="VUS-o0-RNY"/>
<constraint firstItem="Fzg-MB-mlx" firstAttribute="leading" secondItem="YgH-CN-tkB" secondAttribute="trailing" constant="1" id="Xgw-Na-kgh"/> <constraint firstItem="Fzg-MB-mlx" firstAttribute="leading" secondItem="YgH-CN-tkB" secondAttribute="trailing" id="Xgw-Na-kgh"/>
<constraint firstItem="Pav-Bw-GgK" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="hcV-ir-ZEc"/>
<constraint firstAttribute="bottom" secondItem="YgH-CN-tkB" secondAttribute="bottom" id="hkC-sf-sNA"/> <constraint firstAttribute="bottom" secondItem="YgH-CN-tkB" secondAttribute="bottom" id="hkC-sf-sNA"/>
<constraint firstAttribute="bottom" secondItem="Fzg-MB-mlx" secondAttribute="bottom" id="tQc-0j-ggO"/> <constraint firstAttribute="bottom" secondItem="Fzg-MB-mlx" secondAttribute="bottom" id="tQc-0j-ggO"/>
<constraint firstItem="YgH-CN-tkB" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="w2k-lK-25U"/> <constraint firstItem="YgH-CN-tkB" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="w2k-lK-25U"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment