界面优化: 简化UI设计和布局 1. 界面布局优化 - 移除多余的框架,使用分隔线代替 - 统一输入框和文本框样式 - 优化整体边距和间距 2. 视觉效果改进 - 添加渐变背景 - 保留重要信息的视觉强调 - 简化界面层次结构 3. 其他改进 - 优化使用说明的显示效果 - 更新版本截图
This commit is contained in:
BIN
banbenjietu.png
Normal file
BIN
banbenjietu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -167,42 +167,93 @@ class MainWindow(QMainWindow):
|
|||||||
central_widget = QWidget()
|
central_widget = QWidget()
|
||||||
self.setCentralWidget(central_widget)
|
self.setCentralWidget(central_widget)
|
||||||
|
|
||||||
|
# 设置主窗口样式
|
||||||
|
central_widget.setStyleSheet("""
|
||||||
|
QWidget {
|
||||||
|
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||||
|
stop:0 #f8f9fa,
|
||||||
|
stop:0.5 #ffffff,
|
||||||
|
stop:1 #f8f9fa);
|
||||||
|
}
|
||||||
|
QLabel {
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
QLineEdit {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 5px;
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
QTextEdit {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 5px;
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
""")
|
||||||
|
|
||||||
# 创建主布局
|
# 创建主布局
|
||||||
main_layout = QVBoxLayout(central_widget)
|
main_layout = QVBoxLayout(central_widget)
|
||||||
|
main_layout.setSpacing(15)
|
||||||
|
main_layout.setContentsMargins(30, 30, 30, 30)
|
||||||
|
|
||||||
# 设备ID区域
|
# 设备ID区域
|
||||||
device_frame = QFrame()
|
device_layout = QHBoxLayout()
|
||||||
device_layout = QHBoxLayout(device_frame)
|
|
||||||
device_layout.addWidget(QLabel("设备识别码(勿动):"))
|
device_layout.addWidget(QLabel("设备识别码(勿动):"))
|
||||||
self.hardware_id_edit = QLineEdit(self.switcher.hardware_id)
|
self.hardware_id_edit = QLineEdit(self.switcher.hardware_id)
|
||||||
self.hardware_id_edit.setReadOnly(True)
|
self.hardware_id_edit.setReadOnly(True)
|
||||||
device_layout.addWidget(self.hardware_id_edit)
|
device_layout.addWidget(self.hardware_id_edit)
|
||||||
|
|
||||||
copy_btn = QPushButton("复制ID")
|
copy_btn = QPushButton("复制ID")
|
||||||
|
copy_btn.setStyleSheet("""
|
||||||
|
QPushButton {
|
||||||
|
background-color: #6c757d;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 5px 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #5a6268;
|
||||||
|
}
|
||||||
|
""")
|
||||||
copy_btn.clicked.connect(self.copy_device_id)
|
copy_btn.clicked.connect(self.copy_device_id)
|
||||||
device_layout.addWidget(copy_btn)
|
device_layout.addWidget(copy_btn)
|
||||||
main_layout.addWidget(device_frame)
|
main_layout.addLayout(device_layout)
|
||||||
|
|
||||||
|
# 添加分隔线
|
||||||
|
line = QFrame()
|
||||||
|
line.setFrameShape(QFrame.HLine)
|
||||||
|
line.setStyleSheet("background-color: #e9ecef;")
|
||||||
|
main_layout.addWidget(line)
|
||||||
|
|
||||||
# 会员状态区域
|
# 会员状态区域
|
||||||
status_frame = QFrame()
|
status_label = QLabel("会员状态")
|
||||||
status_layout = QVBoxLayout(status_frame)
|
status_label.setStyleSheet("font-weight: bold; margin-top: 10px;")
|
||||||
status_layout.addWidget(QLabel("会员状态"))
|
main_layout.addWidget(status_label)
|
||||||
|
|
||||||
self.status_text = QTextEdit()
|
self.status_text = QTextEdit()
|
||||||
self.status_text.setReadOnly(True)
|
self.status_text.setReadOnly(True)
|
||||||
self.status_text.setMinimumHeight(100)
|
self.status_text.setMinimumHeight(100)
|
||||||
status_layout.addWidget(self.status_text)
|
main_layout.addWidget(self.status_text)
|
||||||
main_layout.addWidget(status_frame)
|
|
||||||
|
# 添加分隔线
|
||||||
|
line2 = QFrame()
|
||||||
|
line2.setFrameShape(QFrame.HLine)
|
||||||
|
line2.setStyleSheet("background-color: #e9ecef;")
|
||||||
|
main_layout.addWidget(line2)
|
||||||
|
|
||||||
# 激活区域
|
# 激活区域
|
||||||
activation_frame = QFrame()
|
main_layout.addWidget(QLabel("激活(叠加)会员,多个激活码可叠加整体时长"))
|
||||||
activation_layout = QVBoxLayout(activation_frame)
|
|
||||||
|
|
||||||
# 激活码输入区域
|
# 激活码输入区域
|
||||||
activation_layout.addWidget(QLabel("激活(叠加)会员,多个激活码可叠加整体时长"))
|
input_layout = QHBoxLayout()
|
||||||
input_frame = QFrame()
|
|
||||||
input_layout = QHBoxLayout(input_frame)
|
|
||||||
input_layout.addWidget(QLabel("激活码:"))
|
input_layout.addWidget(QLabel("激活码:"))
|
||||||
self.activation_edit = QLineEdit()
|
self.activation_edit = QLineEdit()
|
||||||
input_layout.addWidget(self.activation_edit)
|
input_layout.addWidget(self.activation_edit)
|
||||||
|
|
||||||
activate_btn = QPushButton("激活")
|
activate_btn = QPushButton("激活")
|
||||||
activate_btn.setStyleSheet("""
|
activate_btn.setStyleSheet("""
|
||||||
QPushButton {
|
QPushButton {
|
||||||
@@ -223,34 +274,40 @@ class MainWindow(QMainWindow):
|
|||||||
""")
|
""")
|
||||||
activate_btn.clicked.connect(self.activate_account)
|
activate_btn.clicked.connect(self.activate_account)
|
||||||
input_layout.addWidget(activate_btn)
|
input_layout.addWidget(activate_btn)
|
||||||
activation_layout.addWidget(input_frame)
|
main_layout.addLayout(input_layout)
|
||||||
main_layout.addWidget(activation_frame)
|
|
||||||
|
|
||||||
# 使用说明
|
# 使用说明
|
||||||
usage_label = QLabel()
|
usage_label = QLabel()
|
||||||
usage_text = (
|
usage_text = (
|
||||||
"<p style='margin-bottom: 10px;'><b style='color: #0d6efd;'>使用步骤:</b></p>"
|
"<div style='background-color: #f8f9fa; padding: 15px; border-radius: 8px; border: 2px solid #0d6efd;'>"
|
||||||
"<p style='line-height: 1.5;'>"
|
"<p style='margin-bottom: 15px; font-size: 15px;'><b style='color: #0d6efd;'>使用步骤说明:</b></p>"
|
||||||
"1. <span style='color: #0d6efd;'>第一步:</span>输入激活码并点击<span style='color: #0d6efd;'>【激活】</span>按钮<br>"
|
"<p style='line-height: 2.0;'>"
|
||||||
"2. <span style='color: #198754;'>第二步:</span>激活成功后点击<span style='color: #198754;'>【刷新Cursor编辑器授权】</span>即可正常使用<br>"
|
"<span style='font-size: 14px; color: #dc3545;'><b>第一步:</b></span> "
|
||||||
"3. <span style='color: #dc3545;'>如果刷新无效:</span>请先点击<span style='color: #198754;'>【突破Cursor0.45.x限制】</span>,然后再点击刷新<br>"
|
"输入激活码点击<b style='color: #0d6efd;'>【激活】</b>按钮完成激活<br>"
|
||||||
"4. <span style='color: #6c757d;'>建议操作:</span>点击<span style='color: #dc3545;'>【禁用Cursor版本更新】</span>保持长期稳定"
|
|
||||||
|
"<span style='font-size: 14px; color: #198754;'><b>第二步:</b></span> "
|
||||||
|
"点击<b style='color: #0d6efd;'>【刷新Cursor编辑器授权】</b>,<span style='color: #198754;'>一般情况下刷新即可正常使用</span><br>"
|
||||||
|
|
||||||
|
"<span style='font-size: 14px; color: #fd7e14;'><b>如果无法对话:</b></span> "
|
||||||
|
"点击<b style='color: #198754;'>【突破Cursor0.45.x限制】</b>,然后重新刷新授权<br>"
|
||||||
|
|
||||||
|
"<span style='font-size: 14px; color: #6c757d;'><b>建议操作:</b></span> "
|
||||||
|
"点击<b style='color: #dc3545;'>【禁用Cursor版本更新】</b>,<span style='color: #6c757d;'>保持软件稳定运行</span>"
|
||||||
"</p>"
|
"</p>"
|
||||||
|
"</div>"
|
||||||
)
|
)
|
||||||
usage_label.setText(usage_text)
|
usage_label.setText(usage_text)
|
||||||
usage_label.setStyleSheet("""
|
usage_label.setStyleSheet("""
|
||||||
QLabel {
|
QLabel {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
padding: 15px;
|
padding: 0px;
|
||||||
background-color: #f8f9fa;
|
margin: 10px 0;
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid #dee2e6;
|
|
||||||
}
|
}
|
||||||
""")
|
""")
|
||||||
usage_label.setTextFormat(Qt.RichText)
|
usage_label.setTextFormat(Qt.RichText)
|
||||||
usage_label.setWordWrap(True)
|
usage_label.setWordWrap(True)
|
||||||
activation_layout.addWidget(usage_label)
|
main_layout.addWidget(usage_label)
|
||||||
|
|
||||||
# 操作按钮区域
|
# 操作按钮区域
|
||||||
btn_frame = QFrame()
|
btn_frame = QFrame()
|
||||||
|
|||||||
Reference in New Issue
Block a user