Skip to content
This repository
Browse code

reverted kfsplitview to default, didn't realize it was a library by k…

…en ferry. also removed divider style customziation from the library and added it into the plugin code
  • Loading branch information...
commit 15870c3bb275624be56fac2f9e912379db5ee3ec 1 parent 256fa31
Mark Huot authored
45 src/sidebar/KFSplitView.m
@@ -166,6 +166,9 @@ + (void)initialize
166 166
167 167 - (void)kfSetup
168 168 {
  169 + // be sure to setup cursors before calling setVertical:
  170 + [self kfSetupResizeCursors];
  171 +
169 172 kfCollapsedSubviews = [[NSMutableSet alloc] init];
170 173 kfDividerRects = [[NSMutableArray alloc] init];
171 174
@@ -173,7 +176,43 @@ - (void)kfSetup
173 176 kfNotificationCenter = [NSNotificationCenter defaultCenter];
174 177
175 178 [self setVertical:[self isVertical]];
176   - [self setDividerStyle:NSSplitViewDividerStyleThin];
  179 +}
  180 +
  181 +// Attempts to find cursors to use as kfIsVerticalResizeCursor and kfNotIsVerticalResizeCursor.
  182 +// These cursors are eventually released, so make sure each receives a retain message now.
  183 +// If no good cursors can be found, an error is printed and the arrow cursor is used.
  184 +- (void)kfSetupResizeCursors
  185 +{
  186 + NSImage *isVerticalImage, *isNotVerticalImage;
  187 +
  188 + if (isVerticalImage = [NSImage imageNamed:@"NSTruthHorizontalResizeCursor"]); // standard Jaguar NSSplitView resize cursor
  189 + else if (isVerticalImage = [NSImage imageNamed:@"NSTruthHResizeCursor"]);
  190 +
  191 + if (isVerticalImage)
  192 + {
  193 + kfIsVerticalResizeCursor = [[NSCursor alloc] initWithImage:isVerticalImage
  194 + hotSpot:NSMakePoint(8,8)];
  195 + }
  196 +
  197 + if (isNotVerticalImage = [NSImage imageNamed:@"NSTruthVerticalResizeCursor"]); // standard Jaguar NSSplitView resize cursor
  198 + else if (isNotVerticalImage = [NSImage imageNamed:@"NSTruthVResizeCursor"]);
  199 +
  200 + if (isNotVerticalImage)
  201 + {
  202 + kfNotIsVerticalResizeCursor = [[NSCursor alloc] initWithImage:isNotVerticalImage
  203 + hotSpot:NSMakePoint(8,8)];
  204 + }
  205 +
  206 + if (kfIsVerticalResizeCursor == nil)
  207 + {
  208 + kfIsVerticalResizeCursor = [[NSCursor arrowCursor] retain];
  209 + NSLog(@"Warning - no horizontal resizing cursor located. Please report this as a bug.");
  210 + }
  211 + if (kfNotIsVerticalResizeCursor == nil)
  212 + {
  213 + kfNotIsVerticalResizeCursor = [[NSCursor arrowCursor] retain];
  214 + NSLog(@"Warning - no vertical resizing cursor located. Please report this as a bug.");
  215 + }
177 216 }
178 217
179 218 - (void)awakeFromNib
@@ -808,11 +847,11 @@ - (void)setVertical:(BOOL)flag
808 847 kfIsVertical = flag;
809 848 if (kfIsVertical)
810 849 {
811   - kfCurrentResizeCursor = [NSCursor resizeLeftRightCursor];
  850 + kfCurrentResizeCursor = kfIsVerticalResizeCursor;
812 851 }
813 852 else
814 853 {
815   - kfCurrentResizeCursor = [NSCursor resizeLeftRightCursor];
  854 + kfCurrentResizeCursor = kfNotIsVerticalResizeCursor;
816 855 }
817 856 }
818 857
1  src/sidebar/SideBarSwitching.mm
@@ -44,6 +44,7 @@ - (void)SideBarSwitching_windowDidLoad
44 44 [splitView setVertical:YES];
45 45 [splitView setDelegate:self];
46 46 [splitView setSideBarOnRight:[SideBarSwitching sidebarOnRight]];
  47 + [splitView setDividerStyle:NSSplitViewDividerStyleThin];
47 48
48 49 if(not [SideBarSwitching sidebarOnRight])
49 50 [splitView addSubview:drawerView];

0 comments on commit 15870c3

Please sign in to comment.
Something went wrong with that request. Please try again.