mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
[Tab Bar] Accept proposed action only ontop of a tab
You cannot drop a file/folder onto the empty area of the tab bar, so show the appropriate "not allowed" cursor.
This commit is contained in:
parent
b81d3fbbbb
commit
d832216159
|
@ -36,7 +36,13 @@ void DolphinTabBar::dragEnterEvent(QDragEnterEvent* event)
|
|||
const int index = tabAt(event->pos());
|
||||
|
||||
if (mimeData->hasUrls()) {
|
||||
event->acceptProposedAction();
|
||||
if (index >= 0) {
|
||||
event->acceptProposedAction();
|
||||
} else {
|
||||
event->setDropAction(Qt::IgnoreAction);
|
||||
// Still need to accept it to receive dragMoveEvent
|
||||
event->accept();
|
||||
}
|
||||
updateAutoActivationTimer(index);
|
||||
}
|
||||
|
||||
|
@ -56,6 +62,11 @@ void DolphinTabBar::dragMoveEvent(QDragMoveEvent* event)
|
|||
const int index = tabAt(event->pos());
|
||||
|
||||
if (mimeData->hasUrls()) {
|
||||
if (index >= 0) {
|
||||
event->acceptProposedAction();
|
||||
} else {
|
||||
event->setDropAction(Qt::IgnoreAction);
|
||||
}
|
||||
updateAutoActivationTimer(index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue