Check the scrollview style to display the autocomplete window.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37166 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2013-09-29 07:14:01 +00:00
parent 2fe4c2e708
commit f006045995
2 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-09-29 German Arias <germanandre@gmx.es>
* Source/GSAutocompleteWindow.m (-computePosition): Check the scrollview
style to display the autocomplete window.
2013-09-28 Eric Wasylishen <ewasylishen@gmail.com>
* Source/GSTheme.m:

View file

@ -199,6 +199,9 @@ static GSAutocompleteWindow *gsWindow = nil;
NSRect rect;
NSRect stringRect;
NSPoint point;
NSInterfaceStyle style;
style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil);
rect = [self frame];
screenFrame = [[[_textView window] screen] frame];
@ -211,7 +214,15 @@ static GSAutocompleteWindow *gsWindow = nil;
[_textView convertRect: stringRect toView: nil].origin];
// Calculate the origin point to the window.
rect.origin.x = point.x - [NSScroller scrollerWidth] - 4;
if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle)
{
rect.origin.x = point.x - 4;
}
else
{
rect.origin.x = point.x - [NSScroller scrollerWidth] - 4;
}
rect.origin.y = point.y - rect.size.height;
// If part of the window is off screen, change the origin point.