Skip to content

chore: 更改checkbox和radio实现方式为dci图标,增加动效 - #236

Merged
Whale107 merged 1 commit into
linuxdeepin:dev/animationfrom
Whale107:radio/checkbox
Aug 12, 2024
Merged

chore: 更改checkbox和radio实现方式为dci图标,增加动效#236
Whale107 merged 1 commit into
linuxdeepin:dev/animationfrom
Whale107:radio/checkbox

Conversation

@Whale107

@Whale107 Whale107 commented Aug 5, 2024

Copy link
Copy Markdown
Contributor

更改checkbox和radio实现方式为dci图标,增加动效

Log:

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

Source-pull-request: linuxdeepin/qt5integration#236
deepin-ci-robot added a commit to linuxdeepin/qt6integration that referenced this pull request Aug 5, 2024
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#236
deepin-ci-robot added a commit to linuxdeepin/qt6integration that referenced this pull request Aug 8, 2024
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#236
dciIconPlayer->setPalette(palette);
}
if (event->type() == QEvent::WindowActivate) {
dciIconPlayer->setIcon(icon);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

每个 if 里面都要 set icon and play ?

  • 提供一个 getModeFromeventType 的方法
  • seticon ,play(getModeFromeventType(event))

return QRect(xOffset, yOffset, size, size);
}

static void checkDciIconEngine(bool checked, const QString &checkedIconName, const QString &uncheckedIconName

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数名字有待商榷,和dciiconengine有什么关系?
参数也太多了,再改改吧

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

play(DDciIconPlayer *dciIconPlayer, icon, mode)..

deepin-ci-robot added a commit to linuxdeepin/qt6integration that referenced this pull request Aug 12, 2024
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#236
DDciIcon icon = radioButton->isChecked() ? DDciIcon::fromTheme("radio_checked") : DDciIcon::fromTheme("radio_unchecked");
DDciIconPalette palette;
palette.setHighlight(radioButton->palette().highlight().color());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto player = dciIconPlayers.value(radioButton)
if (!player)
    return DStyle::eventFilter(watched, event)

break;
}
}
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return DStyle::eventFilter(watched, event)

if (auto checkBox = qobject_cast<QCheckBox *>(watched)) {
DDciIcon icon = checkBox->isChecked() ? DDciIcon::fromTheme("checkbox_checked") : DDciIcon::fromTheme("checkbox_unchecked");
DDciIconPalette palette;
palette.setHighlight(checkBox->palette().highlight().color());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DDciIconPalette::fromQPalette

deepin-ci-robot added a commit to linuxdeepin/qt6integration that referenced this pull request Aug 12, 2024
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#236

@kegechen kegechen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试一下,不同主题,不同高亮色下显示是否有异常

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kegechen, 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

更改checkbox和radio实现方式为dci图标,增加动效

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

Source-pull-request: linuxdeepin/qt5integration#236
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

关键摘要:

  • ChameleonStyle类中,dciIconPlayers的声明被修改为mutable QHash<const QObject*, DDciIconPlayer* >,这可能意味着DDciIconPlayer对象将被存储在哈希表中,并且是可修改的。需要确认这一更改是否符合设计需求。
  • eventFilter方法被重载,但原始的DStyle类中的实现未被修改,这可能意味着eventFilter方法的行为未发生变化,只是增加了对QRadioButtonQCheckBox的事件过滤支持。需要检查eventFilter方法是否正确处理了所有可能的事件类型。

是否建议立即修改:

  • 是,需要确保dciIconPlayers的更改是必要的,并且不会引入新的问题。
  • 是,需要确保eventFilter方法在处理新的事件类型时仍然正确,并且没有遗漏任何关键的事件处理逻辑。

@Whale107
Whale107 merged commit 43c5515 into linuxdeepin:dev/animation Aug 12, 2024
Whale107 added a commit to Whale107/qt5integration that referenced this pull request Sep 23, 2024
更改checkbox和radio实现方式为dci图标,增加动效

Log:
Whale107 added a commit that referenced this pull request Sep 23, 2024
* feat: add animation for menu's selected backgroud

Add a ChameleonAnimation class for the geometry translate animation.

* chore: 更新滚动条样式,适配动画 (#233)

更新滚动条样式,适配动画

Log:

* chore: add round and remove shadow for menu item

add round and remove shadow for menu item

Log:

* chore: 更改checkbox和radio实现方式为dci图标,增加动效 (#236)

更改checkbox和radio实现方式为dci图标,增加动效

Log:

* fix: adjust progressbar color (#237)

adjust progressbar color

Log:

* fix: 修复在选中框之外hover 和点击也有动画的问题 (#238)

checkbox和radio有框选区和文字区,应该只对框选区事件做处理

Log:

---------

Co-authored-by: JiDe Zhang <zhangjide@deepin.org>
Co-authored-by: wangfei <wangfei@deepin.org>
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.

3 participants