diff --git a/gui_app.py b/gui_app.py index 2e5bab7..970b6ec 100644 --- a/gui_app.py +++ b/gui_app.py @@ -1596,12 +1596,16 @@ class MainWindow(QMainWindow): """设置操作列按钮(编辑和删除)""" wrapper = QWidget() layout = QHBoxLayout(wrapper) - layout.setContentsMargins(4, 0, 4, 0) - layout.setSpacing(4) + layout.setContentsMargins(2, 0, 2, 0) + layout.setSpacing(2) edit_btn = PushButton("编辑") - edit_btn.setFixedWidth(50) + edit_btn.setFixedWidth(52) + edit_btn.setFixedHeight(32) + edit_btn.setFont(QFont("Microsoft YaHei", 10)) delete_btn = PushButton("删除") - delete_btn.setFixedWidth(50) + delete_btn.setFixedWidth(52) + delete_btn.setFixedHeight(32) + delete_btn.setFont(QFont("Microsoft YaHei", 10)) # 使用默认参数捕获当前值,避免闭包问题 edit_btn.clicked.connect(lambda checked, r=row, idx=config_index: self._enter_edit_mode(r, idx)) delete_btn.clicked.connect(lambda checked, idx=config_index: self.delete_row_by_index(idx)) @@ -1613,12 +1617,16 @@ class MainWindow(QMainWindow): """设置编辑模式按钮(确认和退出)""" wrapper = QWidget() layout = QHBoxLayout(wrapper) - layout.setContentsMargins(4, 0, 4, 0) - layout.setSpacing(4) + layout.setContentsMargins(2, 0, 2, 0) + layout.setSpacing(2) confirm_btn = PushButton("确认") - confirm_btn.setFixedWidth(50) + confirm_btn.setFixedWidth(52) + confirm_btn.setFixedHeight(32) + confirm_btn.setFont(QFont("Microsoft YaHei", 10)) cancel_btn = PushButton("退出") - cancel_btn.setFixedWidth(50) + cancel_btn.setFixedWidth(52) + cancel_btn.setFixedHeight(32) + cancel_btn.setFont(QFont("Microsoft YaHei", 10)) # 使用默认参数捕获当前值 confirm_btn.clicked.connect(lambda checked, r=row, idx=config_index: self._confirm_edit(r, idx)) cancel_btn.clicked.connect(lambda checked, r=row, idx=config_index: self._cancel_edit(r, idx))