aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-07-29 23:33:59 +0000
committerrowanbeentje <rowan@beent.je>2012-07-29 23:33:59 +0000
commit39acc61f00b719f69179e6add1513bb8886bd0e9 (patch)
treeeb382a35275228948b95bb08b81d49f3175da6d7 /Source
parentc06c5fe8261183d5f154edb1866608e8013ebbaa (diff)
downloadsequelpro-39acc61f00b719f69179e6add1513bb8886bd0e9.tar.gz
sequelpro-39acc61f00b719f69179e6add1513bb8886bd0e9.tar.bz2
sequelpro-39acc61f00b719f69179e6add1513bb8886bd0e9.zip
- Remove all BWToolKit views from the Bundle Editor window, replacing with normal equivalents and a SPSplitView
- Remove the ShortcutRecorder instance defined in Interface Builder from the Bundle Editor window, replacing with an instance set up from code. This removes the only dependency on the Shortcut Recorder .ibplugin, making it no longer necessary for building the project.
Diffstat (limited to 'Source')
-rw-r--r--Source/SPBundleEditorController.h4
-rw-r--r--Source/SPBundleEditorController.m34
2 files changed, 28 insertions, 10 deletions
diff --git a/Source/SPBundleEditorController.h b/Source/SPBundleEditorController.h
index 73dcbbc5..acdd60db 100644
--- a/Source/SPBundleEditorController.h
+++ b/Source/SPBundleEditorController.h
@@ -33,7 +33,7 @@
#import <ShortcutRecorder/ShortcutRecorder.h>
@class SRRecorderControl;
-@class BWSplitView;
+@class SPSplitView;
@class SPOutlineView;
@class SPBundleCommandTextView;
@@ -68,7 +68,7 @@
IBOutlet SRRecorderControl *keyEquivalentField;
IBOutlet NSButton *disabledCheckbox;
IBOutlet NSScrollView *commandScrollView;
- IBOutlet BWSplitView *splitView;
+ IBOutlet SPSplitView *splitView;
IBOutlet NSWindow *undeleteSheet;
IBOutlet NSWindow *metaInfoSheet;
diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m
index 7c89836d..e94303fb 100644
--- a/Source/SPBundleEditorController.m
+++ b/Source/SPBundleEditorController.m
@@ -35,6 +35,7 @@
#import "SPBundleCommandRunner.h"
#import "SPOutlineView.h"
#import "SPBundleCommandTextView.h"
+#import "SPSplitView.h"
#define kBundleNameKey @"bundleName"
#define kChildrenKey @"_children_"
@@ -127,14 +128,16 @@
- (void)awakeFromNib
{
- // Set up the splitview width manually; autosave appears to save but not restore this value
- // here, so restore in code if present.
- NSString *splitViewKeyName = [NSString stringWithFormat:@"NSSplitView Subview Frames %@", SP_BUNDLEEDITOR_SPLITVIEW_AUTOSAVE_STRING];
- if ([[NSUserDefaults standardUserDefaults] arrayForKey:splitViewKeyName]) {
- NSString *detailString = [[[NSUserDefaults standardUserDefaults] arrayForKey:splitViewKeyName] objectAtIndex:0];
- float dividerPosition = [[[detailString componentsSeparatedByString:@", "] objectAtIndex:2] floatValue];
- [splitView setPosition:dividerPosition ofDividerAtIndex:0];
- }
+ // Set the splitview up
+ [splitView setMinSize:122.f ofSubviewAtIndex:0];
+ [splitView setMinSize:588.f ofSubviewAtIndex:1];
+
+ // Set up the shortcut recorder control
+ [keyEquivalentField setAnimates:YES];
+ [keyEquivalentField setStyle:SRGreyStyle];
+ [keyEquivalentField setAllowedFlags:ShortcutRecorderAllFlags];
+ [keyEquivalentField setRequiredFlags:ShortcutRecorderEmptyFlags];
+ [keyEquivalentField setAllowsKeyOnly:NO escapeKeysRecord:NO];
// Init all needed variables; popup menus (with the chance for localization); and set
// defaults
@@ -1210,6 +1213,21 @@
}
#pragma mark -
+#pragma mark Split view delegates
+
+- (void)splitView:(NSSplitView *)theSplitView resizeSubviewsWithOldSize:(NSSize)oldSize
+{
+ NSView *nonResizableSubview = [[theSplitView subviews] objectAtIndex:0];
+ NSView *resizableSubview = [[theSplitView subviews] objectAtIndex:1];
+
+ CGFloat nonResizableSubviewTotal = [nonResizableSubview frame].size.width;
+ nonResizableSubviewTotal += [theSplitView dividerThickness];
+
+ [nonResizableSubview setFrameSize:NSMakeSize([nonResizableSubview frame].size.width, [splitView frame].size.height)];
+ [resizableSubview setFrameSize:NSMakeSize([theSplitView frame].size.width - nonResizableSubviewTotal, [splitView frame].size.height)];
+}
+
+#pragma mark -
#pragma mark TableView delegates
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView