Commit 5298b5c7 authored by Vibhoothi's avatar Vibhoothi

libraryView: Add a popOver inside collectionView

This commit introduces a minimal popOver with a button into the collectionView aka
LibraryView which shows all metaData informationd of the video when user clicks the button
found in collectionViewItem
parent 5980e67d
......@@ -3,37 +3,119 @@
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<capability name="system font weights other than Regular or Bold" minToolsVersion="7.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainWindowCollectionViewItem">
<connections>
<outlet property="VLCItemImageView" destination="LRe-wn-Y2z" id="HPo-O1-7R6"/>
<outlet property="VLCPopOver" destination="IPI-0k-cD6" id="bHD-Ef-Aap"/>
<outlet property="VLCPopOverTriggerButton" destination="rgr-zW-apm" id="pcH-Tf-4VZ"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY" userLabel="Library View">
<rect key="frame" x="0.0" y="0.0" width="171" height="193"/>
<customView autoresizesSubviews="NO" id="Hz6-mo-xeY" userLabel="Library View">
<rect key="frame" x="0.0" y="0.0" width="172" height="187"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LRe-wn-Y2z">
<rect key="frame" x="47" y="97" width="77" height="76"/>
<rect key="frame" x="17" y="38" width="138" height="138"/>
<constraints>
<constraint firstAttribute="width" constant="77" id="6QU-dx-4YT"/>
<constraint firstAttribute="height" constant="76" id="VTi-R7-Kzg"/>
<constraint firstAttribute="height" constant="138" id="biX-SG-mPc"/>
<constraint firstAttribute="width" constant="138" id="wRe-s9-JbM"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="VLC" id="szu-Su-VAK"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="VLC" id="szu-Su-VAK"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KFD-Gv-9GE">
<rect key="frame" x="14" y="14" width="124" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="VLCConeConey.mp4" id="ZkO-z1-lsg">
<font key="font" metaFont="systemMedium" size="12"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rgr-zW-apm">
<rect key="frame" x="136" y="14" width="32" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="32" id="vzW-9Y-bv7"/>
</constraints>
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAdvanced" imagePosition="overlaps" alignment="left" imageScaling="proportionallyDown" inset="2" id="5di-ev-3yB">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
</buttonCell>
<connections>
<action selector="popOver:" target="-2" id="W9r-D0-Mzj"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="47" id="YGY-ey-fbH"/>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" constant="-38.5" id="hyO-mR-8Jc"/>
<constraint firstAttribute="bottom" secondItem="KFD-Gv-9GE" secondAttribute="bottom" constant="14" id="7nl-uv-7dN"/>
<constraint firstItem="KFD-Gv-9GE" firstAttribute="leading" secondItem="LRe-wn-Y2z" secondAttribute="leading" constant="-1" id="KeI-uV-Jie"/>
<constraint firstAttribute="trailing" secondItem="rgr-zW-apm" secondAttribute="trailing" constant="4" id="PUY-GM-CQN"/>
<constraint firstAttribute="trailing" secondItem="LRe-wn-Y2z" secondAttribute="trailing" constant="17" id="Rbd-YP-FMD"/>
<constraint firstItem="rgr-zW-apm" firstAttribute="baseline" secondItem="KFD-Gv-9GE" secondAttribute="baseline" id="eY3-la-UAb"/>
<constraint firstItem="rgr-zW-apm" firstAttribute="leading" secondItem="LRe-wn-Y2z" secondAttribute="trailing" constant="-19" id="gDO-FM-zpm"/>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="17" id="gP7-Rx-P3c"/>
<constraint firstItem="LRe-wn-Y2z" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="11" id="iAk-Ry-3zJ"/>
<constraint firstAttribute="bottom" secondItem="rgr-zW-apm" secondAttribute="bottom" constant="14" id="lxd-iS-dhg"/>
<constraint firstItem="KFD-Gv-9GE" firstAttribute="top" secondItem="LRe-wn-Y2z" secondAttribute="bottom" constant="8" id="sfA-nF-Glp"/>
</constraints>
<point key="canvasLocation" x="-94.5" y="129.5"/>
<point key="canvasLocation" x="-127" y="789.5"/>
</customView>
<viewController id="N7j-wi-2gE" userLabel="Popover View Controller">
<connections>
<outlet property="view" destination="LAc-1i-9Rt" id="d53-Hg-5cE"/>
</connections>
</viewController>
<popover id="IPI-0k-cD6">
<connections>
<outlet property="contentViewController" destination="N7j-wi-2gE" id="UT4-5s-X6A"/>
</connections>
</popover>
<customView id="LAc-1i-9Rt">
<rect key="frame" x="0.0" y="0.0" width="239" height="82"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bNc-32-jG8">
<rect key="frame" x="66" y="45" width="175" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="ConeyCone.mp4" id="Cdi-hZ-jxs">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0sa-wu-dPr">
<rect key="frame" x="15" y="17" width="48" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" image="VLC" id="1Ko-ZD-RIh"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ebf-j5-UtS">
<rect key="frame" x="66" y="27" width="36" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Cone" id="WF4-b6-t4f">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lSa-IC-VbL">
<rect key="frame" x="66" y="9" width="73" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="40404.404" id="sj9-oz-6hS">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="-94" y="1016"/>
</customView>
</objects>
<resources>
<image name="NSAdvanced" width="32" height="32"/>
<image name="VLC" width="512" height="512"/>
</resources>
</document>
......@@ -25,6 +25,8 @@
@interface VLCMainWindowCollectionViewItem : NSCollectionViewItem < NSCollectionViewDelegate>
@property (nonatomic,strong) IBOutlet NSImageView *VLCItemImageView;
@property (strong) IBOutlet NSPopover *VLCPopOver;
@property (unsafe_unretained) IBOutlet NSButton *VLCPopOverTriggerButton;
@end
......
......@@ -31,15 +31,6 @@
@implementation VLCMainWindowCollectionViewItem
- (void)loadView {
self.view = [[libraryView alloc] init];
self.VLCItemImageView = [[NSImageView alloc] initWithFrame:self.view.bounds];
self.VLCItemImageView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[self.view addSubview:self.VLCItemImageView];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
......@@ -78,16 +69,21 @@
}
}
@end
@interface libraryView () {
- (BOOL)buttonIsPressed
{
return self.VLCPopOverTriggerButton.intValue == 1;
}
@end
- (IBAction)popOver:(id)sender {
NSLog(@"VLC: Popup tapped");
if (self.buttonIsPressed)
{
[self.VLCPopOver showRelativeToRect:[self.VLCPopOverTriggerButton bounds] ofView:self.VLCPopOverTriggerButton preferredEdge:NSMaxYEdge];
} else {
[self.VLCPopOver close];
}
}
@implementation libraryView
@end
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