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

View file

@ -585,7 +585,7 @@ void RichTextEdit::setText(const QString& text) {
void RichTextEdit::insertImage() { void RichTextEdit::insertImage() {
QString file; 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; QString encodedImage;
if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, MAX_ALLOWED_GXS_MESSAGE_SIZE - 200)) { if (RsHtml::makeEmbeddedImage(file, encodedImage, 640*480, MAX_ALLOWED_GXS_MESSAGE_SIZE - 200)) {
QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage); QTextDocumentFragment fragment = QTextDocumentFragment::fromHtml(encodedImage);