refactor: Remove the bottom area to prevent unintentional operation in auto-hide mode

隐藏模式下,如果鼠标唤起dock,容易呼出窗口预览,这是不必要的操作。
This commit is contained in:
justforlxz 2019-05-06 10:01:02 +08:00
parent 3a64c637f9
commit 6f317050f3
No known key found for this signature in database
GPG Key ID: 593AFD577C1B1A60

View File

@ -26,6 +26,7 @@
#include <QMouseEvent>
#include <QJsonObject>
#include <QCursor>
Position DockItem::DockPosition = Position::Top;
DisplayMode DockItem::DockDisplayMode = DisplayMode::Efficient;
@ -161,6 +162,11 @@ void DockItem::mousePressEvent(QMouseEvent *e)
void DockItem::enterEvent(QEvent *e)
{
// Remove the bottom area to prevent unintentional operation in auto-hide mode.
if (!rect().adjusted(0, 0, width(), height() - 5).contains(mapFromGlobal(QCursor::pos()))) {
return;
}
m_hover = true;
m_hoverEffect->setHighlighting(true);
m_popupTipsDelayTimer->start();