Added gif & webp for RichtextEditor

* Added gif & webp for RichtextEditor picture attachments
* Attempt to fix attached picture layout issue on Card View
This commit is contained in:
defnax 2020-01-06 00:25:05 +01:00
parent 99aca410a9
commit b96fecfcbb
2 changed files with 10 additions and 20 deletions

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>614</width>
<height>160</height>
<height>182</height>
</rect>
</property>
<property name="windowTitle">
@ -462,19 +462,9 @@
<item row="4" column="1">
<widget class="QFrame" name="picture_frame">
<layout class="QHBoxLayout" name="horizontalPictureLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>219</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="pictureLabel">
<property name="text">
@ -507,16 +497,16 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="Posted_images.qrc"/>

View File

@ -585,7 +585,7 @@ void RichTextEdit::setText(const QString& text) {
void RichTextEdit::insertImage() {
QString file;
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg)", file)) {
if (misc::getOpenFileName(window(), RshareSettings::LASTDIR_IMAGES, tr("Load Picture File"), "Pictures (*.png *.xpm *.jpg *.jpeg *.gif *.webp)", file)) {
QString encodedImage;
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, MAX_ALLOWED_GXS_MESSAGE_SIZE - 200)) {
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);