mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
add request undock interface
Change-Id: I073253c7021a81de888c22d79011b4ef8d13a947
This commit is contained in:
parent
a0e7d5da9f
commit
04e950d013
@ -38,7 +38,10 @@ void DockItemController::itemMove(DockItem * const moveItem, DockItem * const re
|
||||
return;
|
||||
|
||||
const int moveIndex = m_itemList.indexOf(moveItem);
|
||||
const int replaceIndex = m_itemList.indexOf(replaceItem);
|
||||
const int replaceIndex = replaceItem->itemType() == DockItem::Placeholder ?
|
||||
// disable insert after placeholder item
|
||||
m_itemList.indexOf(replaceItem) - 1 :
|
||||
m_itemList.indexOf(replaceItem);
|
||||
|
||||
m_itemList.removeAt(moveIndex);
|
||||
emit itemRemoved(moveItem);
|
||||
|
@ -88,6 +88,16 @@ public Q_SLOTS: // METHODS
|
||||
return asyncCallWithArgumentList(QStringLiteral("Activate"), argumentList);
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> RequestDock()
|
||||
{
|
||||
return asyncCall(QStringLiteral("RequestDock"));
|
||||
}
|
||||
|
||||
inline QDBusPendingReply<> RequestUndock()
|
||||
{
|
||||
return asyncCall(QStringLiteral("RequestUndock"));
|
||||
}
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
// begin property changed signals
|
||||
void ActiveChanged();
|
||||
|
@ -134,7 +134,11 @@ void AppItem::startDrag()
|
||||
emit dragStarted();
|
||||
const Qt::DropAction result = drag->exec(Qt::MoveAction);
|
||||
|
||||
qDebug() << "dnd result: " << result;
|
||||
qDebug() << "dnd result: " << result << drag->target();
|
||||
|
||||
// drag out of dock panel
|
||||
if (!drag->target())
|
||||
m_itemEntry->RequestUndock();
|
||||
|
||||
m_draging = false;
|
||||
setVisible(true);
|
||||
|
@ -60,7 +60,8 @@ void MainPanel::dragEnterEvent(QDragEnterEvent *e)
|
||||
|
||||
// qDebug() << e->pos() << itemAt(e->pos());
|
||||
|
||||
DragingItem->show();
|
||||
if (qobject_cast<DockItem *>(e->source()))
|
||||
DragingItem->show();
|
||||
}
|
||||
|
||||
void MainPanel::dragMoveEvent(QDragMoveEvent *e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user