mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: fashion tray expand error after double click control widget
https://github.com/linuxdeepin/internal-discussion/issues/932 Change-Id: I1dcd2985955893d42a297d70a865a49e890ee904
This commit is contained in:
parent
3962f474e9
commit
49b84eb0cc
Notes:
gerrit
2019-02-14 14:46:34 +08:00
Verified+1: <jenkins@deepin.com> Verified+1: liuwen123 <liuwen@linuxdeepin.com> Code-Review+2: listenerri <listenerri@gmail.com> Submitted-by: listenerri <listenerri@gmail.com> Submitted-at: Thu, 14 Feb 2019 14:46:34 +0800 Reviewed-on: https://cr.deepin.io/41600 Project: dde/dde-dock Branch: refs/heads/master
@ -31,11 +31,15 @@ DWIDGET_USE_NAMESPACE
|
||||
|
||||
FashionTrayControlWidget::FashionTrayControlWidget(Dock::Position position, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
m_expandDelayTimer(new QTimer(this)),
|
||||
m_dockPosition(position),
|
||||
m_expanded(true),
|
||||
m_hover(false),
|
||||
m_pressed(false)
|
||||
{
|
||||
m_expandDelayTimer->setInterval(400);
|
||||
m_expandDelayTimer->setSingleShot(true);
|
||||
|
||||
setDockPostion(m_dockPosition);
|
||||
setExpanded(m_expanded);
|
||||
}
|
||||
@ -106,6 +110,12 @@ void FashionTrayControlWidget::paintEvent(QPaintEvent *event)
|
||||
|
||||
void FashionTrayControlWidget::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (m_expandDelayTimer->isActive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_expandDelayTimer->start();
|
||||
|
||||
m_pressed = false;
|
||||
update();
|
||||
|
||||
|
@ -52,6 +52,7 @@ private:
|
||||
void refreshArrowPixmap();
|
||||
|
||||
private:
|
||||
QTimer *m_expandDelayTimer;
|
||||
QPixmap m_arrowPix;
|
||||
|
||||
Dock::Position m_dockPosition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user