mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:10:36 +00:00
* Source/GSToolbarView.m:
* Source/NSToolbar.m: Partial fix for toolbar drag and drop issues. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28072 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
83e65b773e
commit
0548fc3f19
3 changed files with 28 additions and 5 deletions
|
@ -398,11 +398,20 @@ static void initSystemExtensionsColors(void)
|
|||
NSToolbarItem *item = [[info draggingSource] toolbarItem];
|
||||
int newIndex = [self _insertionIndexAtPoint: [info draggingLocation]];
|
||||
// Calculate the index
|
||||
|
||||
[toolbar _insertPassivelyItem:item atIndex: index];
|
||||
RELEASE(item);
|
||||
[toolbar _moveItemFromIndex: index toIndex: newIndex broadcast: YES];
|
||||
|
||||
|
||||
if(index == -1)
|
||||
{
|
||||
[toolbar _insertPassivelyItem:item atIndex: newIndex];
|
||||
RELEASE(item);
|
||||
[toolbar _moveItemFromIndex: newIndex toIndex: newIndex broadcast: YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[toolbar _insertPassivelyItem:item atIndex: index];
|
||||
RELEASE(item);
|
||||
[toolbar _moveItemFromIndex: index toIndex: newIndex broadcast: YES];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
|
|
@ -930,6 +930,15 @@ static GSValidationCenter *vc = nil;
|
|||
{
|
||||
if (![_items containsObject: item])
|
||||
{
|
||||
if (newIndex > [_items count] - 1)
|
||||
{
|
||||
newIndex = [_items count] - 1;
|
||||
}
|
||||
else if(newIndex < 0)
|
||||
{
|
||||
newIndex = 0;
|
||||
}
|
||||
|
||||
[_items insertObject: item atIndex: newIndex];
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue