wc_toast
一个独立、轻量的 PySide6 弱提示组件,视觉参考 macOS 通知中心。
特性
- 浅色半透明圆角通知卡片
- 成功、信息、警告、错误和默认主题
- 滑入、回弹、淡出动画
- 同一位置多条通知自动堆叠
- 支持操作按钮、关闭按钮和自动消失
- 不依赖
pyqttoast - 支持七个预设位置
安装
pip install wc_toast
快速使用
from PySide6.QtWidgets import QApplication
from wc_toast import Toast, ToastPosition
app = QApplication([])
Toast.success(
"保存成功",
"项目文件已经保存。",
position=ToastPosition.TOP_RIGHT,
)
app.exec()
可用位置
ToastPosition.TOP_LEFT # 顶部靠左
ToastPosition.TOP_MIDDLE # 顶部中间
ToastPosition.TOP_RIGHT # 顶部靠右
ToastPosition.MIDDLE_LOWER # 屏幕中间偏下
ToastPosition.BOTTOM_LEFT # 底部靠左
ToastPosition.BOTTOM_MIDDLE # 底部中间
ToastPosition.BOTTOM_RIGHT # 底部靠右
完整配置
from wc_toast import Toast, ToastPosition, ToastPreset
toast = Toast()
toast.setPreset(ToastPreset.INFORMATION)
toast.setTitle("处理完成")
toast.setText("文件已经导入,可以继续下一步。")
toast.setDuration(3000)
toast.setPosition(ToastPosition.MIDDLE_LOWER)
toast.setAction("查看详情", lambda: print("查看"))
toast.show()
duration=0 时通知不会自动关闭。
本地演示
python -m wc_toast.toast
许可证
MIT
Metadata
Release files for wc-toast 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wc_toast-0.1.0.tar.gz | 8.4 kB | Without provenance | Details for wc_toast-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wc_toast-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for wc_toast-0.1.0-py3-none-any.whl |
Total release size: 17.1 kB
Release files / wc_toast-0.1.0.tar.gz
| Download URL | wc_toast-0.1.0.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fe0c27254283d04ed381290c477b732cf518e1165e9eb52b8b31fcc371186ed
|
|
BLAKE2b-256 checksum How to use checksums |
804a777a91eebfb31311f919d19483d72937009e89aafa0940291917e8bfa477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / wc_toast-0.1.0-py3-none-any.whl
| Download URL | wc_toast-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45cbc9d1ddc1f134a356a0c4a6190f68f87376094e96cf67ebd70ce1cbbaec42
|
|
BLAKE2b-256 checksum How to use checksums |
214e1531c35e2bdd96f7ee44431595cb5d2195430e2508057ff72247642e2bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for wc-toast 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.