-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: 增加滚动区域滚轮滚动到顶部或底部的回弹效果 #596
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Whale107 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#596
Doc Check bot
|
return; | ||
|
||
d->m_animationTarget = w; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
空行
src/widgets/dbounceanimation.cpp
Outdated
if (!w) | ||
return; | ||
|
||
w->installEventFilter(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有 install 应该有 uninstall 的逻辑,比如 if (d->m_animationTarget != w)
src/widgets/dbounceanimation.cpp
Outdated
|
||
QTimer::singleShot(100, this, [this, d, orientation]() { | ||
|
||
orientation & Qt::Vertical |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用 if else 的理由是啥, 这样可读性更差。。。
src/widgets/dlistview.cpp
Outdated
@@ -196,6 +198,8 @@ DListView::DListView(QWidget *parent) : | |||
DObject(*new DListViewPrivate(this)) | |||
{ | |||
d_func()->init(); | |||
auto animation = new DBounceAnimation(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以加一个环境变量禁用这种动画的。 类似 if (!qEnvironmentVariableIsSet("DTK_DISABLE_LISTVIEW_ANIMATION"))
public: | ||
explicit DBounceAnimation(QObject *parent = nullptr); | ||
|
||
void setAnimationTarget(QAbstractScrollArea *w); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以加一个 setEnable
接口方便用户禁用启用
增加滚动区域滚轮滚动到顶部或底部的回弹效果 Log:
Synchronize source files from linuxdeepin/dtkwidget. Source-pull-request: linuxdeepin/dtkwidget#596
deepin pr auto review关键摘要:
是否建议立即修改: |
增加滚动区域滚轮滚动到顶部或底部的回弹效果 Log:
增加滚动区域滚轮滚动到顶部或底部的回弹效果 Log:
增加滚动区域滚轮滚动到顶部或底部的回弹效果
Log: