fix: adjust outfit detail table widths
This commit is contained in:
@@ -591,12 +591,26 @@ class AiOutfitPanel(QWidget):
|
||||
self._table.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
||||
self._table.setSelectionBehavior(QAbstractItemView.SelectRows)
|
||||
self._table.verticalHeader().setVisible(False)
|
||||
header = self._table.horizontalHeader()
|
||||
header.setSectionResizeMode(1, QHeaderView.Stretch)
|
||||
header.setSectionResizeMode(5, QHeaderView.Stretch)
|
||||
self._configure_detail_table_columns()
|
||||
col.addWidget(self._table, stretch=1)
|
||||
return wrap
|
||||
|
||||
def _configure_detail_table_columns(self):
|
||||
"""Give title most table space; keep short fields compact."""
|
||||
header = self._table.horizontalHeader()
|
||||
header.setStretchLastSection(False)
|
||||
widths = {
|
||||
0: 46, # 行
|
||||
2: 88, # 货号
|
||||
3: 150, # 衣服图
|
||||
4: 76, # 状态
|
||||
5: 220, # 结果 / 原因
|
||||
}
|
||||
for col, width in widths.items():
|
||||
header.setSectionResizeMode(col, QHeaderView.Fixed if col in (0, 2, 4) else QHeaderView.Interactive)
|
||||
self._table.setColumnWidth(col, width)
|
||||
header.setSectionResizeMode(1, QHeaderView.Stretch)
|
||||
|
||||
def _build_right(self):
|
||||
wrap = QWidget()
|
||||
wrap.setMinimumWidth(360)
|
||||
|
||||
Reference in New Issue
Block a user