Live Splitview patch

2009-05-14 Thread Nicolas Roard
Hi,

I'm ready to commit this patch, but I wanted to give the heads up before...
This basically remove the reverse splitview bar we draw to instead do
live resizing.
It's reasonably fast, tested on slow-ish machines (~1ghz x86  ppc),
and makes things much nicer from a UI point of view.
Comments before I submit ? :)

-- 
Nicolas Roard
I love deadlines. I like the whooshing sound
they make as they fly by. -- Douglas Adams
Index: Source/NSSplitView.m
===
--- Source/NSSplitView.m	(revision 28272)
+++ Source/NSSplitView.m	(working copy)
@@ -167,8 +167,6 @@
 - (void) mouseDown: (NSEvent*)theEvent
 {
   NSApplication *app = [NSApplication sharedApplication];
-  static NSRect oldRect; //only one can be dragged at a time
-  static BOOL lit = NO;
   NSPoint p, op;
   NSEvent *e;
   NSRect r, r1, bigRect, vis;
@@ -345,12 +343,8 @@
 }
 }
 
-  oldRect = NSZeroRect;
-  [self lockFocus];
-
   [[NSRunLoop currentRunLoop] limitDateForMode: NSEventTrackingRunLoopMode];
 
-  [_dividerColor set];
   r.size.width = divHorizontal;
   r.size.height = divVertical;
   e = [app nextEventMatchingMask: eventMask
@@ -363,12 +357,13 @@
   constrainImp = (floatIMP)[_delegate methodForSelector: constrainSel];
 }
 
-  // Save the old position
-  op = p;
-
   // user is moving the knob loop until left mouse up
   while ([e type] != NSLeftMouseUp)
 {
+
+  // Save the old position
+  op = p;
+
   p = [self convertPoint: [e locationInWindow] fromView: nil];
   if (delegateConstrains)
 {
@@ -410,148 +405,7 @@
   r.origin.x = p.x - (divHorizontal/2.);
   r.origin.y = NSMinY(vis);
 }
-  if (NSEqualRects(r, oldRect) == NO)
-{
-  NSDebugLLog(@NSSplitView, @drawing divider at %...@\n,
-  NSStringFromRect(r));
-  [_dividerColor set];
-
-
-  if (lit == YES)
-{
-  if (_isVertical == NO)
-{
-  if ((NSMinY(r)  NSMaxY(oldRect)) 
-  || (NSMaxY(r)  NSMinY(oldRect)))
-// the two rects don't intersect
-{
-  NSHighlightRect(oldRect);
-  NSHighlightRect(r);
-}
-  else
-// the two rects intersect
-{
-  if (NSMinY(r)  NSMinY(oldRect))
-{
-  NSRect onRect, offRect;
-  onRect.size.width = r.size.width;
-  onRect.origin.x = r.origin.x;
-  offRect.size.width = r.size.width;
-  offRect.origin.x = r.origin.x;
 
-  offRect.origin.y = NSMinY(oldRect);
-  offRect.size.height = 
-NSMinY(r) - NSMinY(oldRect);
-
-  onRect.origin.y = NSMaxY(oldRect);
-  onRect.size.height = 
-NSMaxY(r) - NSMaxY(oldRect);
-
-  NSHighlightRect(onRect);
-  NSHighlightRect(offRect);
-
-  //NSLog(@on : %@, NSStringFromRect(onRect));
-  //NSLog(@off : %@, NSStringFromRect(offRect));
-  //NSLog(@old : %@, NSStringFromRect(oldRect));
-  //NSLog(@r : %@, NSStringFromRect(r));
-}
-  else
-{
-  NSRect onRect, offRect;
-  onRect.size.width = r.size.width;
-  onRect.origin.x = r.origin.x;
-  offRect.size.width = r.size.width;
-  offRect.origin.x = r.origin.x;
-
-  offRect.origin.y = NSMaxY(r);
-  offRect.size.height = 
-NSMaxY(oldRect) - NSMaxY(r);
-
-  onRect.origin.y = NSMinY(r);
-  onRect.size.height = 
-NSMinY(oldRect) - NSMinY(r);
-
-  NSHighlightRect(onRect);
-  NSHighlightRect(offRect);
-
-  //NSLog(@on : %@, NSStringFromRect(onRect));
-  //NSLog(@off : %@, NSStringFromRect(offRect));
-  //NSLog(@old : %@, NSStringFromRect(oldRect));
-  //NSLog(@r : %@, NSStringFromRect(r));
-}
-}
-}
-  else
-{
-  if ((NSMinX(r)  NSMaxX(oldRect)) 
-  || (NSMaxX(r)  NSMinX(oldRect)))
-// the two rects don't intersect
-{
-  NSHighlightRect(oldRect);
-

Re: Live Splitview patch

2009-05-14 Thread Riccardo Mottola
Hmm,

I prefer not to have them live... it disturbs me.
Besides, 1ghz is slow for a desktop perhaps, but for some netbook it is not.

--Riccardo


 Hi,

 I'm ready to commit this patch, but I wanted to give the heads up
before...
 This basically remove the reverse splitview bar we draw to instead do
 live resizing.
 It's reasonably fast, tested on slow-ish machines (~1ghz x86  ppc),
 and makes things much nicer from a UI point of view.
 Comments before I submit ? :)




___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: Live Splitview patch (and a brief touch on live window resizing)

2009-05-14 Thread Gregory Casamento
It would be nice to have some modern features such as this.   I think we
should do things like this when we can and make it conditional for machines
which are too slow to handle it. Is there are way we can test the speed
of a machine in the config to determine if some features are turned on or
off by default?

I personally, would also like to have live resize of windows.   The current
resizing under art with GSX11HandlesWindowDecorations set to NO is to make
the user guess where the window will end up based on where the mouse cursor
is at the time he/she lets go of the left button.

As an example of an application which has live window resizing... take a
look at Affiche.app.   We should definitely try doing something like that
for live window resizing.

GC

On Thu, May 14, 2009 at 4:49 PM, Riccardo Mottola mul...@ngi.it wrote:

 Hmm,

 I prefer not to have them live... it disturbs me.
 Besides, 1ghz is slow for a desktop perhaps, but for some netbook it is
 not.

 --Riccardo


  Hi,
 
  I'm ready to commit this patch, but I wanted to give the heads up
 before...
  This basically remove the reverse splitview bar we draw to instead do
  live resizing.
  It's reasonably fast, tested on slow-ish machines (~1ghz x86  ppc),
  and makes things much nicer from a UI point of view.
  Comments before I submit ? :)
 



 ___
 Gnustep-dev mailing list
 Gnustep-dev@gnu.org
 http://lists.gnu.org/mailman/listinfo/gnustep-dev




-- 
Gregory Casamento
Open Logic Corporation, Principal Consultant
## GNUstep Chief Maintainer
yahoo/skype: greg_casamento, aol: gjcasa
(240)274-9630 (Cell), (301)362-9640 (Home)
___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev