зеркало из https://github.com/mozilla/gecko-dev.git
change cursor to show action feedback when keys held down. r=saari/sr=sfraser. bug# 87911
This commit is contained in:
Родитель
0a5641d407
Коммит
d819a81aae
|
@ -847,3 +847,34 @@ nsDragService :: EndDragSession ( )
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// SetDragAction
|
||||
//
|
||||
// Override to set the cursor to the appropriate feedback when the
|
||||
// drag action changes based on modifier keys
|
||||
//
|
||||
NS_IMETHODIMP
|
||||
nsDragService :: SetDragAction ( PRUint32 anAction )
|
||||
{
|
||||
const PRInt32 kCopyCursorID = 144;
|
||||
const PRInt32 kLinkCursorID = 145;
|
||||
|
||||
// don't do the work if it's the same.
|
||||
if ( anAction == mDragAction )
|
||||
return;
|
||||
|
||||
CursHandle newCursor = nsnull;
|
||||
if ( anAction == DRAGDROP_ACTION_COPY )
|
||||
newCursor = ::GetCursor ( kCopyCursorID );
|
||||
else if ( anAction == DRAGDROP_ACTION_LINK )
|
||||
newCursor = ::GetCursor ( kLinkCursorID );
|
||||
if ( newCursor ) {
|
||||
::HLock((Handle)newCursor);
|
||||
::SetCursor ( *newCursor );
|
||||
::HUnlock((Handle)newCursor);
|
||||
}
|
||||
else
|
||||
::InitCursor();
|
||||
|
||||
return nsBaseDragService::SetDragAction(anAction);
|
||||
}
|
||||
|
|
|
@ -100,9 +100,7 @@ SetDragActionBasedOnModifiers ( nsIDragService* inDragService, short inModifiers
|
|||
action = nsIDragService::DRAGDROP_ACTION_COPY;
|
||||
}
|
||||
|
||||
// I think we only need to set this when it's not "none"
|
||||
if ( action != nsIDragService::DRAGDROP_ACTION_NONE )
|
||||
dragSession->SetDragAction ( action );
|
||||
dragSession->SetDragAction ( action );
|
||||
}
|
||||
|
||||
} // SetDragActionBasedOnModifiers
|
||||
|
|
Загрузка…
Ссылка в новой задаче