From 4c72bedc88d529703ac259a4effc7945d8f5dd50 Mon Sep 17 00:00:00 2001 From: littlefean <2028140990@qq.com> Date: Thu, 19 Sep 2024 02:51:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++++++- README.md | 19 ++++++++++++++++++- assets/favicon.ico | Bin 0 -> 16958 bytes assets/image.qrc | 5 +++++ main.py | 4 ++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 assets/favicon.ico create mode 100644 assets/image.qrc diff --git a/.gitignore b/.gitignore index 47afe17..1befcc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ .venv/ -output/ \ No newline at end of file +output/ + +assets/assets.py + +__pycache__/ +*.pyc diff --git a/README.md b/README.md index a633b22..8cd7732 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,21 @@ ## 使用方法 -需要自行安装ffmpeg并配置环境变量 \ No newline at end of file +需要自行安装ffmpeg并配置环境变量 + +## 开发相关: + +此项目为LiRen团队开源项目,贡献代码前建议阅读开发规范文档中的python内容:https://liren.zty012.de/ + +更新 assets 资源文件指令 + +```commandline +pyrcc5 -o assets/assets.py assets/image.qrc +``` + +打包指令 + +```commandline +windows: +pyinstaller --onefile --windowed --icon=./assets/favicon.ico main.py -n timelapse-recorder +``` \ No newline at end of file diff --git a/assets/favicon.ico b/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..42757af1f6068d9e172e473288a99f8b1854e653 GIT binary patch literal 16958 zcmeHOv2xom3}voE#%#T7JG5i|BDwxp@@f8u*n8F_9XfXCRmGzP2ckd_qA1C|nmq+1 z00MX*MbVTR!WI3yzYp~HTe$rm!p9K8EnUP4k92__3&}3!l7UMG*3ZD<^-H&Z{oL)} z=z96oJ-rY`o32S*5eT$Vd^o~(_^mMMz@?bIj;4X-{*$30o%((KF{*g z>~YpHOZ;4iuX)k7>&-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V?d00001 diff --git a/assets/image.qrc b/assets/image.qrc new file mode 100644 index 0000000..2372392 --- /dev/null +++ b/assets/image.qrc @@ -0,0 +1,5 @@ + + + favicon.ico + + diff --git a/main.py b/main.py index 1f4c683..4d65efb 100644 --- a/main.py +++ b/main.py @@ -12,8 +12,11 @@ QLabel, QComboBox, ) +from PyQt5.QtGui import QIcon from PyQt5.QtCore import QTimer +from assets import assets # noqa: F401 + class ScreenshotApp(QWidget): def __init__(self): @@ -36,6 +39,7 @@ def __init__(self): def init_ui(self): self.setWindowTitle("延时录屏") + self.setWindowIcon(QIcon(":/favicon.ico")) # 设置最小宽度大小 self.setMinimumWidth(500) layout = QVBoxLayout()