mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
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:
parent
d98e344a94
commit
48d99b9d0c
1 changed files with 15 additions and 3 deletions
|
@ -257,6 +257,9 @@
|
|||
float p;
|
||||
/* YES if some highlighting was done and needs to be undone */
|
||||
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;
|
||||
NSDate *farAway = [NSDate distantFuture];
|
||||
unsigned int eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask;
|
||||
|
@ -310,8 +313,14 @@
|
|||
inMode: NSEventTrackingRunLoopMode
|
||||
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)
|
||||
{
|
||||
dragged = YES;
|
||||
p = [self convertPoint: [e locationInWindow] fromView: nil].x;
|
||||
if (p < minCoord)
|
||||
{
|
||||
|
@ -348,9 +357,12 @@
|
|||
|
||||
/* The following tiles the table. We use a private method
|
||||
which avoids tiling the table twice. */
|
||||
[_tableView _userResizedTableColumn: _resizedColumn
|
||||
leftWidth: (p - NSMinX (rectLow))
|
||||
rightWidth: (NSMaxX (rectHigh) - p)];
|
||||
if (dragged == YES)
|
||||
{
|
||||
[_tableView _userResizedTableColumn: _resizedColumn
|
||||
leftWidth: (p - NSMinX (rectLow))
|
||||
rightWidth: (NSMaxX (rectHigh) - p)];
|
||||
}
|
||||
|
||||
/* Clean up */
|
||||
_resizedColumn = -1;
|
||||
|
|
Loading…
Reference in a new issue