Skip to content

Commit

Permalink
Update dockitem.cpp
Browse files Browse the repository at this point in the history
修改了变量名,更符合阅读理解
  • Loading branch information
xinguankeli authored Jun 10, 2023
1 parent 2335a9a commit c0c73fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frame/item/dockitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ QPointer<DockPopupWindow> DockItem::PopupWindow(nullptr);
DockItem::DockItem(QWidget *parent)
: QWidget(parent)
, m_hover(false)
, m_down(false)
, m_pressed(false)
, m_popupShown(false)
, m_tapAndHold(false)
, m_draging(false)
Expand Down Expand Up @@ -135,14 +135,14 @@ void DockItem::updatePopupPosition()

void DockItem::paintEvent(QPaintEvent *e)
{
if(m_hover && !m_down)
if(m_hover && !m_pressed)
{
QPainter painter(this);
painter.setBrush(QBrush(QColor(248, 248, 255)));
painter.setPen(Qt::NoPen);
QRect tempRect = rect();
painter.drawRect(tempRect.x(), tempRect.y(), tempRect.width(), tempRect.height());
}else if(m_hover && m_down)
}else if(m_hover && m_pressed)
{
QPainter painter(this);
painter.setBrush(Qt::gray);
Expand All @@ -156,7 +156,7 @@ void DockItem::paintEvent(QPaintEvent *e)
void DockItem::mousePressEvent(QMouseEvent *e)
{
m_popupTipsDelayTimer->stop();
m_down = true;
m_pressed = true;
hideNonModel();

if (e->button() == Qt::RightButton) {
Expand Down Expand Up @@ -195,7 +195,7 @@ void DockItem::leaveEvent(QEvent *e)
QWidget::leaveEvent(e);

m_hover = false;
m_down = false;
m_pressed = false;
//FIXME: 可能是qt的bug,概率性导致崩溃,待修复
// m_hoverEffect->setHighlighting(false);
m_popupTipsDelayTimer->stop();
Expand All @@ -209,7 +209,7 @@ void DockItem::leaveEvent(QEvent *e)

void DockItem::mouseReleaseEvent(QMouseEvent *event)
{
m_down = false;
m_pressed = false;
QWidget::mouseReleaseEvent(event);
update();
}
Expand Down

0 comments on commit c0c73fa

Please sign in to comment.