Commit 414b4869 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix Bin hover thumbnails in icon view mode

parent 712a74e1
Pipeline #95020 canceled with stage
......@@ -494,13 +494,13 @@ public:
}
}
int getFrame(QModelIndex index, int mouseX)
int getFrame(QModelIndex index, QPoint pos)
{
int type = index.data(AbstractProjectItem::ItemTypeRole).toInt();
if ((type != AbstractProjectItem::ClipItem && type != AbstractProjectItem::SubClipItem)|| mouseX < m_thumbRect.x() || mouseX > m_thumbRect.right()) {
if ((type != AbstractProjectItem::ClipItem && type != AbstractProjectItem::SubClipItem) || !m_thumbRect.contains(pos)) {
return 0;
}
return 100 * (mouseX - m_thumbRect.x()) / m_thumbRect.width();
return 100 * (pos.x() - m_thumbRect.x()) / m_thumbRect.width();
}
private:
......@@ -573,7 +573,7 @@ void MyListView::mouseMoveEvent(QMouseEvent *event)
auto delegate = static_cast<BinListItemDelegate *>(del);
QRect vRect = visualRect(index);
if (vRect.contains(event->pos())) {
int frame = delegate->getFrame(index, event->pos().x() - vRect.x());
int frame = delegate->getFrame(index, event->pos());
emit displayBinFrame(index, frame, event->modifiers() & Qt::ShiftModifier);
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment