Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions styleplugins/chameleon/chameleonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,12 +901,12 @@ bool ChameleonStyle::hideScrollBarByAnimation(const QStyleOptionSlider *scrollBa
bool isHoveredOrPressed = hoveredOrPressed(scrollBar) || sbar->underMouse();
if (isHoveredOrPressed && st == QAbstractAnimation::Running) {
// 标记一下,鼠标移开时需要重新开启隐藏动画
sbar->setProperty("_d_dtk_scrollbar_visible", true);
sbar->setProperty("_d_dtk_scrollbar_hide_ani", true);
return false;
}

if (sbar->property("_d_dtk_scrollbar_visible").toBool()) {
sbar->setProperty("_d_dtk_scrollbar_visible", false);
if (sbar->property("_d_dtk_scrollbar_hide_ani").toBool()) {
sbar->setProperty("_d_dtk_scrollbar_hide_ani", false);
styleAnimation->restart(true);
return false;
}
Expand Down Expand Up @@ -4623,8 +4623,8 @@ void ChameleonStyle::resetAttribute(QWidget *w, bool polish)
w->setAttribute(Qt::WA_Hover, enableHover);

if (auto scrollbar = qobject_cast<QScrollBar *>(w)) {
// 默认初始显示滚动条,然后启动隐藏动画
scrollbar->setProperty("_d_dtk_scrollbar_visible", true);
// 默认情况下不执行隐藏动画
scrollbar->setProperty("_d_dtk_scrollbar_hide_ani", false);
scrollbar->setAttribute(Qt::WA_OpaquePaintEvent, !polish);
}
}
Expand Down
Loading