Skip to content
Snippets Groups Projects
Commit eaec313a authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

misc: fit edited message to area

Change-Id: I019fba4105bde11d049d64a8e94716c0e977f79e
GitLab: #1001
parent 10e4b634
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,8 @@ Rectangle {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: footerColumnLayout.width
Layout.maximumWidth: JamiTheme.chatViewMaximumWidth
Layout.preferredHeight: 36
Layout.minimumHeight: 36
Layout.preferredHeight: 36 * JamiTheme.baseZoom
visible: MessagesAdapter.replyToId !== ""
}
......@@ -126,7 +127,8 @@ Rectangle {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: footerColumnLayout.width
Layout.maximumWidth: JamiTheme.chatViewMaximumWidth
Layout.preferredHeight: 36
Layout.minimumHeight: 36
Layout.preferredHeight: 36 * JamiTheme.baseZoom
visible: MessagesAdapter.editId !== ""
}
......
......@@ -65,7 +65,7 @@ Rectangle {
id: metrics
elide: Text.ElideRight
elideWidth: root.width - 100
text: root.body
text: UtilsAdapter.getOneline(root.body)
}
text: metrics.elidedText
......
......@@ -735,3 +735,13 @@ UtilsAdapter::hasNativeDarkTheme() const
#endif
#endif
}
QString
UtilsAdapter::getOneline(const QString& input)
{
auto output = input;
auto index = output.indexOf("\n");
if (index > 0)
output.truncate(index);
return output;
}
......@@ -139,6 +139,8 @@ public:
Q_INVOKABLE bool useApplicationTheme();
Q_INVOKABLE bool hasNativeDarkTheme() const;
Q_INVOKABLE QString getOneline(const QString& input);
Q_SIGNALS:
void debugMessageReceived(const QString& message);
void changeFontSize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment