mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 17:10:55 +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
f20571272a
commit
181c72a76b
1 changed files with 15 additions and 3 deletions
|
@ -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. */
|
||||||
|
if (dragged == YES)
|
||||||
|
{
|
||||||
[_tableView _userResizedTableColumn: _resizedColumn
|
[_tableView _userResizedTableColumn: _resizedColumn
|
||||||
leftWidth: (p - NSMinX (rectLow))
|
leftWidth: (p - NSMinX (rectLow))
|
||||||
rightWidth: (NSMaxX (rectHigh) - p)];
|
rightWidth: (NSMaxX (rectHigh) - p)];
|
||||||
|
}
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
_resizedColumn = -1;
|
_resizedColumn = -1;
|
||||||
|
|
Loading…
Reference in a new issue