修复:
- 登录弹窗表单改为按内容高度垂直居中(外层容器对齐),消除输入框之间及上下的拉伸留白;行距收紧到 6px、窗口高度降到 170
This commit is contained in:
+6
-4
@@ -1123,7 +1123,7 @@ class LoginDialog(QDialog):
|
||||
super().__init__(parent)
|
||||
self.setWindowTitle("节点配置登录")
|
||||
self.setWindowIcon(load_icon())
|
||||
self.setFixedSize(420, 210)
|
||||
self.setFixedSize(420, 170)
|
||||
self.setStyleSheet(f"""
|
||||
QDialog {{ background-color: {C_BG}; }}
|
||||
QLabel {{ color: {C_TEXT}; font-family: "Microsoft YaHei", "Segoe UI", sans-serif; font-size: 12px; }}
|
||||
@@ -1169,9 +1169,9 @@ class LoginDialog(QDialog):
|
||||
left.addStretch()
|
||||
root.addLayout(left)
|
||||
|
||||
# 右侧表单
|
||||
# 右侧表单(外层容器按内容高度垂直居中,避免被横向布局拉伸出大段留白)
|
||||
form = QVBoxLayout()
|
||||
form.setSpacing(8)
|
||||
form.setSpacing(6)
|
||||
self.ed_user = QLineEdit()
|
||||
self.ed_user.setPlaceholderText("登录名")
|
||||
form.addWidget(self.ed_user)
|
||||
@@ -1203,7 +1203,9 @@ class LoginDialog(QDialog):
|
||||
self.btn_ok.clicked.connect(self._submit)
|
||||
bottom.addWidget(self.btn_ok)
|
||||
form.addLayout(bottom)
|
||||
root.addLayout(form, 1)
|
||||
box = QWidget()
|
||||
box.setLayout(form)
|
||||
root.addWidget(box, 1, Qt.AlignVCenter)
|
||||
|
||||
self._done.connect(self._on_done)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user