Merge pull request #891 from PhenomRetroShare/Fix_MessageToHeight

Fix To, Cc & Bcc height in MessageWidget.
This commit is contained in:
csoler 2017-06-21 18:32:51 +02:00 committed by GitHub
commit 8cc82f9d85
2 changed files with 219 additions and 211 deletions

View File

@ -135,7 +135,7 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags f
connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview())); connect(ui.expandFilesButton, SIGNAL(clicked()), this, SLOT(togglefileview()));
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended())); connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(getallrecommended()));
connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(ui.msgText, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl)));
connect(ui.sendinviteButton, SIGNAL(clicked()), this, SLOT(sendInvite())); connect(ui.sendInviteButton, SIGNAL(clicked()), this, SLOT(sendInvite()));
connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged())); connect(NotifyQt::getInstance(), SIGNAL(messagesTagsChanged()), this, SLOT(messagesTagsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged())); connect(NotifyQt::getInstance(), SIGNAL(messagesChanged()), this, SLOT(messagesChanged()));
@ -160,10 +160,13 @@ MessageWidget::MessageWidget(bool controlled, QWidget *parent, Qt::WindowFlags f
QFont font = QFont("Arial", 10, QFont::Bold); QFont font = QFont("Arial", 10, QFont::Bold);
ui.subjectText->setFont(font); ui.subjectText->setFont(font);
ui.bcclabel->setVisible(false); ui.toText->setMaximumHeight(ui.toText->fontMetrics().lineSpacing()*1.5);
ui.bccText->setVisible(false); ui.ccLabel->setVisible(false);
ui.cclabel->setVisible(false);
ui.ccText->setVisible(false); ui.ccText->setVisible(false);
ui.ccText->setMaximumHeight(ui.ccText->fontMetrics().lineSpacing()*1.5);
ui.bccLabel->setVisible(false);
ui.bccText->setVisible(false);
ui.bccText->setMaximumHeight(ui.bccText->fontMetrics().lineSpacing()*1.5);
ui.tagsLabel->setVisible(false); ui.tagsLabel->setVisible(false);
@ -454,11 +457,11 @@ void MessageWidget::fill(const std::string &msgId)
ui.fromText->setText(""); ui.fromText->setText("");
ui.filesText->setText(""); ui.filesText->setText("");
ui.cclabel->setVisible(false); ui.ccLabel->setVisible(false);
ui.ccText->setVisible(false); ui.ccText->setVisible(false);
ui.ccText->clear(); ui.ccText->clear();
ui.bcclabel->setVisible(false); ui.bccLabel->setVisible(false);
ui.bccText->setVisible(false); ui.bccText->setVisible(false);
ui.bccText->clear(); ui.bccText->clear();
@ -519,7 +522,7 @@ void MessageWidget::fill(const std::string &msgId)
if (!msgInfo.rspeerid_msgcc.empty() || !msgInfo.rsgxsid_msgcc.empty()) if (!msgInfo.rspeerid_msgcc.empty() || !msgInfo.rsgxsid_msgcc.empty())
{ {
ui.cclabel->setVisible(true); ui.ccLabel->setVisible(true);
ui.ccText->setVisible(true); ui.ccText->setVisible(true);
text.clear(); text.clear();
@ -528,14 +531,14 @@ void MessageWidget::fill(const std::string &msgId)
ui.ccText->setText(text); ui.ccText->setText(text);
} else { } else {
ui.cclabel->setVisible(false); ui.ccLabel->setVisible(false);
ui.ccText->setVisible(false); ui.ccText->setVisible(false);
ui.ccText->clear(); ui.ccText->clear();
} }
if (!msgInfo.rspeerid_msgbcc.empty() || !msgInfo.rsgxsid_msgbcc.empty()) if (!msgInfo.rspeerid_msgbcc.empty() || !msgInfo.rsgxsid_msgbcc.empty())
{ {
ui.bcclabel->setVisible(true); ui.bccLabel->setVisible(true);
ui.bccText->setVisible(true); ui.bccText->setVisible(true);
text.clear(); text.clear();
@ -544,7 +547,7 @@ void MessageWidget::fill(const std::string &msgId)
ui.bccText->setText(text); ui.bccText->setText(text);
} else { } else {
ui.bcclabel->setVisible(false); ui.bccLabel->setVisible(false);
ui.bccText->setVisible(false); ui.bccText->setVisible(false);
ui.bccText->clear(); ui.bccText->clear();
} }

View File

@ -10,7 +10,7 @@
<height>539</height> <height>539</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QHBoxLayout" name="MessageWidgetHLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -23,36 +23,28 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item>
<widget class="QSplitter" name="mainSplitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="msgSplitter"> <widget class="QSplitter" name="msgSplitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QSplitter" name="msgSplitter_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="msgSplitterVLayout">
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="_4"> <layout class="QGridLayout" name="msgSplitterGLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin"> <property name="rightMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="_5">
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>6</number> <number>6</number>
</property> </property>
@ -60,7 +52,7 @@
<number>3</number> <number>3</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="subjectlabel"> <widget class="QLabel" name="subjectLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -75,8 +67,50 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" colspan="2">
<layout class="QHBoxLayout" name="subjectHLayout">
<item>
<widget class="QLabel" name="subjectText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateText">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string notr="true">Date</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="fromlabel"> <widget class="QLabel" name="fromLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -120,7 +154,7 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="tolabel"> <widget class="QLabel" name="toLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -136,9 +170,18 @@
</widget> </widget>
</item> </item>
<item row="2" column="2" colspan="2"> <item row="2" column="2" colspan="2">
<widget class="QLabel" name="toText"> <widget class="RSTextBrowser" name="toText">
<property name="wordWrap"> <property name="sizePolicy">
<bool>true</bool> <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property> </property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
@ -146,7 +189,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="cclabel"> <widget class="QLabel" name="ccLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -164,8 +207,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2" colspan="2">
<widget class="RSTextBrowser" name="ccText">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="bcclabel"> <widget class="QLabel" name="bccLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -180,20 +236,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2" colspan="2">
<widget class="QLabel" name="ccText">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2"> <item row="4" column="2" colspan="2">
<widget class="QLabel" name="bccText"> <widget class="RSTextBrowser" name="bccText">
<property name="wordWrap"> <property name="maximumSize">
<bool>true</bool> <size>
<width>16777215</width>
<height>16</height>
</size>
</property> </property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
@ -219,50 +268,6 @@
<item row="5" column="2" colspan="2"> <item row="5" column="2" colspan="2">
<layout class="QHBoxLayout" name="tagLayout"/> <layout class="QHBoxLayout" name="tagLayout"/>
</item> </item>
<item row="0" column="2" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="subjectText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dateText">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string notr="true">Date</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -403,14 +408,14 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="sendinviteButton"> <widget class="QPushButton" name="sendInviteButton">
<property name="text"> <property name="text">
<string>Send Invite</string> <string>Send Invite</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="inviteHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -426,9 +431,9 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="_2"> <layout class="QHBoxLayout" name="filesHLayout">
<item> <item>
<layout class="QGridLayout" name="_3"> <layout class="QGridLayout" name="filesGLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -445,7 +450,7 @@
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="attLabel">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -455,7 +460,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="0" column="4">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="recFilesLabel">
<property name="text"> <property name="text">
<string>Recommended Files</string> <string>Recommended Files</string>
</property> </property>
@ -498,7 +503,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<spacer> <spacer name="filesHSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>