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,246 +23,251 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item>
<widget class="QSplitter" name="msgSplitter"> <widget class="QSplitter" name="mainSplitter">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="QSplitter" name="msgSplitter_2"> <widget class="QSplitter" name="msgSplitter">
<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"> <property name="horizontalSpacing">
<number>0</number> <number>6</number>
</property> </property>
<item> <property name="verticalSpacing">
<layout class="QGridLayout" name="_5"> <number>3</number>
<property name="horizontalSpacing"> </property>
<number>6</number> <item row="0" column="0">
<widget class="QLabel" name="subjectLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="verticalSpacing"> <property name="text">
<number>3</number> <string>Subject:</string>
</property> </property>
<item row="0" column="0"> <property name="alignment">
<widget class="QLabel" name="subjectlabel"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="sizePolicy"> </property>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> </widget>
<horstretch>0</horstretch> </item>
<verstretch>0</verstretch> <item row="0" column="2" colspan="2">
</sizepolicy> <layout class="QHBoxLayout" name="subjectHLayout">
</property> <item>
<property name="text"> <widget class="QLabel" name="subjectText">
<string>Subject:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="fromlabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>From:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLabel" name="fromText">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="tolabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text">
<string>To:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="toText">
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="openExternalLinks"> <property name="textInteractionFlags">
<bool>true</bool> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item>
<widget class="QLabel" name="cclabel"> <widget class="QLabel" name="dateText">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text"> <property name="text">
<string>Cc:</string> <string notr="true">Date</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="wordWrap"> <property name="textInteractionFlags">
<bool>false</bool> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="bcclabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bcc:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</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">
<widget class="QLabel" name="bccText">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="tagsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Tags:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<layout class="QHBoxLayout" name="tagLayout"/>
</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> </layout>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="fromLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>From:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLabel" name="fromText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="toLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>To:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="RSTextBrowser" name="toText">
<property name="sizePolicy">
<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 name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="ccLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Cc:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</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">
<widget class="QLabel" name="bccLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bcc:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="RSTextBrowser" name="bccText">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="tagsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Tags:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<layout class="QHBoxLayout" name="tagLayout"/>
</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>