Commit 7cb4f41a authored by Zheng Yile's avatar Zheng Yile
Browse files

Modify .gitignore, codiaclientgui/utils.py, main.py

parent a0366b48
......@@ -6,4 +6,7 @@ __pycache__/
**/.DS_Store
.idea/
*.sav
ui2py.bat
\ No newline at end of file
ui2py.bat
build/
dist/
*.spec
\ No newline at end of file
......@@ -14,8 +14,16 @@ Palette = {
"gray": QPalette(),
}
Font['main'].setFamily("Microsoft YaHei")
Font['main'].setPointSize(10)
import sys
if sys.platform == 'win32':
Font['main'].setFamily("Microsoft YaHei")
Font['main'].setPointSize(10)
elif sys.platform == 'darwin':
Font['main'].setFamily("Microsoft YaHei")
Font['main'].setPointSize(13)
else:
Font['main'].setFamily("Microsoft YaHei")
Font['main'].setPointSize(13)
Font['status'].setFamily("SimHei")
greenBrush = QBrush(QColor(80, 160, 30))
......
......@@ -233,24 +233,8 @@ def PasswordStoreRead():
except:
QMessageBox.critical(None, "错误", "缓存文件损坏", QMessageBox.Ok)
def ConfigInit():
screen = app.screens()[0]
Desktop = QApplication.desktop()
width = Desktop.width()
height = Desktop.height()
dpi = screen.physicalDotsPerInch()
from math import sqrt
print(sqrt(width * width + height * height) / dpi)
from codiaclientgui.utils import Font
Font["main"].setFamily("Microsoft YaHei")
if dpi >= 140: Font["main"].setPointSize(10)
elif dpi >= 120: Font["main"].setPointSize(13)
else: Font["main"].setPointSize(15)
print(dpi)
if __name__ == "__main__":
app = QApplication(sys.argv)
ConfigInit()
LoginWindow = QMainWindow()
LoginUi = loginWindow.Ui_loginWindow()
LoginUi.setupUi(LoginWindow)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment