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

misc: resolve qml warnings present on application start

- Resolves a portion of the warnings present prior to navigation
  or resizing.

Gitlab: #5
Change-Id: Ifa843d7613ddcca562256399a977c2eec62df404
parent 35508069
Branches
Tags
No related merge requests found
...@@ -20,11 +20,13 @@ import QtQuick 2.14 ...@@ -20,11 +20,13 @@ import QtQuick 2.14
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import net.jami.Models 1.0 import net.jami.Models 1.0
Label { Label {
id: root
property string eText : "" property string eText : ""
property int maxWidth: 100 property int maxWidth: 100
property int fontSize: JamiTheme.textFontSize property int fontSize: JamiTheme.textFontSize
property int textWidth: 0
font.pointSize: fontSize font.pointSize: fontSize
font.kerning: true font.kerning: true
...@@ -37,8 +39,14 @@ Label { ...@@ -37,8 +39,14 @@ Label {
TextMetrics { TextMetrics {
id: elided id: elided
font: root.font
elide: Text.ElideRight elide: Text.ElideRight
elideWidth: maxWidth elideWidth: maxWidth
text: eText text: eText
onTextChanged: {
textWidth = elided.boundingRect.width
}
} }
} }
...@@ -301,6 +301,7 @@ Window { ...@@ -301,6 +301,7 @@ Window {
Rectangle { Rectangle {
id: mainViewSidePanelRect id: mainViewSidePanelRect
SplitView.minimumWidth: sidePanelViewStackPreferredWidth SplitView.minimumWidth: sidePanelViewStackPreferredWidth
SplitView.maximumWidth: (sidePanelHidden ? splitView.width : SplitView.maximumWidth: (sidePanelHidden ? splitView.width :
splitView.width - sidePanelViewStackPreferredWidth) splitView.width - sidePanelViewStackPreferredWidth)
...@@ -404,6 +405,7 @@ Window { ...@@ -404,6 +405,7 @@ Window {
LeftPanelView { LeftPanelView {
id: leftPanelSettingsView id: leftPanelSettingsView
visible: false visible: false
contentViewportWidth: mainViewSidePanelRect.width contentViewportWidth: mainViewSidePanelRect.width
contentViewPortHeight: mainViewSidePanelRect.height contentViewPortHeight: mainViewSidePanelRect.height
...@@ -600,10 +602,9 @@ Window { ...@@ -600,10 +602,9 @@ Window {
} }
Component.onCompleted: { Component.onCompleted: {
mainViewSidePanelRect.SplitView.maximumWidth = Qt.binding(function() {
sidePanelViewStack.SplitView.maximumWidth = Qt.binding(function() { return sidePanelHidden ? splitView.width :
return (sidePanelHidden ? splitView.width : splitView.width - sidePanelViewStackPreferredWidth
splitView.width - sidePanelViewStackPreferredWidth)
}) })
recordBox.x = Qt.binding(function() { recordBox.x = Qt.binding(function() {
......
...@@ -195,7 +195,11 @@ Rectangle { ...@@ -195,7 +195,11 @@ Rectangle {
TextMetrics { TextMetrics {
id: textMetricsjamiBestNameText id: textMetricsjamiBestNameText
font: jamiBestNameText.font font: jamiBestNameText.font
text: videoCallPageRect.bestName text: {
if (videoCallPageRect)
return videoCallPageRect.bestName
return ""
}
elideWidth: overlayUpperPartRect.width / 3 elideWidth: overlayUpperPartRect.width / 3
elide: Qt.ElideRight elide: Qt.ElideRight
} }
......
...@@ -222,7 +222,7 @@ Rectangle { ...@@ -222,7 +222,7 @@ Rectangle {
DistantRenderer { DistantRenderer {
id: distantRenderer id: distantRenderer
anchors.centerIn: videoCallPageMainRect anchors.centerIn: parent
z: -1 z: -1
width: videoCallPageMainRect.width width: videoCallPageMainRect.width
......
...@@ -42,7 +42,11 @@ Dialog { ...@@ -42,7 +42,11 @@ Dialog {
smooth: false smooth: false
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: "image://qrImage/account_" + AccountAdapter.currentAccountId source: {
if (AccountAdapter.currentAccountId)
return "image://qrImage/account_" + AccountAdapter.currentAccountId
return ""
}
} }
background: Rectangle { background: Rectangle {
......
...@@ -180,7 +180,7 @@ Rectangle { ...@@ -180,7 +180,7 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent Layout.alignment: Qt.AlignCenter
isSIP: settingsViewRect.isSIP isSIP: settingsViewRect.isSIP
...@@ -199,7 +199,7 @@ Rectangle { ...@@ -199,7 +199,7 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent Layout.alignment: Qt.AlignCenter
} }
// av setting page, index 2 // av setting page, index 2
...@@ -208,7 +208,7 @@ Rectangle { ...@@ -208,7 +208,7 @@ Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent Layout.alignment: Qt.AlignCenter
} }
// plugin setting page, index 3 // plugin setting page, index 3
...@@ -216,7 +216,7 @@ Rectangle { ...@@ -216,7 +216,7 @@ Rectangle {
id: pluginSettings id: pluginSettings
Layout.fillHeight: true Layout.fillHeight: true
Layout.maximumWidth: JamiTheme.maximumWidthSettingsView Layout.maximumWidth: JamiTheme.maximumWidthSettingsView
anchors.centerIn: parent Layout.alignment: Qt.AlignCenter
} }
} }
} }
......
...@@ -76,27 +76,26 @@ ColumnLayout { ...@@ -76,27 +76,26 @@ ColumnLayout {
} }
ElidedTextLabel { ElidedTextLabel {
Layout.fillWidth: true Layout.preferredWidth: textWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight Layout.preferredHeight: JamiTheme.preferredFieldHeight
eText: JamiStrings.sdpSettingsTitle eText: JamiStrings.sdpSettingsTitle
fontSize: JamiTheme.headerFontSize fontSize: JamiTheme.headerFontSize
maxWidth: width maxWidth: root.width
} }
ElidedTextLabel { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.leftMargin: JamiTheme.preferredMarginSize Layout.leftMargin: JamiTheme.preferredMarginSize
eText: JamiStrings.sdpSettingsSubtitle ElidedTextLabel {
fontSize: JamiTheme.settingsFontSize Layout.preferredWidth: textWidth
maxWidth: width Layout.preferredHeight: JamiTheme.preferredFieldHeight
}
ColumnLayout { eText: JamiStrings.sdpSettingsSubtitle
Layout.fillWidth: true fontSize: JamiTheme.settingsFontSize
Layout.leftMargin: JamiTheme.preferredMarginSize maxWidth: parent.width - JamiTheme.preferredMarginSize
}
SettingSpinBox { SettingSpinBox {
id: audioRTPMinPortSpinBox id: audioRTPMinPortSpinBox
......
...@@ -558,8 +558,11 @@ Dialog { ...@@ -558,8 +558,11 @@ Dialog {
currentIndex: 0 currentIndex: 0
TabButton { TabButton {
id: pageOne id: pageOne
width: tabBar.width / 2 width: tabBar.width / 2
text: qsTr("1") height: 30
text: "1"
down: true down: true
// customize tab button // customize tab button
contentItem: Text { contentItem: Text {
...@@ -573,8 +576,7 @@ Dialog { ...@@ -573,8 +576,7 @@ Dialog {
// customize tab button // customize tab button
background: Rectangle { background: Rectangle {
id: buttonRectOne id: buttonRectOne
implicitWidth: tabBar.width / 2
implicitHeight: tabBar.height
radius: 10 radius: 10
color: pageOne.down ? "#e0e0e0" :"#fdfdfd" color: pageOne.down ? "#e0e0e0" :"#fdfdfd"
MouseArea { MouseArea {
...@@ -589,8 +591,11 @@ Dialog { ...@@ -589,8 +591,11 @@ Dialog {
} }
TabButton { TabButton {
id: pageTwo id: pageTwo
text: qsTr("2")
width: tabBar.width / 2 width: tabBar.width / 2
height: 30
text: "2"
contentItem: Text { contentItem: Text {
text: pageTwo.text text: pageTwo.text
font: pageTwo.font font: pageTwo.font
...@@ -602,8 +607,7 @@ Dialog { ...@@ -602,8 +607,7 @@ Dialog {
background: Rectangle { background: Rectangle {
id: buttonRectTwo id: buttonRectTwo
implicitWidth: tabBar.width / 2
implicitHeight: tabBar.height
radius: 10 radius: 10
color: pageTwo.down ? "#e0e0e0" :"#fdfdfd" color: pageTwo.down ? "#e0e0e0" :"#fdfdfd"
MouseArea { MouseArea {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment