Tweak matrix layout to give more space for larger segmented controls. Better split...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 6 Mar 2013 15:10:29 +0000 (16:10 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 6 Mar 2013 15:10:29 +0000 (16:10 +0100)
English.lproj/MainMenu.xib
EnjoyableApplicationDelegate.h
EnjoyableApplicationDelegate.m
NJOutputController.m
NJOutputMapping.m

index ad2d58d67ddb4fe002cb8f42983f8948fb2abc99..b76cc8eebd067c5683e19744583de2d6fdec8da3 100644 (file)
                        <object class="NSWindowTemplate" id="808667431">
                                <int key="NSWindowStyleMask">15</int>
                                <int key="NSWindowBacking">2</int>
-                               <string key="NSWindowRect">{{355, 59}, {640, 270}}</string>
+                               <string key="NSWindowRect">{{355, 59}, {640, 320}}</string>
                                <int key="NSWTFlags">1685585920</int>
                                <string key="NSWindowTitle">Enjoyable</string>
                                <string key="NSWindowClass">NSWindow</string>
                                        <array key="NSToolbarIBSelectableItems" id="0"/>
                                </object>
                                <nil key="NSUserInterfaceItemIdentifier"/>
-                               <string key="NSWindowContentMinSize">{640, 270}</string>
+                               <string key="NSWindowContentMinSize">{640, 320}</string>
                                <object class="NSView" key="NSWindowView" id="177223957">
                                        <reference key="NSNextResponder"/>
                                        <int key="NSvFlags">256</int>
                                                                                                                <object class="NSOutlineView" id="365506042">
                                                                                                                        <reference key="NSNextResponder" ref="698362889"/>
                                                                                                                        <int key="NSvFlags">256</int>
-                                                                                                                       <string key="NSFrameSize">{200, 268}</string>
+                                                                                                                       <string key="NSFrameSize">{200, 318}</string>
                                                                                                                        <reference key="NSSuperview" ref="698362889"/>
                                                                                                                        <reference key="NSWindow"/>
-                                                                                                                       <reference key="NSNextKeyView" ref="892486973"/>
+                                                                                                                       <reference key="NSNextKeyView" ref="1036252745"/>
                                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                                        <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                                                        <bool key="NSControlAllowsExpansionToolTips">YES</bool>
                                                                                                                        <bool key="NSOutlineViewAutoresizesOutlineColumnKey">NO</bool>
                                                                                                                </object>
                                                                                                        </array>
-                                                                                                       <string key="NSFrame">{{1, 1}, {200, 268}}</string>
+                                                                                                       <string key="NSFrame">{{1, 1}, {200, 318}}</string>
                                                                                                        <reference key="NSSuperview" ref="364857164"/>
                                                                                                        <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="365506042"/>
                                                                                                        <double key="NSPercent">0.99789030000000001</double>
                                                                                                </object>
                                                                                        </array>
-                                                                                       <string key="NSFrameSize">{202, 270}</string>
+                                                                                       <string key="NSFrameSize">{202, 320}</string>
                                                                                        <reference key="NSSuperview" ref="977242492"/>
                                                                                        <reference key="NSWindow"/>
-                                                                                       <reference key="NSNextKeyView" ref="698362889"/>
+                                                                                       <reference key="NSNextKeyView" ref="892486973"/>
                                                                                        <int key="NSsFlags">150034</int>
                                                                                        <reference key="NSVScroller" ref="1036252745"/>
                                                                                        <reference key="NSHScroller" ref="892486973"/>
                                                                                        <double key="NSMagnification">1</double>
                                                                                </object>
                                                                        </array>
-                                                                       <string key="NSFrameSize">{202, 270}</string>
+                                                                       <string key="NSFrameSize">{202, 320}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
                                                                        <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="364857164"/>
                                                                        <array class="NSMutableArray" key="NSSubviews">
                                                                                <object class="NSSlider" id="792189805">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{228, 22}, {140, 12}}</string>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{228, 21}, {130, 12}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView"/>
                                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSliderCell" key="NSCell" id="423057230">
                                                                                </object>
                                                                                <object class="NSSlider" id="385416822">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
-                                                                                       <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{228, 90}, {176, 12}}</string>
+                                                                                       <int key="NSvFlags">265</int>
+                                                                                       <string key="NSFrame">{{228, 107}, {176, 12}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="125828224"/>
                                                                                <object class="NSSegmentedControl" id="875916470">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{227, 102}, {178, 15}}</string>
+                                                                                       <string key="NSFrame">{{226, 117}, {180, 20}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="385416822"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSegmentedCell" key="NSCell" id="241270212">
                                                                                                <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">262144</int>
-                                                                                               <object class="NSFont" key="NSSupport" id="22">
-                                                                                                       <string key="NSName">LucidaGrande</string>
-                                                                                                       <double key="NSSize">9</double>
-                                                                                                       <int key="NSfFlags">3614</int>
-                                                                                               </object>
+                                                                                               <int key="NSCellFlags2">131072</int>
+                                                                                               <reference key="NSSupport" ref="26"/>
                                                                                                <string key="NSCellIdentifier">_NS:9</string>
                                                                                                <reference key="NSControlView" ref="875916470"/>
                                                                                                <array class="NSMutableArray" key="NSSegmentImages">
                                                                                                        <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">43</double>
+                                                                                                               <double key="NSSegmentItemWidth">44</double>
                                                                                                                <string key="NSSegmentItemLabel">←</string>
                                                                                                                <bool key="NSSegmentItemSelected">YES</bool>
                                                                                                                <int key="NSSegmentItemImageScaling">0</int>
                                                                                                        </object>
                                                                                                        <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">43</double>
+                                                                                                               <double key="NSSegmentItemWidth">44</double>
                                                                                                                <string key="NSSegmentItemLabel">→</string>
                                                                                                                <int key="NSSegmentItemTag">1</int>
                                                                                                                <int key="NSSegmentItemImageScaling">0</int>
                                                                                <object class="NSSegmentedControl" id="921829691">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{227, 34}, {178, 15}}</string>
+                                                                                       <string key="NSFrame">{{226, 31}, {180, 20}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="792189805"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSSegmentedCell" key="NSCell" id="301345285">
                                                                                                <int key="NSCellFlags">67108864</int>
-                                                                                               <int key="NSCellFlags2">262144</int>
-                                                                                               <reference key="NSSupport" ref="22"/>
+                                                                                               <int key="NSCellFlags2">131072</int>
+                                                                                               <reference key="NSSupport" ref="26"/>
                                                                                                <string key="NSCellIdentifier">_NS:9</string>
                                                                                                <reference key="NSControlView" ref="921829691"/>
                                                                                                <array class="NSMutableArray" key="NSSegmentImages">
                                                                                                        <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">68</double>
+                                                                                                               <double key="NSSegmentItemWidth">64</double>
                                                                                                                <string key="NSSegmentItemLabel">↑</string>
                                                                                                                <string key="NSSegmentItemTooltip">Scroll up continuously</string>
                                                                                                                <bool key="NSSegmentItemSelected">YES</bool>
                                                                                                                <int key="NSSegmentItemImageScaling">0</int>
                                                                                                        </object>
                                                                                                        <object class="NSSegmentItem">
-                                                                                                               <double key="NSSegmentItemWidth">67</double>
+                                                                                                               <double key="NSSegmentItemWidth">63</double>
                                                                                                                <string key="NSSegmentItemLabel">↓</string>
                                                                                                                <string key="NSSegmentItemTooltip">Scroll down continuously</string>
                                                                                                                <int key="NSSegmentItemTag">1</int>
                                                                                <object class="NSSegmentedControl" id="125828224">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{226, 59}, {180, 24}}</string>
