-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "CCefClientDelegate.h" | ||
|
||
#include <QDebug> | ||
#include <QSharedPointer> | ||
#include <QThread> | ||
|
||
#include "QCefViewPrivate.h" | ||
|
||
bool | ||
CCefClientDelegate::onDragEnter(CefRefPtr<CefBrowser> browser, | ||
CefRefPtr<CefDragData> dragData, | ||
CefDragHandler::DragOperationsMask mask) | ||
{ | ||
// Return false for default drag handling behavior or true to cancel the drag event. | ||
return !pCefViewPrivate_->q_ptr->isDragAndDropEnabled(); | ||
} | ||
|
||
void | ||
CCefClientDelegate::draggableRegionChanged(CefRefPtr<CefBrowser>& browser, | ||
const std::vector<CefDraggableRegion>& regions) | ||
{ | ||
if (!IsValidBrowser(browser)) | ||
return; | ||
|
||
// Determine new draggable region. | ||
QRegion draggableRegion; | ||
QRegion nonDraggableRegion; | ||
std::vector<CefDraggableRegion>::const_iterator it = regions.begin(); | ||
for (; it != regions.end(); ++it) { | ||
if (it->draggable) { | ||
draggableRegion += QRegion(it->bounds.x, it->bounds.y, it->bounds.width, it->bounds.height); | ||
} else { | ||
nonDraggableRegion += QRegion(it->bounds.x, it->bounds.y, it->bounds.width, it->bounds.height); | ||
} | ||
} | ||
|
||
pCefViewPrivate_->q_ptr->draggableRegionChanged(draggableRegion, nonDraggableRegion); | ||
} |