From ec81e83cae60debcc9edcc5ef43560b53bb3f986 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Wed, 6 Mar 2013 16:10:29 +0100 Subject: [PATCH] Tweak matrix layout to give more space for larger segmented controls. Better split view window resize behavior. --- English.lproj/MainMenu.xib | 112 ++++++++++++++++++++------------- EnjoyableApplicationDelegate.h | 4 +- EnjoyableApplicationDelegate.m | 23 +++++++ NJOutputController.m | 1 + NJOutputMapping.m | 2 +- 5 files changed, 95 insertions(+), 47 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index ad2d58d..b76cc8e 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -331,7 +331,7 @@ 15 2 - {{355, 59}, {640, 270}} + {{355, 59}, {640, 320}} 1685585920 Enjoyable NSWindow @@ -480,7 +480,7 @@ - {640, 270} + {640, 320} 256 @@ -504,10 +504,10 @@ 256 - {200, 268} + {200, 318} - + YES NO YES @@ -600,7 +600,7 @@ NO - {{1, 1}, {200, 268}} + {{1, 1}, {200, 318}} @@ -634,10 +634,10 @@ 0.99789030000000001 - {202, 270} + {202, 320} - + 150034 @@ -648,7 +648,7 @@ 1 - {202, 270} + {202, 320} @@ -660,10 +660,11 @@ - 268 - {{228, 22}, {140, 12}} + 265 + {{228, 21}, {130, 12}} + _NS:9 YES @@ -685,8 +686,8 @@ - 268 - {{228, 90}, {176, 12}} + 265 + {{228, 107}, {176, 12}} @@ -712,7 +713,7 @@ 265 - {{227, 102}, {178, 15}} + {{226, 117}, {180, 20}} @@ -720,23 +721,19 @@ YES 67108864 - 262144 - - LucidaGrande - 9 - 3614 - + 131072 + _NS:9 - 43 + 44 ← YES 0 - 43 + 44 → 1 0 @@ -759,7 +756,7 @@ 265 - {{227, 34}, {178, 15}} + {{226, 31}, {180, 20}} @@ -767,20 +764,20 @@ YES 67108864 - 262144 - + 131072 + _NS:9 - 68 + 64 ↑ Scroll up continuously YES 0 - 67 + 63 ↓ Scroll down continuously 1 @@ -804,7 +801,7 @@ 265 - {{226, 59}, {180, 24}} + {{226, 67}, {180, 24}} @@ -841,7 +838,7 @@ 265 - {{228, 160}, {176, 24}} + {{228, 197}, {176, 24}} @@ -851,7 +848,7 @@ 265 - {{225, 126}, {182, 26}} + {{225, 152}, {182, 26}} @@ -884,7 +881,7 @@ 268 - {{20, 20}, {200, 202}} + {{20, 16}, {200, 256}} @@ -984,7 +981,7 @@ 75 - {200, 32} + {200, 41} {4, 2} 1353195520 NSActionCell @@ -1015,7 +1012,7 @@ 266 - {{0, 239}, {429, 17}} + {{0, 289}, {429, 17}} @@ -1039,7 +1036,7 @@ 10 - {{12, 228}, {405, 5}} + {{12, 278}, {405, 5}} @@ -1066,27 +1063,39 @@ NO - {{211, 0}, {429, 270}} + {{211, 0}, {429, 320}} NSView - {640, 270} + {640, 320} YES + Main Split + + YES + + + + + + + + + - {640, 270} + {640, 320} {{0, 0}, {1440, 878}} - {640, 325} + {640, 375} {10000000000000, 10000000000000} Enjoyable YES @@ -1109,7 +1118,7 @@ {198, 198} - + YES NO YES @@ -1201,7 +1210,7 @@ {{0, 20}, {200, 200}} - + 150034 @@ -1217,13 +1226,18 @@ {{66, -1}, {134, 23}} + _NS:22 YES -2080374784 168034304 - + + LucidaGrande + 9 + 3614 + _NS:22 1221349376 @@ -1600,6 +1614,14 @@ 696 + + + delegate + + + + 892 + radioButtons @@ -2142,15 +2164,15 @@ - - + + Output Editor Pane @@ -2556,10 +2578,10 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2625,7 +2647,7 @@ - 891 + 892 diff --git a/EnjoyableApplicationDelegate.h b/EnjoyableApplicationDelegate.h index 4615d12..b795a92 100644 --- a/EnjoyableApplicationDelegate.h +++ b/EnjoyableApplicationDelegate.h @@ -10,7 +10,9 @@ @class NJOutputController; @class NJMappingsController; -@interface EnjoyableApplicationDelegate : NSObject { +@interface EnjoyableApplicationDelegate : NSObject +{ IBOutlet NSMenu *dockMenuBase; IBOutlet NSWindow *window; } diff --git a/EnjoyableApplicationDelegate.m b/EnjoyableApplicationDelegate.m index 2478b4e..fd70bdc 100644 --- a/EnjoyableApplicationDelegate.m +++ b/EnjoyableApplicationDelegate.m @@ -107,4 +107,27 @@ [self.mappingsController activateMapping:chosen]; } +#define OUTPUT_PANE_MIN_WIDTH 390 + +- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset { + return proposedMax - OUTPUT_PANE_MIN_WIDTH; +} + +-(void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize { + NSView *inputView = splitView.subviews[0]; + NSView *outputView = splitView.subviews[1]; + if (outputView.frame.size.width < OUTPUT_PANE_MIN_WIDTH) { + NSSize frameSize = splitView.frame.size; + CGFloat inputWidth = frameSize.width - OUTPUT_PANE_MIN_WIDTH - splitView.dividerThickness; + inputView.frame = NSMakeRect(inputWidth, frameSize.height, + inputView.frame.size.width, + inputView.frame.size.height); + outputView.frame = NSMakeRect(inputWidth + splitView.dividerThickness, + 0, + OUTPUT_PANE_MIN_WIDTH, + frameSize.height); + } else + [splitView adjustSubviews]; +} + @end diff --git a/NJOutputController.m b/NJOutputController.m index b4152e9..bcafe0d 100644 --- a/NJOutputController.m +++ b/NJOutputController.m @@ -207,6 +207,7 @@ [mouseSpeedSlider setEnabled:enabled]; [mouseBtnSelect setEnabled:enabled]; [scrollDirSelect setEnabled:enabled]; + [scrollSpeedSlider setEnabled:enabled]; } - (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input { diff --git a/NJOutputMapping.m b/NJOutputMapping.m index 6c1ba95..fa8fda1 100644 --- a/NJOutputMapping.m +++ b/NJOutputMapping.m @@ -37,7 +37,7 @@ } - (void)trigger { - EnjoyableApplicationDelegate *ctrl = NSApplication.sharedApplication.delegate; + EnjoyableApplicationDelegate *ctrl = (EnjoyableApplicationDelegate *)NSApplication.sharedApplication.delegate; [ctrl.mappingsController activateMapping:_mapping]; } -- 2.30.2