+                                                                                       <string key="NSFrame">{{226, 67}, {180, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="921829691"/>
                                                                                <object class="NSCustomView" id="57697638">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{228, 160}, {176, 24}}</string>
+                                                                                       <string key="NSFrame">{{228, 197}, {176, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="194275224"/>
                                                                                <object class="NSPopUpButton" id="194275224">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">265</int>
-                                                                                       <string key="NSFrame">{{225, 126}, {182, 26}}</string>
+                                                                                       <string key="NSFrame">{{225, 152}, {182, 26}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="875916470"/>
                                                                                <object class="NSMatrix" id="120408205">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{20, 20}, {200, 202}}</string>
+                                                                                       <string key="NSFrame">{{20, 16}, {200, 256}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="57697638"/>
                                                                                                        <int key="NSPeriodicInterval">75</int>
                                                                                                </object>
                                                                                        </array>
-                                                                                       <string key="NSCellSize">{200, 32}</string>
+                                                                                       <string key="NSCellSize">{200, 41}</string>
                                                                                        <string key="NSIntercellSpacing">{4, 2}</string>
                                                                                        <int key="NSMatrixFlags">1353195520</int>
                                                                                        <string key="NSCellClass">NSActionCell</string>
                                                                                <object class="NSTextField" id="1016088174">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">266</int>
-                                                                                       <string key="NSFrame">{{0, 239}, {429, 17}}</string>
+                                                                                       <string key="NSFrame">{{0, 289}, {429, 17}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="497528019"/>
                                                                                <object class="NSBox" id="497528019">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">10</int>
-                                                                                       <string key="NSFrame">{{12, 228}, {405, 5}}</string>
+                                                                                       <string key="NSFrame">{{12, 278}, {405, 5}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
                                                                                        <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="120408205"/>
                                                                                        <bool key="NSTransparent">NO</bool>
                                                                                </object>
                                                                        </array>
-                                                                       <string key="NSFrame">{{211, 0}, {429, 270}}</string>
+                                                                       <string key="NSFrame">{{211, 0}, {429, 320}}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
                                                                        <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="1016088174"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                        </array>
-                                                       <string key="NSFrameSize">{640, 270}</string>
+                                                       <string key="NSFrameSize">{640, 320}</string>
                                                        <reference key="NSSuperview" ref="177223957"/>
                                                        <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="977242492"/>
                                                        <bool key="NSIsVertical">YES</bool>
+                                                       <string key="NSAutosaveName">Main Split</string>
+                                                       <object class="NSMutableDictionary" key="NSHoldingPriorities">
+                                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                                               <array key="dict.sortedKeys">
+                                                                       <integer value="0"/>
+                                                                       <integer value="1"/>
+                                                               </array>
+                                                               <array key="dict.values">
+                                                                       <real value="250"/>
+                                                                       <real value="250"/>
+                                                               </array>
+                                                       </object>
                                                </object>
                                        </array>
-                                       <string key="NSFrameSize">{640, 270}</string>
+                                       <string key="NSFrameSize">{640, 320}</string>
                                        <reference key="NSSuperview"/>
                                        <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="206489479"/>
                                </object>
                                <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
-                               <string key="NSMinSize">{640, 325}</string>
+                               <string key="NSMinSize">{640, 375}</string>
                                <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
                                <string key="NSFrameAutosaveName">Enjoyable</string>
                                <bool key="NSWindowIsRestorable">YES</bool>
                                                                                <string key="NSFrameSize">{198, 198}</string>
                                                                                <reference key="NSSuperview" ref="947403733"/>
                                                                                <reference key="NSWindow"/>
-                                                                               <reference key="NSNextKeyView" ref="553414014"/>
+                                                                               <reference key="NSNextKeyView" ref="968378655"/>
                                                                                <bool key="NSEnabled">YES</bool>
                                                                                <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
                                                                                <bool key="NSControlAllowsExpansionToolTips">YES</bool>
                                                <string key="NSFrame">{{0, 20}, {200, 200}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
                                                <reference key="NSWindow"/>
-                                               <reference key="NSNextKeyView" ref="947403733"/>
+                                               <reference key="NSNextKeyView" ref="553414014"/>
                                                <int key="NSsFlags">150034</int>
                                                <reference key="NSVScroller" ref="968378655"/>
                                                <reference key="NSHScroller" ref="553414014"/>
                                                <string key="NSFrame">{{66, -1}, {134, 23}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
                                                <reference key="NSWindow"/>
+                                               <reference key="NSNextKeyView"/>
                                                <string key="NSReuseIdentifierKey">_NS:22</string>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" key="NSCell" id="517346822">
                                                        <int key="NSCellFlags">-2080374784</int>
                                                        <int key="NSCellFlags2">168034304</int>
                                                        <string key="NSContents"/>
-                                                       <reference key="NSSupport" ref="22"/>
+                                                       <object class="NSFont" key="NSSupport" id="22">
+                                                               <string key="NSName">LucidaGrande</string>
+                                                               <double key="NSSize">9</double>
+                                                               <int key="NSfFlags">3614</int>
+                                                       </object>
                                                        <string key="NSCellIdentifier">_NS:22</string>
                                                        <reference key="NSControlView" ref="149148392"/>
                                                        <int key="NSButtonFlags">1221349376</int>
                                        </object>
                                        <int key="connectionID">696</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">delegate</string>
+                                               <reference key="source" ref="206489479"/>
+                                               <reference key="destination" ref="207406104"/>
+                                       </object>
+                                       <int key="connectionID">892</int>
+                               </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBOutletConnection" key="connection">
                                                <string key="label">radioButtons</string>
                                                <reference key="object" ref="606740242"/>
                                                <array class="NSMutableArray" key="children">
                                                        <reference ref="497528019"/>
-                                                       <reference ref="120408205"/>
                                                        <reference ref="921829691"/>
                                                        <reference ref="125828224"/>
                                                        <reference ref="875916470"/>
                                                        <reference ref="1016088174"/>
                                                        <reference ref="194275224"/>
                                                        <reference ref="57697638"/>
-                                                       <reference ref="385416822"/>
                                                        <reference ref="792189805"/>
+                                                       <reference ref="385416822"/>
+                                                       <reference ref="120408205"/>
                                                </array>
                                                <reference key="parent" ref="206489479"/>
                                                <string key="objectName">Output Editor Pane</string>
                                <integer value="1" key="745.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
                                <string key="745.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="749.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <integer value="3" key="750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
+                               <integer value="1" key="750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
                                <string key="750.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="754.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
-                               <integer value="0" key="755.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
+                               <integer value="1" key="755.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey"/>
                                <string key="755.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="778.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                                <string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
                        <nil key="activeLocalization"/>
                        <dictionary class="NSMutableDictionary" key="localizations"/>
                        <nil key="sourceID"/>
-                       <int key="maxID">891</int>
+                       <int key="maxID">892</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <array class="NSMutableArray" key="referencedPartialClassDescriptions">
index 4615d12a5692b19239992dbabd36772d66aef803..b795a9243207fcf308ebfdcd72d1bf8795d923e2 100644 (file)
@@ -10,7 +10,9 @@
 @class NJOutputController;
 @class NJMappingsController;
 
-@interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate> {
+@interface EnjoyableApplicationDelegate : NSObject <NSApplicationDelegate,
+                                                    NSSplitViewDelegate>
+{
     IBOutlet NSMenu *dockMenuBase;
     IBOutlet NSWindow *window;
 }
index 2478b4e81c62654861a463b14ba22528d16e4fe8..fd70bdc22d69322872e360ab37675356a94b211e 100644 (file)
     [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
index b4152e9a825d7b31341e93e62ad94d9a15a4f88e..bcafe0d3a96f207feb1b5207a636ed0593db8863 100644 (file)
     [mouseSpeedSlider setEnabled:enabled];
     [mouseBtnSelect setEnabled:enabled];
     [scrollDirSelect setEnabled:enabled];
+    [scrollSpeedSlider setEnabled:enabled];
 }
 
 - (void)loadOutput:(NJOutput *)output forInput:(NJInput *)input {
index 6c1ba95ef55529236660c2cfa88c4426ec5906d2..fa8fda1fec37a3513665aa9e5d0ac6c5b3abed21 100644 (file)
@@ -37,7 +37,7 @@
 }
 
 - (void)trigger {
-    EnjoyableApplicationDelegate *ctrl = NSApplication.sharedApplication.delegate;
+    EnjoyableApplicationDelegate *ctrl = (EnjoyableApplicationDelegate *)NSApplication.sharedApplication.delegate;
     [ctrl.mappingsController activateMapping:_mapping];
 }