mirror of
https://gitlab.com/comunic/comunicmessages
synced 2025-06-20 08:55:17 +00:00
Display conversation images
This commit is contained in:
@ -21,4 +21,14 @@ void ConversationMessageWidget::setMessage(const ConversationMessage &message, c
|
||||
ui->nameLabel->setText(user.displayName());
|
||||
ui->messageLabel->setText(message.message());
|
||||
ImageLoadHelper::Load(ui->accountImageLabel, user.accountImage());
|
||||
|
||||
//Add message image (if any)
|
||||
if(message.hasImage()){
|
||||
QLabel *label = new QLabel;
|
||||
label->setParent(ui->messageContentContainer);
|
||||
label->setScaledContents(true);
|
||||
label->setMaximumSize(200, 200);
|
||||
ui->messageLayout->addWidget(label);
|
||||
ImageLoadHelper::Load(label, message.imagePath());
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>183</width>
|
||||
<height>35</height>
|
||||
<width>227</width>
|
||||
<height>53</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -53,22 +53,34 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="messageLabel">
|
||||
<widget class="QWidget" name="messageContentContainer" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Message content</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="messageLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="messageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Message content</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
Reference in New Issue
Block a user