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