mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:10:47 +00:00
* Source/NSTableHeaderView.m: Use resize cursors
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33042 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4c45b02292
commit
73a0d9bc1d
2 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2011-05-14 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSTableHeaderView.m: Use resize cursors
|
||||||
|
|
||||||
2011-05-14 Eric Wasylishen <ewasylishen@gmail.com>
|
2011-05-14 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/NSTextView.m: Use IBeam cursor if selectable
|
* Source/NSTextView.m: Use IBeam cursor if selectable
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#import "AppKit/NSEvent.h"
|
#import "AppKit/NSEvent.h"
|
||||||
#import "AppKit/NSApplication.h"
|
#import "AppKit/NSApplication.h"
|
||||||
#import "AppKit/NSColor.h"
|
#import "AppKit/NSColor.h"
|
||||||
|
#import "AppKit/NSCursor.h"
|
||||||
#import "AppKit/NSScrollView.h"
|
#import "AppKit/NSScrollView.h"
|
||||||
#import "AppKit/NSGraphics.h"
|
#import "AppKit/NSGraphics.h"
|
||||||
#import "GSGuiPrivate.h"
|
#import "GSGuiPrivate.h"
|
||||||
|
@ -170,6 +171,29 @@
|
||||||
inView: self];
|
inView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) resetCursorRects
|
||||||
|
{
|
||||||
|
if ([[self tableView] allowsColumnResizing])
|
||||||
|
{
|
||||||
|
const NSRect visibleRect = [self visibleRect];
|
||||||
|
NSInteger i;
|
||||||
|
const NSInteger count = [[[self tableView] tableColumns] count];
|
||||||
|
|
||||||
|
for (i = 0; i < (count - 1) && (count > 0); i++)
|
||||||
|
{
|
||||||
|
NSRect resizeRect = [self headerRectOfColumn: i];
|
||||||
|
resizeRect.origin.x = NSMaxX(resizeRect) - mouse_sensitivity;
|
||||||
|
resizeRect.size.width = 2 * mouse_sensitivity;
|
||||||
|
resizeRect = NSIntersectionRect(resizeRect, visibleRect);
|
||||||
|
|
||||||
|
if (!NSEqualRects(NSZeroRect, resizeRect))
|
||||||
|
{
|
||||||
|
[self addCursorRect: resizeRect cursor: [NSCursor resizeLeftRightCursor]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In -mouseDown we intercept the mouse event to handle the
|
* In -mouseDown we intercept the mouse event to handle the
|
||||||
* colum resize and rearrangement. Resizing or moving columns
|
* colum resize and rearrangement. Resizing or moving columns
|
||||||
|
@ -287,6 +311,8 @@
|
||||||
/* Do we need to check that we already fit into this area ?
|
/* Do we need to check that we already fit into this area ?
|
||||||
We should */
|
We should */
|
||||||
|
|
||||||
|
[[NSCursor resizeLeftRightCursor] push];
|
||||||
|
|
||||||
if (!liveResize)
|
if (!liveResize)
|
||||||
{
|
{
|
||||||
oldHighlightRect = NSZeroRect;
|
oldHighlightRect = NSZeroRect;
|
||||||
|
@ -375,6 +401,8 @@
|
||||||
}
|
}
|
||||||
[NSEvent stopPeriodicEvents];
|
[NSEvent stopPeriodicEvents];
|
||||||
|
|
||||||
|
[NSCursor pop];
|
||||||
|
|
||||||
if (!liveResize)
|
if (!liveResize)
|
||||||
{
|
{
|
||||||
if (lit)
|
if (lit)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue