Fixed clicking with mouse on a column side and doing no dragging

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8668 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 2001-01-17 21:19:31 +00:00
parent f20571272a
commit 181c72a76b

View file

@ -257,6 +257,9 @@
float p; float p;
/* YES if some highlighting was done and needs to be undone */ /* YES if some highlighting was done and needs to be undone */
BOOL lit = NO; BOOL lit = NO;
/* YES if some dragging was actually done - to avoid
retiling/redrawing the table if no dragging is done */
BOOL dragged = NO;
NSEvent *e; NSEvent *e;
NSDate *farAway = [NSDate distantFuture]; NSDate *farAway = [NSDate distantFuture];
unsigned int eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask; unsigned int eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask;
@ -310,8 +313,14 @@
inMode: NSEventTrackingRunLoopMode inMode: NSEventTrackingRunLoopMode
dequeue: YES]; dequeue: YES];
/* Safety assignment to make sure p is never left
unitialized - should make no difference with current code
but anyway */
p = NSMaxX (rectLow);
while ([e type] != NSLeftMouseUp) while ([e type] != NSLeftMouseUp)
{ {
dragged = YES;
p = [self convertPoint: [e locationInWindow] fromView: nil].x; p = [self convertPoint: [e locationInWindow] fromView: nil].x;
if (p < minCoord) if (p < minCoord)
{ {
@ -348,9 +357,12 @@
/* The following tiles the table. We use a private method /* The following tiles the table. We use a private method
which avoids tiling the table twice. */ which avoids tiling the table twice. */
[_tableView _userResizedTableColumn: _resizedColumn if (dragged == YES)
leftWidth: (p - NSMinX (rectLow)) {
rightWidth: (NSMaxX (rectHigh) - p)]; [_tableView _userResizedTableColumn: _resizedColumn
leftWidth: (p - NSMinX (rectLow))
rightWidth: (NSMaxX (rectHigh) - p)];
}
/* Clean up */ /* Clean up */
_resizedColumn = -1; _resizedColumn = -1;