Skip to content

Commit e878ce2

Browse files
authored
ui(qchat): set a fixed image chat message item value (#221)
1 parent 87ede82 commit e878ce2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qtribu/gui/qchat_tree_widget_items.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
AUTHOR_COLUM = 1
4040
MESSAGE_COLUMN = 2
4141

42+
MAX_IMAGE_ITEM_HEIGHT = 24
43+
4244

4345
class QChatTreeWidgetItem(QTreeWidgetItem):
4446
"""
@@ -179,8 +181,8 @@ def __init__(self, parent: QTreeWidget, message: QChatImageMessage):
179181
self.pixmap.loadFromData(data)
180182
label = QLabel(self.parent())
181183
label.setPixmap(self.pixmap)
184+
label.setMaximumSize(label.sizeHint().width(), MAX_IMAGE_ITEM_HEIGHT)
182185
self.treeWidget().setItemWidget(self, MESSAGE_COLUMN, label)
183-
self.setSizeHint(MESSAGE_COLUMN, self.pixmap.size())
184186

185187
def on_click(self, column: int) -> None:
186188
if column == MESSAGE_COLUMN:

0 commit comments

Comments
 (0)