fix: 让任务关键词框自适应宽度 (#4)

This commit is contained in:
chengma
2026-08-06 15:40:02 +08:00
parent 665eddb7b5
commit ecc9d47c35
+5 -1
View File
@@ -36,6 +36,7 @@ from PyQt5.QtWidgets import (
QHeaderView,
QHBoxLayout,
QShortcut,
QSizePolicy,
QVBoxLayout,
QWidget,
)
@@ -344,7 +345,9 @@ class PDDTaskPage(QWidget):
self.keywordInput = SearchLineEdit(self)
self.keywordInput.setPlaceholderText("任务编号、商品编号或商品标题")
self.keywordInput.setClearButtonEnabled(True)
self.keywordInput.setFixedWidth(190)
self.keywordInput.setMinimumWidth(190)
self.keywordInput.setMaximumWidth(480)
self.keywordInput.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.keywordInput.setAccessibleName("任务关键词")
self.searchButton = PushButton(FIF.SEARCH, "搜索", self)
@@ -365,6 +368,7 @@ class PDDTaskPage(QWidget):
commandLayout.addWidget(CaptionLabel("关键词", self.commandCard), 0, 5)
commandLayout.addWidget(self.keywordInput, 0, 6)
commandLayout.addWidget(self.searchButton, 0, 7)
commandLayout.setColumnStretch(6, 4)
commandLayout.setColumnStretch(8, 1)
commandLayout.addWidget(self.refreshButton, 0, 9)