Skip to content
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

feat(TDSwitch): 添加自定义“开/关”字体大小 #217

Merged

Conversation

shinyina
Copy link
Contributor

@shinyina shinyina commented Jul 1, 2024

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#208

💡 需求背景和解决方案

问题:Switch组件支持自定义文字,但当前字体大小是固定的,用户如果想把文字改小点,不支持修改。
任务:请参考Switch组件的thumbContentOnColor属性,增加thumbContentOnFont和thumbContentOffFont,实现修改字体大小的功能,并在Switch示例页的“单元测试”栏目下,增加使用示例。

实现自定义开关前自定义大小以及demo样例

image
image

api文档以及代码样例
image
image

📝 更新日志

  • feat(TDSwitch): 添加自定义“开/关”字体大小

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • Changelog 已提供或无须提供

@shinyina
Copy link
Contributor Author

shinyina commented Jul 5, 2024

@Luozf12345 辛苦review

@Luozf12345 Luozf12345 changed the base branch from main to rhino-bird July 25, 2024 07:57
@@ -24,9 +24,11 @@ class TDSwitch extends StatefulWidget {
this.trackOffColor,
this.thumbContentOnColor,
this.thumbContentOffColor,
this.thumbContentOnFont,
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里可以改出直接传TextStyle,这样用户使用会更灵活

@Luozf12345 Luozf12345 merged commit b2b0be5 into Tencent:rhino-bird Aug 24, 2024
1 check passed
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