Skip to content
Snippets Groups Projects
Commit b1a7ba7f authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

messagewebview: adapt message webview header in different scale factor

Change-Id: I4cf7b16663b5bdbb3f0f095d61411f12b02707d1
parent d84144c7
No related branches found
No related tags found
No related merge requests found
...@@ -74,70 +74,51 @@ Rectangle { ...@@ -74,70 +74,51 @@ Rectangle {
Rectangle { Rectangle {
id: userNameOrIdRect id: userNameOrIdRect
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.alignment: Qt.AlignLeft | Qt.AlignTop
// Width + margin. // Width + margin.
Layout.preferredWidth: messagingHeaderRect.width Layout.preferredWidth: messagingHeaderRect.width
- backToWelcomeViewButton.width - buttonGroup.width - 45 - backToWelcomeViewButton.width - buttonGroup.width - 45
Layout.preferredHeight: messagingHeaderRect.height Layout.fillHeight: true
Layout.topMargin: 7
Layout.bottomMargin: 7
Layout.leftMargin: 16 Layout.leftMargin: 16
color: "transparent" color: "transparent"
ColumnLayout { ColumnLayout {
id: userNameOrIdColumnLayout id: userNameOrIdColumnLayout
Layout.alignment: Qt.AlignVCenter
anchors.fill: parent anchors.fill: parent
Label { spacing: 0
ElidedTextLabel {
id: userAliasLabel id: userAliasLabel
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: userNameOrIdRect.width
Layout.preferredHeight: textMetricsuserAliasLabel.boundingRect.height
Layout.topMargin: userUserNameLabel.text === "" ? 0 : 10
font.pointSize: JamiTheme.menuFontSize font.pointSize: JamiTheme.textFontSize + 2
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: textMetricsuserAliasLabel.elidedText
}
TextMetrics {
id: textMetricsuserAliasLabel
font: userAliasLabel.font
text: userAliasLabelText text: userAliasLabelText
elideWidth: userNameOrIdRect.width maxWidth: userNameOrIdRect.width
elide: Qt.ElideMiddle
} }
Label { ElidedTextLabel {
id: userUserNameLabel id: userUserNameLabel
visible: (text !== "")
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
Layout.preferredWidth: userNameOrIdRect.width
Layout.preferredHeight: textMetricsuserUserNameLabel.boundingRect.height
Layout.bottomMargin: 10
visible: text !== ""
font.pointSize: JamiTheme.textFontSize font.pointSize: JamiTheme.textFontSize
color: JamiTheme.faddedLastInteractionFontColor color: JamiTheme.faddedLastInteractionFontColor
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: textMetricsuserUserNameLabel.elidedText
}
TextMetrics {
id: textMetricsuserUserNameLabel
font: userUserNameLabel.font
text: userUserNameLabelText text: userUserNameLabelText
elideWidth: userNameOrIdRect.width maxWidth: userNameOrIdRect.width
elide: Qt.ElideMiddle
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment