Added new flags to the html optimizer to remove font and color from html and used this for displaying the message in the toaster.

Fixed layout of the toasters.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5068 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-03-31 15:20:19 +00:00
parent 5b5d5b5c43
commit 25a266bcbf
9 changed files with 125 additions and 67 deletions

View file

@ -36,7 +36,9 @@ ChatLobbyToaster::ChatLobbyToaster(const std::string &peerId, const QString &nam
connect(ui.closeButton, SIGNAL(clicked()), SLOT(hide()));
/* set informations */
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE));
ui.avatarWidget->setFrameType(AvatarWidget::NORMAL_FRAME);
ui.avatarWidget->setDefaultAvatar(":images/user/agt_forum64.png");
QString lobbyName = name;

View file

@ -32,7 +32,7 @@
<item>
<widget class="QFrame" name="windowFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::WinPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@ -131,6 +131,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
@ -143,8 +149,11 @@
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="spacing">
<number>0</number>
<number>2</number>
</property>
<item row="0" column="1">
<widget class="QPushButton" name="chatButton">
@ -160,8 +169,8 @@
<widget class="QLabel" name="messageLabel">
<property name="maximumSize">
<size>
<width>220</width>
<height>47</height>
<width>218</width>
<height>45</height>
</size>
</property>
<property name="wordWrap">
@ -170,7 +179,7 @@
</widget>
</item>
<item row="0" column="0" rowspan="3">
<widget class="QLabel" name="avatar">
<widget class="AvatarWidget" name="avatarWidget" native="true">
<property name="minimumSize">
<size>
<width>70</width>
@ -183,15 +192,6 @@
<height>70</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/user/agt_forum64.png</pixmap>
</property>
</widget>
</item>
</layout>
@ -201,6 +201,14 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>AvatarWidget</class>
<extends>QWidget</extends>
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
</resources>

View file

@ -36,7 +36,7 @@ ChatToaster::ChatToaster(const std::string &peerId, const QString &message) : QW
connect(ui.closeButton, SIGNAL(clicked()), SLOT(hide()));
/* set informations */
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE));
ui.nameLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str()));
ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatarWidget->setId(peerId, false);

View file

@ -32,7 +32,7 @@
<item>
<widget class="QFrame" name="windowFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::WinPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@ -92,6 +92,12 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
@ -144,7 +150,7 @@
<number>4</number>
</property>
<property name="spacing">
<number>0</number>
<number>2</number>
</property>
<item row="0" column="1">
<widget class="QPushButton" name="chatButton">
@ -160,8 +166,8 @@
<widget class="QLabel" name="messageLabel">
<property name="maximumSize">
<size>
<width>220</width>
<height>47</height>
<width>218</width>
<height>45</height>
</size>
</property>
<property name="wordWrap">

View file

@ -34,7 +34,7 @@ GroupChatToaster::GroupChatToaster(const std::string &peerId, const QString &mes
connect(ui.closeButton, SIGNAL(clicked()), SLOT(hide()));
/* set informations */
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
ui.messageLabel->setText(RsHtml::formatText(message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE));
ui.nameLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str()));
ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME);
ui.avatarWidget->setDefaultAvatar(":/images/user/personal64.png");

View file

@ -32,7 +32,7 @@
<item>
<widget class="QFrame" name="windowFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
<enum>QFrame::WinPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@ -149,8 +149,14 @@
<property name="rightMargin">
<number>4</number>
</property>
<property name="spacing">
<number>0</number>
<property name="bottomMargin">
<number>4</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="0" rowspan="3">
<widget class="AvatarWidget" name="avatarWidget" native="true">
@ -172,8 +178,8 @@
<widget class="QLabel" name="messageLabel">
<property name="maximumSize">
<size>
<width>220</width>
<height>47</height>
<width>218</width>
<height>45</height>
</size>
</property>
<property name="wordWrap">

View file

@ -10,17 +10,23 @@
<height>100</height>
</rect>
</property>
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>100</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="windowFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
<enum>QFrame::WinPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
@ -86,12 +92,6 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>22</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
@ -209,19 +209,6 @@
</item>
</layout>
</item>
<item row="2" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>