-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.py
64 lines (54 loc) · 1.93 KB
/
home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# coding:utf-8
from PyQt5.QtWidgets import (
QWidget,
)
from PyQt5.QtCore import Qt, QRectF
from PyQt5.QtGui import (
QPixmap,
QPainter,
QPainterPath,
QColor,
QBrush,
QPen,
)
from ui.home_ui import Ui_Home
from qfluentwidgets import isDarkTheme
from script import Call
ConfigPath = "setting/YuanShenEx.json"
Config = {
"Path": {"launcherPath": "", "gamePath": ""},
"Account": {
"BFu": [{"name": "默认", "path": ""}],
"GuanFu": [{"name": "默认", "path": ""}],
},
}
class Home(Ui_Home, QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setupUi(self)
self.Select_Mode_ComboBox.addItems(["启动官服", "启动B服"])
self.Select_Pass_ComboBox.addItems(["添加账号", "暂时还没开发出来捏"])
# self.Start_PushButton.clicked.connect(lambda: Call.Start(self))
def paintEvent(self, e):
super().paintEvent(e)
painter = QPainter(self)
self.banner = QPixmap("./rescourse/background.png")
painter.setRenderHints(QPainter.SmoothPixmapTransform | QPainter.Antialiasing)
painter.setPen(Qt.NoPen)
path = QPainterPath()
path.setFillRule(Qt.WindingFill)
w, h, r = self.width(), self.height(), 50
path.addRect(QRectF(w - 50, r, 50, 50))
path.addRect(QRectF(0, h - 50, 50, 50))
if not isDarkTheme():
pen = QPen(QColor(163, 168, 168), 2, Qt.SolidLine)
painter.setPen(pen)
else:
pen = QPen(QColor(0, 0, 0), 2, Qt.SolidLine)
painter.setPen(pen)
painter.drawRoundedRect(QRectF(1, r, w, h - r), 15, 15)
pixmap = self.banner.scaled(self.size(), transformMode=Qt.SmoothTransformation)
path.addRoundedRect(QRectF(2, r, w, self.height() - r), 15, 15)
painter.fillPath(path, QBrush(pixmap))
painter.drawLine(1, h - r, 1, h)
painter.drawLine(w - r, r, w, r)