From e60b7fbbd0ccc1b6008daf12ab74c6a55687adc8 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Mon, 11 Dec 2023 20:27:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=B3=E4=BA=8E=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwindow.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/mainwindow.py b/mainwindow.py index e2cc0df..9881c5a 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -409,13 +409,27 @@ def about_this_program()->"显示“关于这个程序”窗口": global about global title global iconPath + global clickIconTime + clickIconTime = 0 QT.message = QtWidgets.QMainWindow() QT.message.setWindowIcon(QtGui.QIcon(iconPath)) messageWidget = QtWidgets.QWidget() QT.message.setWindowTitle(f"关于 {title}") messageLayout = QtWidgets.QGridLayout() iconShow = QtWidgets.QLabel(f"") - iconShow.linkActivated.connect(lambda: iconShow.setText(f"")) + def ChangeIcon(): + global clickIconTime + if clickIconTime >= 0: + clickIconTime = clickIconTime + 1 + if clickIconTime > 5: + clickIconTime = -1 + for k in ["", "Function"]: + for i in os.listdir(f"{programPath}/Icon/{k}"): + if i[-4:] == ".svg" or i[-4:] == ".png": + iconPathList.append(f"{programPath}/Icon/{k}/{i}") + randomNumber = random.randint(0, len(iconPathList) - 1) + iconShow.setText(f"

{randomNumber + 1}/{len(iconPathList)}

") + iconShow.linkActivated.connect(ChangeIcon) messageLayout.addWidget(iconShow, 0, 0, 1, 1, QtCore.Qt.AlignTop) aboutInfo = QtWidgets.QTextBrowser(messageWidget) aboutInfo.setFocusPolicy(QtCore.Qt.NoFocus) @@ -2550,9 +2564,14 @@ app.installTranslator(trans) iconPath = "{}/deepin-wine-runner.svg".format(programPath) iconPathList = [ "{}/deepin-wine-runner.svg".format(programPath), + f"{programPath}/Icon/Program/AboutIcon1.png", f"{programPath}/Icon/Program/AboutIcon0.png", - f"{programPath}/Icon/Program/AboutIcon1.png" + f"{programPath}/Icon/Program/webp2.png", + f"{programPath}/Icon/Program/webp3.png", + f"{programPath}/Icon/Program/Windows虚拟机.png", + f"{programPath}/Icon/Program/wine打包器.png" ] + #iconPath = "{}/Icon/Program/wine运行器.png".format(programPath) programUrl = "https://gitee.com/gfdgd-xi/deep-wine-runner\nhttps://github.com/gfdgd-xi/deep-wine-runner\nhttps://gfdgd-xi.github.io" information = json.loads(readtxt(f"{programPath}/information.json"))