mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 19:22:25 +00:00
Introduced auto-expansion on Outlineview
This commit is contained in:
@@ -348,7 +348,7 @@
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="736877784"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<int key="NSsFlags">154160</int>
|
||||
<int key="NSsFlags">133680</int>
|
||||
<reference key="NSVScroller" ref="1037276411"/>
|
||||
<reference key="NSHScroller" ref="802411427"/>
|
||||
<reference key="NSContentView" ref="262664416"/>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
[self.outlineView setMenu:[self _contextMenu]];
|
||||
[self.outlineView setAllowsEmptySelection:YES];
|
||||
[self.outlineView setFloatsGroupRows:NO];
|
||||
[self.outlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:YES];
|
||||
|
||||
|
||||
NSView *myView = [self view];
|
||||
self.showConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[myView(>=100,<=250)]"
|
||||
@@ -96,10 +98,8 @@
|
||||
[_treeController setChildrenKeyPath:@"groups"];
|
||||
[_treeController bind:NSContentBinding toObject:document withKeyPath:@"root" options:nil];
|
||||
[_outlineView bind:NSContentBinding toObject:_treeController withKeyPath:@"arrangedObjects" options:nil];
|
||||
|
||||
[self.outlineView reloadData];
|
||||
//MPDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
[self.outlineView expandItem:document.root expandChildren:NO];
|
||||
NSTreeNode *node = [_outlineView itemAtRow:0];
|
||||
[_outlineView expandItem:node expandChildren:NO];
|
||||
}
|
||||
|
||||
- (void)clearSelection {
|
||||
@@ -131,8 +131,12 @@
|
||||
if(!group) {
|
||||
group = document.root;
|
||||
}
|
||||
BOOL isFistGroup = [document.root.groups count] == 0;
|
||||
[document createGroup:group];
|
||||
[self.outlineView reloadData];
|
||||
if(isFistGroup) {
|
||||
NSTreeNode *node = [_outlineView itemAtRow:0];
|
||||
[_outlineView expandItem:node expandChildren:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createEntry:(id)sender {
|
||||
|
||||
@@ -71,4 +71,9 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MPOutlineViewDidChangeGroupSelection object:self userInfo:nil];
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item {
|
||||
KdbGroup *group = [item representedObject];
|
||||
return (nil != group.parent);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>8DB</string>
|
||||
<string>905</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1080</int>
|
||||
<string key="IBDocument.SystemVersion">12D78</string>
|
||||
<string key="IBDocument.SystemVersion">12E55</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.37</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.39</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -200,7 +200,6 @@
|
||||
<string key="NSFrame">{{1, 119}, {238, 15}}</string>
|
||||
<reference key="NSSuperview" ref="628894392"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:60</string>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
<int key="NSsFlags">1</int>
|
||||
|
||||
Reference in New Issue
Block a user