Skip to content

chore: 使用dci icon重绘switchButton, 增加动画 - #593

Merged
Whale107 merged 2 commits into
linuxdeepin:dev/animationfrom
Whale107:switchbutton
Aug 22, 2024
Merged

chore: 使用dci icon重绘switchButton, 增加动画#593
Whale107 merged 2 commits into
linuxdeepin:dev/animationfrom
Whale107:switchbutton

Conversation

@Whale107

@Whale107 Whale107 commented Aug 5, 2024

Copy link
Copy Markdown
Contributor

使用dci icon重绘switchButton, 增加动画

Log:

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 5, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#593
@deepin-bot

deepin-bot Bot commented Aug 5, 2024

Copy link
Copy Markdown
Contributor

Doc Check bot
🟡 some documents missing!

File Line Symbol
src/widgets/private/dswitchbutton_p.h 25 bool Dtk::Widget::DSwitchButtonPrivate::checked
src/widgets/private/dswitchbutton_p.h 19 Dtk::Widget::DSwitchButtonPrivate::DSwitchButtonPrivate
src/widgets/private/dswitchbutton_p.h 20 Dtk::Widget::DSwitchButtonPrivate::~DSwitchButtonPrivate
src/widgets/private/dswitchbutton_p.h 22 void Dtk::Widget::DSwitchButtonPrivate::init
src/widgets/private/dswitchbutton_p.h 16 Dtk::Widget::DSwitchButtonPrivate

deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 5, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#593
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 13, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#593
使用dci icon重绘switchButton, 增加动画

Log:
deepin-ci-robot added a commit to linuxdeepin/dtk6widget that referenced this pull request Aug 14, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#593
@Whale107
Whale107 merged commit 967f8d9 into linuxdeepin:dev/animation Aug 22, 2024
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

关键摘要:

  • DSwitchButton::paintEvent中添加了setRenderHint(QPainter::SmoothPixmapTransform),这可能会影响性能,应该确认是否有必要。
  • DSwitchButtonPrivate中的timer被设置为QTimer类型,但没有提供任何参数,这可能不是预期的行为。应该检查QTimer的构造函数是否需要参数,并确保它们被正确传递。
  • DSwitchButtonPrivateinit函数中,initPlayer函数被作为匿名函数传递,这可能会导致在多线程环境下出现问题。应该考虑使用QMetaObject::invokeMethod来确保线程安全。
  • player.setIconSize(DCI_ICON_SIZE)被调用,但没有检查DCI_ICON_SIZE是否是一个有效的值。应该验证这个值是否在合理的范围内。
  • player.setTheme(DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType这行代码中,DGuiApplicationHelper::instance()->themeType()可能返回的是DGuiApplicationHelper::ThemeType::Invalid,这可能会导致setTheme方法调用失败。应该检查themeType的值是否有效。
  • timersetInterval方法被调用,但没有提供任何参数,这可能不是预期的行为。应该检查QTimersetInterval方法是否需要参数,并确保它们被正确传递。
  • timer的连接中,[q, this]是一个匿名函数,这可能会导致this关键字在非对象上下文中被使用。应该确保this关键字在正确的上下文中使用。
  • player.play(DDciIcon::Mode::Normal)被调用,但没有检查DDciIcon::Mode::Normal是否是一个有效的值。应该验证这个值是否在合理的范围内。
  • player.setMode(DDciIcon::Normal)被调用,但没有检查DDciIcon::Normal是否是一个有效的值。应该验证这个值是否在合理的范围内。
  • player.setIcon(icon)被调用,但没有检查icon是否是一个有效的值。应该验证这个值是否在合理的范围内。

是否建议立即修改:

Whale107 added a commit to Whale107/dtkwidget that referenced this pull request Sep 23, 2024
使用dci icon重绘switchButton, 增加动画

Log:
deepin-bot Bot pushed a commit that referenced this pull request Sep 23, 2024
使用dci icon重绘switchButton, 增加动画

Log:
FeiWang1119 pushed a commit to linuxdeepin/dtk6widget that referenced this pull request Sep 25, 2024
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#593
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants