mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
Used Bindings in outline view
This commit is contained in:
@@ -295,6 +295,7 @@
|
||||
<string key="NSFrame">{{199, 289}, {32, 25}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:22</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="353877023">
|
||||
@@ -1552,7 +1553,6 @@
|
||||
<string key="493.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="494.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="495.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="496.CustomClassName">MPRoundedTextFieldCell</string>
|
||||
<string key="496.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="497.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="498.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1600,7 +1600,7 @@
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">565</int>
|
||||
<int key="maxID">628</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -1680,14 +1680,6 @@
|
||||
<string key="minorKey">./Classes/MPPopupImageView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPRoundedTextFieldCell</string>
|
||||
<string key="superclassName">NSTextFieldCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/MPRoundedTextFieldCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPSeparator</string>
|
||||
<string key="superclassName">NSView</string>
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
[self.outlineView setDelegate:self.outlineDelegate];
|
||||
[self.outlineView setMenu:[self _contextMenu]];
|
||||
[self.outlineView setAllowsEmptySelection:YES];
|
||||
[self.outlineView setFloatsGroupRows:NO];
|
||||
|
||||
NSView *myView = [self view];
|
||||
self.showConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[myView(>=100,<=250)]"
|
||||
|
||||
@@ -28,13 +28,13 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
NSTableCellView *view;
|
||||
if(![group parent]) {
|
||||
view = [outlineView makeViewWithIdentifier:_MPOutlinveViewHeaderViewIdentifier owner:self];
|
||||
[view.textField setStringValue:[group name]];
|
||||
[view.textField bind:NSValueBinding toObject:group withKeyPath:@"name" options:nil];
|
||||
}
|
||||
else {
|
||||
view = [outlineView makeViewWithIdentifier:_MPOutlineViewDataViewIdentifier owner:self];
|
||||
NSImage *icon = [MPIconHelper icon:(MPIconType)[group image]];
|
||||
[view.imageView setImage:icon];
|
||||
[view.textField setStringValue:[group name]];
|
||||
[view.textField bind:NSValueBinding toObject:group withKeyPath:@"name" options:nil];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,20 @@
|
||||
|
||||
#import "MPRoundedTextFieldCell.h"
|
||||
|
||||
#define CORNER_RADIUS 5.0
|
||||
#define CORNER_RADIUS 10.0
|
||||
|
||||
@implementation MPRoundedTextFieldCell
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
|
||||
[super drawWithFrame:cellFrame inView:controlView];
|
||||
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:cellFrame xRadius:CORNER_RADIUS yRadius:CORNER_RADIUS];
|
||||
[[NSColor clearColor] set];
|
||||
NSRectFill(cellFrame);
|
||||
[[NSColor blackColor] setStroke];
|
||||
[[NSColor whiteColor] setFill];
|
||||
[path fill];
|
||||
[path stroke];
|
||||
|
||||
//[super drawWithFrame:cellFrame inView:controlView];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>788</string>
|
||||
<string>796</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
Reference in New Issue
Block a user