This commit is contained in:
Jeffreytsai1004 2025-02-10 01:43:59 +08:00
parent 9ca94c974d
commit 45ea47e336
2 changed files with 9 additions and 11 deletions

View File

@ -19,8 +19,8 @@ class MetaFusion(QtWidgets.QMainWindow):
# === 设置窗口属性 === # === 设置窗口属性 ===
self.setWindowTitle(f"{config.TOOL_NAME} {config.TOOL_VERSION}") self.setWindowTitle(f"{config.TOOL_NAME} {config.TOOL_VERSION}")
# 设置初始大小和最小大小 # 设置初始大小和最小大小
self.resize(550, 750) # 初始大小 self.resize(550, 800) # 初始大小
self.setMinimumSize(550, 750) # 最小大小限制 self.setMinimumSize(550, 800) # 最小大小限制
# === 创建中心部件 === # === 创建中心部件 ===
self.central_widget = QtWidgets.QWidget() self.central_widget = QtWidgets.QWidget()

View File

@ -238,18 +238,18 @@ class MeshesTab(QtWidgets.QWidget):
item = QtWidgets.QWidget() item = QtWidgets.QWidget()
layout = QtWidgets.QHBoxLayout(item) layout = QtWidgets.QHBoxLayout(item)
layout.setContentsMargins(4, 1, 4, 1) # 减小上下边距 layout.setContentsMargins(4, 1, 4, 1) # 减小上下边距
layout.setSpacing(4) # 减小间距 layout.setSpacing(4) # 保持主布局间距
# 左侧容器(标签和输入框) # 左侧容器(标签和输入框)
left_container = QtWidgets.QWidget() left_container = QtWidgets.QWidget()
left_layout = QtWidgets.QHBoxLayout(left_container) left_layout = QtWidgets.QHBoxLayout(left_container)
left_layout.setContentsMargins(0, 0, 0, 0) left_layout.setContentsMargins(0, 0, 0, 0)
left_layout.setSpacing(4) # 减小标签和输入框的间距 left_layout.setSpacing(1) # 将标签和输入框的间距减到最小
# 网格名称标签 # 网格名称标签
name_label = QtWidgets.QLabel(mesh_name) name_label = QtWidgets.QLabel(mesh_name)
name_label.setFixedWidth(70) # 减小标签宽度 name_label.setFixedWidth(60) # 调整标签宽度
name_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) # 左对齐 name_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) # 保持左对齐
# 网格路径输入框 - 可编辑 # 网格路径输入框 - 可编辑
path_edit = QtWidgets.QLineEdit() path_edit = QtWidgets.QLineEdit()
@ -266,8 +266,8 @@ class MeshesTab(QtWidgets.QWidget):
add_btn.setFixedSize(22, 22) add_btn.setFixedSize(22, 22)
# 添加到主布局 # 添加到主布局
layout.addWidget(left_container, stretch=1) # 左侧容器占据所有可用空间 layout.addWidget(left_container, stretch=1)
layout.addWidget(add_btn) # 按钮右对齐 layout.addWidget(add_btn)
# 设置样式 # 设置样式
item.setStyleSheet(""" item.setStyleSheet("""
@ -277,6 +277,7 @@ class MeshesTab(QtWidgets.QWidget):
QLabel { QLabel {
color: #CCCCCC; color: #CCCCCC;
font-size: 12px; font-size: 12px;
padding-right: 0px; # 移除标签右边距
} }
QLineEdit { QLineEdit {
background: #3D3D3D; background: #3D3D3D;
@ -307,9 +308,6 @@ class MeshesTab(QtWidgets.QWidget):
} }
""") """)
# 设置大小策略
item.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
return item return item
def _create_tool_button(self, text, icon_name, fallback_icon=None): def _create_tool_button(self, text, icon_name, fallback_icon=None):