This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加托盘,添加设置界面,可以缩放人物了,改变显示策略使程序动画播放更流畅,cpu占用更小
- Loading branch information
HenryZeng
committed
Jun 14, 2020
1 parent
b7b829f
commit 5c184f3
Showing
10 changed files
with
384 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from UI.Setbox import Ui_Setbox | ||
from PyQt5 import QtCore, QtGui, QtWidgets | ||
from PyQt5.QtCore import pyqtSignal | ||
|
||
class Setbox(QtWidgets.QMainWindow,Ui_Setbox): | ||
ChangeSize = pyqtSignal(float) | ||
def __init__(self,parent = None): | ||
super(Setbox,self).__init__(parent) | ||
self.setupUi(self) | ||
self.config = None | ||
self.Script = None | ||
# self.show() | ||
def init(self): | ||
self.Name_show.setText(self.config['Name']) | ||
self.Introduction_show.setPlainText(self.config['Description']) | ||
|
||
Setting = self.Script['Setting'] | ||
print(str(Setting['Change'])) | ||
self.ImgSize_text_percent.setText(str(Setting['Change'])) | ||
self.ImgSize_control.setValue(Setting['Change']*20) | ||
def ImgSize_control_valueChange(self): | ||
# Change 的值从0 - 5 | ||
Change = self.ImgSize_control.value()/20 | ||
self.ImgSize_text_percent.setText(str(Change)) | ||
self.ChangeSize.emit(Change) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from PyQt5 import QtGui, QtWidgets | ||
|
||
class TrayIcon(QtWidgets.QSystemTrayIcon): | ||
def __init__(self,parent = None): | ||
super(TrayIcon,self).__init__(parent) | ||
|
||
self.popMenu = QtWidgets.QMenu() | ||
self.MenuActions = {} | ||
self.popMenu.show() | ||
self.popMenu.setVisible(False) | ||
|
||
self.activated.connect(self.Click) | ||
|
||
def AddActions(self, name, job): | ||
self.MenuActions[name] = QtWidgets.QAction(name, self) | ||
self.MenuActions[name].triggered.connect(job) | ||
self.popMenu.addAction(self.MenuActions[name]) | ||
|
||
def Click(self): | ||
self.popMenu.move(QtGui.QCursor.pos()) | ||
self.popMenu.setVisible(True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Form implementation generated from reading ui file 'E:\Codes\独立项目\Cardinal\show\UI\Setbox.ui' | ||
# | ||
# Created by: PyQt5 UI code generator 5.14.2 | ||
# | ||
# WARNING! All changes made in this file will be lost! | ||
|
||
|
||
from PyQt5 import QtCore, QtGui, QtWidgets | ||
|
||
|
||
class Ui_Setbox(object): | ||
def setupUi(self, Setbox): | ||
Setbox.setObjectName("Setbox") | ||
Setbox.resize(800, 500) | ||
Setbox.setMinimumSize(QtCore.QSize(800, 500)) | ||
Setbox.setMaximumSize(QtCore.QSize(800, 500)) | ||
self.centralwidget = QtWidgets.QWidget(Setbox) | ||
self.centralwidget.setObjectName("centralwidget") | ||
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) | ||
self.gridLayout.setObjectName("gridLayout") | ||
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) | ||
self.tabWidget.setObjectName("tabWidget") | ||
self.tab = QtWidgets.QWidget() | ||
self.tab.setObjectName("tab") | ||
self.verticalLayout = QtWidgets.QVBoxLayout(self.tab) | ||
self.verticalLayout.setObjectName("verticalLayout") | ||
self.groupBox = QtWidgets.QGroupBox(self.tab) | ||
self.groupBox.setObjectName("groupBox") | ||
self.ImgSize_text = QtWidgets.QLabel(self.groupBox) | ||
self.ImgSize_text.setGeometry(QtCore.QRect(10, 20, 31, 21)) | ||
self.ImgSize_text.setObjectName("ImgSize_text") | ||
self.ImgSize_control = QtWidgets.QSlider(self.groupBox) | ||
self.ImgSize_control.setGeometry(QtCore.QRect(40, 20, 191, 22)) | ||
self.ImgSize_control.setMaximum(100) | ||
self.ImgSize_control.setPageStep(0) | ||
self.ImgSize_control.setProperty("value", 0) | ||
self.ImgSize_control.setSliderPosition(0) | ||
self.ImgSize_control.setOrientation(QtCore.Qt.Horizontal) | ||
self.ImgSize_control.setObjectName("ImgSize_control") | ||
self.ImgSize_text_percent = QtWidgets.QLabel(self.groupBox) | ||
self.ImgSize_text_percent.setGeometry(QtCore.QRect(240, 20, 31, 21)) | ||
self.ImgSize_text_percent.setObjectName("ImgSize_text_percent") | ||
self.verticalLayout.addWidget(self.groupBox) | ||
self.groupBox_2 = QtWidgets.QGroupBox(self.tab) | ||
self.groupBox_2.setObjectName("groupBox_2") | ||
self.Name_show = QtWidgets.QLineEdit(self.groupBox_2) | ||
self.Name_show.setGeometry(QtCore.QRect(40, 20, 241, 20)) | ||
self.Name_show.setObjectName("Name_show") | ||
self.Name_text = QtWidgets.QLabel(self.groupBox_2) | ||
self.Name_text.setGeometry(QtCore.QRect(10, 21, 31, 21)) | ||
self.Name_text.setObjectName("Name_text") | ||
self.Introduction_text = QtWidgets.QLabel(self.groupBox_2) | ||
self.Introduction_text.setGeometry(QtCore.QRect(10, 50, 31, 21)) | ||
self.Introduction_text.setObjectName("Introduction_text") | ||
self.Introduction_show = QtWidgets.QPlainTextEdit(self.groupBox_2) | ||
self.Introduction_show.setGeometry(QtCore.QRect(40, 50, 241, 91)) | ||
self.Introduction_show.setPlainText("") | ||
self.Introduction_show.setPlaceholderText("") | ||
self.Introduction_show.setObjectName("Introduction_show") | ||
self.verticalLayout.addWidget(self.groupBox_2) | ||
self.tabWidget.addTab(self.tab, "") | ||
self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) | ||
Setbox.setCentralWidget(self.centralwidget) | ||
self.menubar = QtWidgets.QMenuBar(Setbox) | ||
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23)) | ||
self.menubar.setObjectName("menubar") | ||
Setbox.setMenuBar(self.menubar) | ||
|
||
self.retranslateUi(Setbox) | ||
self.tabWidget.setCurrentIndex(0) | ||
self.ImgSize_control.valueChanged['int'].connect(Setbox.ImgSize_control_valueChange) | ||
QtCore.QMetaObject.connectSlotsByName(Setbox) | ||
|
||
def retranslateUi(self, Setbox): | ||
_translate = QtCore.QCoreApplication.translate | ||
Setbox.setWindowTitle(_translate("Setbox", "MainWindow")) | ||
self.groupBox.setTitle(_translate("Setbox", "显示")) | ||
self.ImgSize_text.setText(_translate("Setbox", "缩放")) | ||
self.ImgSize_text_percent.setText(_translate("Setbox", "0")) | ||
self.groupBox_2.setTitle(_translate("Setbox", "基本参数")) | ||
self.Name_text.setText(_translate("Setbox", "名称")) | ||
self.Introduction_text.setText(_translate("Setbox", "介绍")) | ||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Setbox", "基本参数")) |
Oops, something went wrong.