diff --git a/Linphone/view/Control/Button/BigButton.qml b/Linphone/view/Control/Button/BigButton.qml index f6f57e8d..78a81251 100644 --- a/Linphone/view/Control/Button/BigButton.qml +++ b/Linphone/view/Control/Button/BigButton.qml @@ -8,10 +8,10 @@ Button { id: mainItem textSize: Typography.b1.pixelSize textWeight: Typography.b1.weight - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 11 * DefaultStyle.dp - bottomPadding: 11 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp -} \ No newline at end of file + leftPadding: Math.round(20.04 * DefaultStyle.dp) + rightPadding: Math.round(20.04 * DefaultStyle.dp) + topPadding: Math.round(11.2 * DefaultStyle.dp) + bottomPadding: Math.round(11.2 * DefaultStyle.dp) + icon.width: Math.round(24.89 * DefaultStyle.dp) + icon.height: Math.round(24.89 * DefaultStyle.dp) +} diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index d0589432..8ce120ba 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -22,10 +22,10 @@ Control.Button { property color disabledFilterColor: color.hslLightness > 0.5 ? DefaultStyle.grey_0 : DefaultStyle.grey_400 - property int textSize: 18 * DefaultStyle.dp - property int textWeight: 600 * DefaultStyle.dp + property real textSize: Math.round(18 * DefaultStyle.dp) + property real textWeight: Typography.b1.weight property var textHAlignment: Text.AlignHCenter - property int radius: 48 * DefaultStyle.dp + property real radius: Math.round(48 * DefaultStyle.dp) property bool underline: false property bool hasNavigationFocus: enabled && (activeFocus || hovered) property bool shadowEnabled: false @@ -33,7 +33,7 @@ Control.Button { property var hoveredImageColor: style?.image?.pressed || Qt.darker(contentImageColor, 1.05) property var pressedImageColor: style?.image?.pressed || Qt.darker(contentImageColor, 1.1) property bool asynchronous: true - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) hoverEnabled: enabled activeFocusOnTab: true icon.source: style?.iconSource || "" diff --git a/Linphone/view/Control/Button/CalendarComboBox.qml b/Linphone/view/Control/Button/CalendarComboBox.qml index e7f063b1..7fb71c9d 100644 --- a/Linphone/view/Control/Button/CalendarComboBox.qml +++ b/Linphone/view/Control/Button/CalendarComboBox.qml @@ -14,24 +14,24 @@ ComboBox { id: contentText text: Qt.formatDate(calendar.selectedDate, "ddd d, MMMM") anchors.fill: parent - anchors.leftMargin: 15 * DefaultStyle.dp + anchors.leftMargin: Math.round(15 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) + weight: Math.min(Math.round(700 * DefaultStyle.dp), 1000) } } popup: Control.Popup { id: popupItem y: mainItem.height - width: 321 * DefaultStyle.dp - height: 270 * DefaultStyle.dp + width: Math.round(321 * DefaultStyle.dp) + height: Math.round(270 * DefaultStyle.dp) closePolicy: Popup.NoAutoClose - topPadding: 25 * DefaultStyle.dp - bottomPadding: 24 * DefaultStyle.dp - leftPadding: 21 * DefaultStyle.dp - rightPadding: 19 * DefaultStyle.dp + topPadding: Math.round(25 * DefaultStyle.dp) + bottomPadding: Math.round(24 * DefaultStyle.dp) + leftPadding: Math.round(21 * DefaultStyle.dp) + rightPadding: Math.round(19 * DefaultStyle.dp) onOpened: calendar.forceActiveFocus() background: Item { anchors.fill: parent @@ -39,7 +39,7 @@ ComboBox { id: calendarBg anchors.fill: parent color: DefaultStyle.grey_0 - radius: 16 * DefaultStyle.dp + radius: Math.round(16 * DefaultStyle.dp) border.color: DefaultStyle.main1_500_main border.width: calendar.activeFocus? 1 : 0 } diff --git a/Linphone/view/Control/Button/CheckBox.qml b/Linphone/view/Control/Button/CheckBox.qml index 6f6ab78c..233ebf58 100644 --- a/Linphone/view/Control/Button/CheckBox.qml +++ b/Linphone/view/Control/Button/CheckBox.qml @@ -7,16 +7,16 @@ Control.CheckBox { id: mainItem hoverEnabled: enabled indicator: Item{ - implicitWidth: 20 * DefaultStyle.dp - implicitHeight: 20 * DefaultStyle.dp + implicitWidth: Math.round(20 * DefaultStyle.dp) + implicitHeight: Math.round(20 * DefaultStyle.dp) x: (parent.width - width) / 2 y: (parent.height - height) / 2 Rectangle { id: backgroundArea anchors.fill: parent - radius: 3 * DefaultStyle.dp + radius: Math.round(3 * DefaultStyle.dp) border.color: mainItem.hovered || mainItem.activeFocus ? DefaultStyle.main1_600 : DefaultStyle.main1_500_main - border.width: 2 * DefaultStyle.dp + border.width: Math.round(2 * DefaultStyle.dp) color: mainItem.checked ? DefaultStyle.main1_500_main : "transparent" EffectImage { visible: mainItem.checked diff --git a/Linphone/view/Control/Button/ComboBox.qml b/Linphone/view/Control/Button/ComboBox.qml index c710bab5..0c9d4590 100644 --- a/Linphone/view/Control/Button/ComboBox.qml +++ b/Linphone/view/Control/Button/ComboBox.qml @@ -11,9 +11,9 @@ Control.ComboBox { // readonly property string currentText: selectedItemText.text property alias listView: listView property string constantImageSource - property int pixelSize: 14 * DefaultStyle.dp - property int weight: 400 * DefaultStyle.dp - property int leftMargin: 10 * DefaultStyle.dp + property real pixelSize: Typography.p1.pixelSize + property real weight: Typography.p1.weight + property real leftMargin: Math.round(10 * DefaultStyle.dp) property bool oneLine: false property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered property string flagRole// Specific case if flag is shown (special font) @@ -49,7 +49,7 @@ Control.ComboBox { Rectangle { id: buttonBackground anchors.fill: parent - radius: 63 * DefaultStyle.dp + radius: Math.round(63 * DefaultStyle.dp) color: mainItem.enabled ? DefaultStyle.grey_100 : DefaultStyle.grey_200 border.color: mainItem.enabled ? mainItem.activeFocus @@ -71,13 +71,13 @@ Control.ComboBox { } contentItem: RowLayout { anchors.fill: parent - anchors.leftMargin: 10 * DefaultStyle.dp - anchors.rightMargin: indicImage.width + 10 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) + anchors.rightMargin: indicImage.width + Math.round(10 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) EffectImage { id: selectedItemImg - Layout.preferredWidth: visible ? 24 * DefaultStyle.dp : 0 - Layout.preferredHeight: visible ? 24 * DefaultStyle.dp : 0 + Layout.preferredWidth: visible ? Math.round(24 * DefaultStyle.dp) : 0 + Layout.preferredHeight: visible ? Math.round(24 * DefaultStyle.dp) : 0 Layout.leftMargin: mainItem.leftMargin imageSource: mainItem.constantImageSource ? mainItem.constantImageSource : "" colorizationColor: DefaultStyle.main2_600 @@ -87,7 +87,7 @@ Control.ComboBox { Text { id: selectedItemFlag Layout.preferredWidth: implicitWidth - Layout.leftMargin: selectedItemImg.visible ? 0 : 5 * DefaultStyle.dp + Layout.leftMargin: selectedItemImg.visible ? 0 : Math.round(5 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter color: mainItem.enabled ? DefaultStyle.main2_600 : DefaultStyle.grey_400 font { @@ -99,8 +99,8 @@ Control.ComboBox { Text { id: selectedItemText Layout.fillWidth: true - Layout.leftMargin: selectedItemImg.visible ? 0 : 5 * DefaultStyle.dp - Layout.rightMargin: 20 * DefaultStyle.dp + Layout.leftMargin: selectedItemImg.visible ? 0 : Math.round(5 * DefaultStyle.dp) + Layout.rightMargin: Math.round(20 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter color: mainItem.enabled ? DefaultStyle.main2_600 : DefaultStyle.grey_400 elide: Text.ElideRight @@ -119,10 +119,10 @@ Control.ComboBox { id: indicImage z: 1 anchors.right: parent.right - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter imageSource: AppIcons.downArrow - width: 14 * DefaultStyle.dp + width: Math.round(14 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit } @@ -131,7 +131,7 @@ Control.ComboBox { y: mainItem.height - 1 width: mainItem.width implicitHeight: Math.min(contentItem.implicitHeight, mainWindow.height) - padding: 1 * DefaultStyle.dp + padding: Math.max(Math.round(1 * DefaultStyle.dp), 1) //height: Math.min(implicitHeight, 300) onOpened: { @@ -151,7 +151,7 @@ Control.ComboBox { highlight: Rectangle { width: listView.width color: DefaultStyle.main2_200 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) y: listView.currentItem? listView.currentItem.y : 0 } @@ -172,17 +172,17 @@ Control.ComboBox { anchors.fill: parent EffectImage { id: delegateImg - Layout.preferredWidth: visible ? 20 * DefaultStyle.dp : 0 - Layout.leftMargin: 10 * DefaultStyle.dp + Layout.preferredWidth: visible ? Math.round(20 * DefaultStyle.dp) : 0 + Layout.leftMargin: Math.round(10 * DefaultStyle.dp) visible: imageSource != "" - imageWidth: 20 * DefaultStyle.dp + imageWidth: Math.round(20 * DefaultStyle.dp) imageSource: typeof(modelData) != "undefined" && modelData.img ? modelData.img : "" fillMode: Image.PreserveAspectFit } Text { Layout.preferredWidth: implicitWidth - Layout.leftMargin: delegateImg.visible ? 0 : 5 * DefaultStyle.dp + Layout.leftMargin: delegateImg.visible ? 0 : Math.round(5 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter visible: mainItem.flagRole font { @@ -198,8 +198,8 @@ Control.ComboBox { } Text { Layout.fillWidth: true - Layout.leftMargin: delegateImg.visible ? 0 : 5 * DefaultStyle.dp - Layout.rightMargin: 20 * DefaultStyle.dp + Layout.leftMargin: delegateImg.visible ? 0 : Math.round(5 * DefaultStyle.dp) + Layout.rightMargin: Math.round(20 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter text: typeof(modelData) != "undefined" ? mainItem.textRole @@ -217,8 +217,8 @@ Control.ComboBox { wrapMode: Text.WrapAnywhere font { family: DefaultStyle.defaultFont - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) + weight: Math.min(Math.round(400 * DefaultStyle.dp), 1000) } } } @@ -230,7 +230,7 @@ Control.ComboBox { Rectangle { anchors.fill: parent opacity: 0.1 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) color: DefaultStyle.main2_500main visible: parent.containsMouse } @@ -248,11 +248,11 @@ Control.ComboBox { background: Item { implicitWidth: mainItem.width - implicitHeight: 30 * DefaultStyle.dp + implicitHeight: Math.round(30 * DefaultStyle.dp) Rectangle { id: cboxBg anchors.fill: parent - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } MultiEffect { anchors.fill: cboxBg diff --git a/Linphone/view/Control/Button/CountryIndicatorCombobox.qml b/Linphone/view/Control/Button/CountryIndicatorCombobox.qml index cd649b68..a0b19ab1 100644 --- a/Linphone/view/Control/Button/CountryIndicatorCombobox.qml +++ b/Linphone/view/Control/Button/CountryIndicatorCombobox.qml @@ -17,8 +17,8 @@ ColumnLayout { text: mainItem.label color: combobox.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_600 font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight bold: true } } @@ -32,7 +32,7 @@ ColumnLayout { background: Rectangle { implicitWidth: mainItem.implicitWidth implicitHeight: mainItem.implicitHeight - radius: 63 * DefaultStyle.dp + radius: Math.round(63 * DefaultStyle.dp) color: mainItem.enableBackgroundColor ? DefaultStyle.grey_100 : "transparent" border.color: mainItem.enableBackgroundColors ? (mainItem.errorMessage.length > 0 @@ -45,14 +45,14 @@ ColumnLayout { contentItem: Item { anchors.fill: parent readonly property var currentItem: combobox.model.getAt(combobox.currentIndex) - anchors.leftMargin: 15 * DefaultStyle.dp + anchors.leftMargin: Math.round(15 * DefaultStyle.dp) Text { id: selectedItemFlag visible: text.length > 0 - font.pixelSize: 21 * DefaultStyle.dp + font.pixelSize: Math.round(21 * DefaultStyle.dp) text: parent.currentItem ? parent.currentItem.flag : "" font.family: DefaultStyle.flagFont - anchors.rightMargin: 5 * DefaultStyle.dp + anchors.rightMargin: Math.round(5 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter } // Rectangle{ @@ -60,7 +60,7 @@ ColumnLayout { // visible: false // layer.enabled: true // anchors.centerIn: selectedItemFlag - // radius: 600 * DefaultStyle.dp + // radius: Math.round(600 * DefaultStyle.dp) // width: selectedItemFlag.width/2 // height: selectedItemFlag.height/2 // } @@ -75,7 +75,7 @@ ColumnLayout { // maskSource: mask // } Text { - leftPadding: 5 * DefaultStyle.dp + leftPadding: Math.round(5 * DefaultStyle.dp) text: parent.currentItem ? "+" + parent.currentItem.countryCallingCode : "" color: DefaultStyle.main2_600 anchors.right: parent.right @@ -83,8 +83,8 @@ ColumnLayout { anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } @@ -99,8 +99,8 @@ ColumnLayout { popup: Control.Popup { id: listPopup y: combobox.height - 1 - width: 311 * DefaultStyle.dp - height: 250 * DefaultStyle.dp + width: Math.round(311 * DefaultStyle.dp) + height: Math.round(250 * DefaultStyle.dp) contentItem: ListView { id: listView @@ -111,14 +111,14 @@ ColumnLayout { keyNavigationEnabled: true keyNavigationWraps: true maximumFlickVelocity: 1500 - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) highlight: Rectangle { anchors.left: parent.left anchors.right: parent.right width: listView.width height: listView.height color: DefaultStyle.main2_300 - // radius: 15 * DefaultStyle.dp + // radius: Math.round(15 * DefaultStyle.dp) } delegate: Item { @@ -127,7 +127,7 @@ ColumnLayout { RowLayout { id: contentLayout anchors.fill: parent - anchors.leftMargin: 20 * DefaultStyle.dp + anchors.leftMargin: Math.round(20 * DefaultStyle.dp) spacing: 0 Text { @@ -135,7 +135,7 @@ ColumnLayout { visible: text.length > 0 text: $modelData.flag font { - pixelSize: 28 * DefaultStyle.dp + pixelSize: Math.round(28 * DefaultStyle.dp) family: DefaultStyle.flagFont } } @@ -146,14 +146,14 @@ ColumnLayout { elide: Text.ElideRight color: DefaultStyle.main2_500main font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } Rectangle { id: separator - width: 1 * DefaultStyle.dp + width: Math.max(Math.round(1 * DefaultStyle.dp), 1) height: combobox.height / 2 color: DefaultStyle.main2_500main } @@ -163,8 +163,8 @@ ColumnLayout { elide: Text.ElideRight color: DefaultStyle.main2_500main font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } Item { @@ -177,7 +177,7 @@ ColumnLayout { Rectangle { anchors.fill: parent opacity: 0.1 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) color: DefaultStyle.main2_500main visible: parent.containsMouse } @@ -199,7 +199,7 @@ ColumnLayout { Rectangle { id: popupBg anchors.fill: parent - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) color: DefaultStyle.grey_100 } MultiEffect { diff --git a/Linphone/view/Control/Button/HelpIconLabelButton.qml b/Linphone/view/Control/Button/HelpIconLabelButton.qml index 018140d0..7e12b0cd 100644 --- a/Linphone/view/Control/Button/HelpIconLabelButton.qml +++ b/Linphone/view/Control/Button/HelpIconLabelButton.qml @@ -8,7 +8,7 @@ MouseArea { property string iconSource property string title property string subTitle - property int iconSize: 32 * DefaultStyle.dp + property real iconSize: (32 * DefaultStyle.dp) property bool shadowEnabled: containsMouse || activeFocus hoverEnabled: true width: content.implicitWidth @@ -36,7 +36,7 @@ MouseArea { ColumnLayout { width: implicitWidth height: implicitHeight - Layout.leftMargin: 16 * DefaultStyle.dp + Layout.leftMargin: (16 * DefaultStyle.dp) Text { Layout.fillWidth: true text: mainItem.title diff --git a/Linphone/view/Control/Button/IconButton.qml b/Linphone/view/Control/Button/IconButton.qml index db77bcf5..c397fa53 100644 --- a/Linphone/view/Control/Button/IconButton.qml +++ b/Linphone/view/Control/Button/IconButton.qml @@ -6,11 +6,11 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle Button { id: mainItem - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - textSize: 14 * DefaultStyle.dp - textWeight: 400 * DefaultStyle.dp - radius: 5 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) + textSize: Typography.p1.pixelSize + textWeight: Typography.p1.weight + radius: Math.round(5 * DefaultStyle.dp) shadowEnabled: mainItem.activeFocus || hovered style: ButtonStyle.hoveredBackground diff --git a/Linphone/view/Control/Button/IconLabelButton.qml b/Linphone/view/Control/Button/IconLabelButton.qml index 68298832..dce06425 100644 --- a/Linphone/view/Control/Button/IconLabelButton.qml +++ b/Linphone/view/Control/Button/IconLabelButton.qml @@ -6,16 +6,16 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle Button { id: mainItem - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - textSize: 14 * DefaultStyle.dp - textWeight: 400 * DefaultStyle.dp - radius: 5 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) + textSize: Typography.p1.pixelSize + textWeight: Typography.p1.weight + radius: Math.round(5 * DefaultStyle.dp) shadowEnabled: mainItem.activeFocus || hovered style: ButtonStyle.hoveredBackground contentItem: RowLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) EffectImage { imageSource: mainItem.icon.source imageWidth: mainItem.icon.width diff --git a/Linphone/view/Control/Button/MediumButton.qml b/Linphone/view/Control/Button/MediumButton.qml index cd7ee3f7..2a621a25 100644 --- a/Linphone/view/Control/Button/MediumButton.qml +++ b/Linphone/view/Control/Button/MediumButton.qml @@ -8,10 +8,10 @@ Button { id: mainItem textSize: Typography.b2.pixelSize textWeight: Typography.b2.weight - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - topPadding: 10 * DefaultStyle.dp - bottomPadding: 10 * DefaultStyle.dp - icon.width: 16 * DefaultStyle.dp - icon.height: 16 * DefaultStyle.dp + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) + topPadding: Math.round(10 * DefaultStyle.dp) + bottomPadding: Math.round(10 * DefaultStyle.dp) + icon.width: Math.round(16 * DefaultStyle.dp) + icon.height: Math.round(16 * DefaultStyle.dp) } diff --git a/Linphone/view/Control/Button/PopupButton.qml b/Linphone/view/Control/Button/PopupButton.qml index 7ff4d7b9..a95876bc 100644 --- a/Linphone/view/Control/Button/PopupButton.qml +++ b/Linphone/view/Control/Button/PopupButton.qml @@ -12,17 +12,17 @@ Button { property color backgroundColor: checked ? pressedColor : hovered ? hoveredColor : color style: ButtonStyle.popupButton checked: popup.visible - implicitWidth: 24 * DefaultStyle.dp - implicitHeight: 24 * DefaultStyle.dp - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + implicitWidth: Math.round(24 * DefaultStyle.dp) + implicitHeight: Math.round(24 * DefaultStyle.dp) + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) leftPadding: 0 rightPadding: 0 topPadding: 0 bottomPadding: 0 icon.source: AppIcons.verticalDots - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) function close() { popup.close() } @@ -97,7 +97,7 @@ Button { id: buttonBackground anchors.fill: parent color: mainItem.backgroundColor - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) } MultiEffect { enabled: mainItem.shadowEnabled @@ -130,7 +130,7 @@ Button { visible: false closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside | Popup.CloseOnEscape - padding: 10 * DefaultStyle.dp + padding: Math.round(10 * DefaultStyle.dp) parent: mainItem // Explicit define for coordinates references. function updatePosition() { if (!visible) @@ -177,7 +177,7 @@ Button { id: popupBackground anchors.fill: parent color: DefaultStyle.grey_0 - radius: 16 * DefaultStyle.dp + radius: Math.round(16 * DefaultStyle.dp) } MultiEffect { source: popupBackground diff --git a/Linphone/view/Control/Button/RadioButton.qml b/Linphone/view/Control/Button/RadioButton.qml index 884a22f5..44a7fa11 100644 --- a/Linphone/view/Control/Button/RadioButton.qml +++ b/Linphone/view/Control/Button/RadioButton.qml @@ -11,7 +11,7 @@ Control.RadioButton { property string imgUrl property bool checkOnClick: true property color color - property int indicatorSize: 16 * DefaultStyle.dp + property real indicatorSize: Math.round(16 * DefaultStyle.dp) property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered //onClicked: if (checkOnClick && !mainItem.checked) mainItem.toggle() @@ -33,7 +33,7 @@ Control.RadioButton { radius: mainItem.indicatorSize/2 color: "transparent" border.color: mainItem.color - border.width: 2 * DefaultStyle.dp + border.width: Math.round(2 * DefaultStyle.dp) Rectangle { width: parent.width/2 height: parent.height/2 diff --git a/Linphone/view/Control/Button/RoundButton.qml b/Linphone/view/Control/Button/RoundButton.qml index 8fd4c86a..7218a7d0 100644 --- a/Linphone/view/Control/Button/RoundButton.qml +++ b/Linphone/view/Control/Button/RoundButton.qml @@ -8,13 +8,13 @@ Button { id: mainItem textSize: Typography.p1s.pixelSize textWeight: Typography.p1s.weight - topPadding: 16 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - radius: 40 * DefaultStyle.dp - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp -} \ No newline at end of file + topPadding: Math.round(16 * DefaultStyle.dp) + bottomPadding: Math.round(16 * DefaultStyle.dp) + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) + radius: Math.round(40 * DefaultStyle.dp) + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) +} diff --git a/Linphone/view/Control/Button/SecurityRadioButton.qml b/Linphone/view/Control/Button/SecurityRadioButton.qml index 57021f55..0710f64c 100644 --- a/Linphone/view/Control/Button/SecurityRadioButton.qml +++ b/Linphone/view/Control/Button/SecurityRadioButton.qml @@ -21,18 +21,18 @@ Control.RadioButton { background: Rectangle { color: DefaultStyle.grey_100 border.color: mainItem.checked ? mainItem.color : "transparent" - radius: 20 * DefaultStyle.dp + radius: Math.round(20 * DefaultStyle.dp) } indicator: RowLayout { anchors.left: parent.left - anchors.leftMargin: 13 * DefaultStyle.dp + anchors.leftMargin: Math.round(13 * DefaultStyle.dp) anchors.top: parent.top - anchors.topMargin: 8 * DefaultStyle.dp - spacing: 4 * DefaultStyle.dp + anchors.topMargin: Math.round(8 * DefaultStyle.dp) + spacing: Math.round(4 * DefaultStyle.dp) Rectangle { - implicitWidth: 16 * DefaultStyle.dp - implicitHeight: 16 * DefaultStyle.dp + implicitWidth: Math.round(16 * DefaultStyle.dp) + implicitHeight: Math.round(16 * DefaultStyle.dp) radius: implicitWidth/2 border.color: mainItem.color @@ -51,7 +51,7 @@ Control.RadioButton { text: mainItem.title font.bold: true color: DefaultStyle.grey_900 - font.pixelSize: 16 * DefaultStyle.dp + font.pixelSize: Math.round(16 * DefaultStyle.dp) } Button { padding: 0 @@ -59,12 +59,12 @@ Control.RadioButton { visible: false } icon.source: AppIcons.info - Layout.preferredWidth: 2 * DefaultStyle.dp - Layout.preferredHeight: 2 * DefaultStyle.dp - width: 2 * DefaultStyle.dp - height: 2 * DefaultStyle.dp - icon.width: 2 * DefaultStyle.dp - icon.height: 2 * DefaultStyle.dp + Layout.preferredWidth: Math.round(2 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(2 * DefaultStyle.dp) + width: Math.round(2 * DefaultStyle.dp) + height: Math.round(2 * DefaultStyle.dp) + icon.width: Math.round(2 * DefaultStyle.dp) + icon.height: Math.round(2 * DefaultStyle.dp) } } @@ -73,27 +73,27 @@ Control.RadioButton { anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - anchors.leftMargin: 13 * DefaultStyle.dp + anchors.leftMargin: Math.round(13 * DefaultStyle.dp) RowLayout { Layout.fillWidth: true Layout.fillHeight: true - Layout.bottomMargin: 10 * DefaultStyle.dp - Layout.rightMargin: 10 * DefaultStyle.dp + Layout.bottomMargin: Math.round(10 * DefaultStyle.dp) + Layout.rightMargin: Math.round(10 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter Text { id: innerText verticalAlignment: Text.AlignVCenter - Layout.preferredWidth: 220 * DefaultStyle.dp - Layout.preferredHeight: 100 * DefaultStyle.dp - font.pixelSize: 14 * DefaultStyle.dp + Layout.preferredWidth: Math.round(220 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(100 * DefaultStyle.dp) + font.pixelSize: Math.round(14 * DefaultStyle.dp) text: mainItem.contentText Layout.fillHeight: true } Image { id: image Layout.fillHeight: true - Layout.preferredWidth: 100 * DefaultStyle.dp - Layout.preferredHeight: 100 * DefaultStyle.dp + Layout.preferredWidth: Math.round(100 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(100 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: mainItem.imgUrl } diff --git a/Linphone/view/Control/Button/Settings/ComboSetting.qml b/Linphone/view/Control/Button/Settings/ComboSetting.qml index 838b64ca..a2b30c60 100644 --- a/Linphone/view/Control/Button/Settings/ComboSetting.qml +++ b/Linphone/view/Control/Button/Settings/ComboSetting.qml @@ -6,7 +6,7 @@ import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils ComboBox { id: mainItem - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) property string propertyName property var propertyOwner diff --git a/Linphone/view/Control/Button/Settings/SwitchSetting.qml b/Linphone/view/Control/Button/Settings/SwitchSetting.qml index 5d8e8daf..7ade3718 100644 --- a/Linphone/view/Control/Button/Settings/SwitchSetting.qml +++ b/Linphone/view/Control/Button/Settings/SwitchSetting.qml @@ -11,7 +11,7 @@ RowLayout { property var propertyOwner property var propertyOwnerGui property bool enabled: true - spacing : 20 * DefaultStyle.dp + spacing : Math.round(20 * DefaultStyle.dp) signal checkedChanged(bool checked) function setChecked(value) { @@ -19,8 +19,8 @@ RowLayout { } ColumnLayout { - Layout.minimumHeight: 32 * DefaultStyle.dp - spacing: 4 * DefaultStyle.dp + Layout.minimumHeight: Math.round(32 * DefaultStyle.dp) + spacing: Math.round(4 * DefaultStyle.dp) Text { text: titleText font: Typography.p2l diff --git a/Linphone/view/Control/Button/Slider.qml b/Linphone/view/Control/Button/Slider.qml index 19e01149..5132d789 100644 --- a/Linphone/view/Control/Button/Slider.qml +++ b/Linphone/view/Control/Button/Slider.qml @@ -11,14 +11,14 @@ Control.Slider { background: Item{ x: mainItem.leftPadding y: mainItem.topPadding + mainItem.availableHeight / 2 - height / 2 - implicitWidth: 200 * DefaultStyle.dp - implicitHeight: 4 * DefaultStyle.dp + implicitWidth: Math.round(200 * DefaultStyle.dp) + implicitHeight: Math.round(4 * DefaultStyle.dp) width: mainItem.availableWidth height: implicitHeight Rectangle { id: sliderBackground anchors.fill: parent - radius: 30 * DefaultStyle.dp + radius: Math.round(30 * DefaultStyle.dp) // TODO : change the colors when mockup indicates their names color: DefaultStyle.grey_850 @@ -30,7 +30,7 @@ Control.Slider { GradientStop { position: 0.0; color: "#FF9E79" } GradientStop { position: 1.0; color: "#FE5E00" } } - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) } } MultiEffect { @@ -49,12 +49,12 @@ Control.Slider { handle: Item { x: mainItem.leftPadding + mainItem.visualPosition * (mainItem.availableWidth - width) y: mainItem.topPadding + mainItem.availableHeight / 2 - height / 2 - implicitWidth: 16 * DefaultStyle.dp - implicitHeight: 16 * DefaultStyle.dp + implicitWidth: Math.round(16 * DefaultStyle.dp) + implicitHeight: Math.round(16 * DefaultStyle.dp) Rectangle { id: handleRect anchors.fill: parent - radius: 30 * DefaultStyle.dp + radius: Math.round(30 * DefaultStyle.dp) color: DefaultStyle.grey_0 } MultiEffect { diff --git a/Linphone/view/Control/Button/SmallButton.qml b/Linphone/view/Control/Button/SmallButton.qml index 48521143..e9d04654 100644 --- a/Linphone/view/Control/Button/SmallButton.qml +++ b/Linphone/view/Control/Button/SmallButton.qml @@ -8,10 +8,10 @@ Button { id: mainItem textSize: Typography.b3.pixelSize textWeight: Typography.b3.weight - leftPadding: 12 * DefaultStyle.dp - rightPadding: 12 * DefaultStyle.dp - topPadding: 6 * DefaultStyle.dp - bottomPadding: 6 * DefaultStyle.dp - icon.height: 14 * DefaultStyle.dp - icon.width: 14 * DefaultStyle.dp + leftPadding: Math.round(12 * DefaultStyle.dp) + rightPadding: Math.round(12 * DefaultStyle.dp) + topPadding: Math.round(6 * DefaultStyle.dp) + bottomPadding: Math.round(6 * DefaultStyle.dp) + icon.height: Math.round(14 * DefaultStyle.dp) + icon.width: Math.round(14 * DefaultStyle.dp) } diff --git a/Linphone/view/Control/Button/Switch.qml b/Linphone/view/Control/Button/Switch.qml index afcf00f8..135ce8f8 100644 --- a/Linphone/view/Control/Button/Switch.qml +++ b/Linphone/view/Control/Button/Switch.qml @@ -9,27 +9,27 @@ Control.Switch { property bool shadowEnabled: mainItem.hovered || mainItem.activeFocus hoverEnabled: true font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } indicator: Item{ - implicitWidth: 32 * DefaultStyle.dp - implicitHeight: 20 * DefaultStyle.dp + implicitWidth: Math.round(32 * DefaultStyle.dp) + implicitHeight: Math.round(20 * DefaultStyle.dp) x: mainItem.leftPadding y: parent.height / 2 - height / 2 Rectangle { id: indicatorBackground anchors.fill: parent - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) color: mainItem.checked? DefaultStyle.success_500main : DefaultStyle.main2_400 Rectangle { anchors.verticalCenter: parent.verticalCenter - property int margin: 4 * DefaultStyle.dp + property real margin: Math.round(4 * DefaultStyle.dp) x: mainItem.checked ? parent.width - width - margin : margin - width: 12 * DefaultStyle.dp - height: 12 * DefaultStyle.dp - radius: 10 * DefaultStyle.dp + width: Math.round(12 * DefaultStyle.dp) + height: Math.round(12 * DefaultStyle.dp) + radius: Math.round(10 * DefaultStyle.dp) color: DefaultStyle.grey_0 Behavior on x { NumberAnimation{duration: 100} diff --git a/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml b/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml index 9c10ef0c..e2271b0b 100644 --- a/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml +++ b/Linphone/view/Control/Container/Call/ActiveSpeakerLayout.qml @@ -33,8 +33,8 @@ Item { RowLayout{ anchors.fill: parent - anchors.rightMargin: 10 * DefaultStyle.dp - spacing: 16 * DefaultStyle.dp + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) + spacing: Math.round(16 * DefaultStyle.dp) Sticker { id: activeSpeakerSticker Layout.fillWidth: true @@ -58,23 +58,23 @@ Item { ListView{ id: sideStickers Layout.fillHeight: true - Layout.preferredWidth: 300 * DefaultStyle.dp - Layout.rightMargin: 10 * DefaultStyle.dp - Layout.bottomMargin: 10 * DefaultStyle.dp + Layout.preferredWidth: Math.round(300 * DefaultStyle.dp) + Layout.rightMargin: Math.round(10 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(10 * DefaultStyle.dp) visible: allDevices.count > 2 || !!mainItem.conference?.core.isScreenSharingEnabled - //spacing: 15 * DefaultStyle.dp // bugged? First item has twice margins + //spacing: Math.round(15 * DefaultStyle.dp) // bugged? First item has twice margins model: allDevices snapMode: ListView.SnapOneItem clip: true delegate: Item{ // Spacing workaround visible: $modelData && mainItem.callState != LinphoneEnums.CallState.End && mainItem.callState != LinphoneEnums.CallState.Released && ($modelData.core.address != activeSpeakerAddress || mainItem.conference?.core.isScreenSharingEnabled) || false - height: visible ? (180 + 15) * DefaultStyle.dp : 0 - width: 300 * DefaultStyle.dp + height: visible ? Math.round((180 + 15) * DefaultStyle.dp) : 0 + width: Math.round(300 * DefaultStyle.dp) Sticker { previewEnabled: index == 0 // before anchors for priority initialization anchors.fill: parent - anchors.bottomMargin: 15 * DefaultStyle.dp// Spacing + anchors.bottomMargin: Math.round(15 * DefaultStyle.dp)// Spacing qmlName: 'S_'+index visible: parent.visible participantDevice: $modelData @@ -91,12 +91,12 @@ Item { previewEnabled: true visible: !sideStickers.visible onVisibleChanged: console.log(visible + " : " +allDevices.count) - height: 180 * DefaultStyle.dp - width: 300 * DefaultStyle.dp + height: Math.round(180 * DefaultStyle.dp) + width: Math.round(300 * DefaultStyle.dp) anchors.right: mainItem.right anchors.bottom: mainItem.bottom - anchors.rightMargin: 20 * DefaultStyle.dp - anchors.bottomMargin: 10 * DefaultStyle.dp + anchors.rightMargin: Math.round(20 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(10 * DefaultStyle.dp) videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call) property var accountObj: UtilsCpp.findLocalAccountByAddress(mainItem.localAddress) @@ -109,7 +109,7 @@ Item { id: previewMouseArea anchors.fill: parent movableArea: mainItem - margin: 10 * DefaultStyle.dp + margin: Math.round(10 * DefaultStyle.dp) function resetPosition(){ preview.anchors.right = mainItem.right preview.anchors.bottom = mainItem.bottom @@ -127,4 +127,4 @@ Item { onRequestResetPosition: resetPosition() } } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Container/Call/CallGridLayout.qml b/Linphone/view/Control/Container/Call/CallGridLayout.qml index f7a463dd..370be140 100644 --- a/Linphone/view/Control/Container/Call/CallGridLayout.qml +++ b/Linphone/view/Control/Container/Call/CallGridLayout.qml @@ -36,8 +36,8 @@ Mosaic { if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer) } - height: grid.cellHeight - 10 * DefaultStyle.dp - width: grid.cellWidth - 10 * DefaultStyle.dp + height: grid.cellHeight - Math.round(10 * DefaultStyle.dp) + width: grid.cellWidth - Math.round(10 * DefaultStyle.dp) Sticker { id: cameraView previewEnabled: index == 0 diff --git a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml index b393a25e..f9eb6460 100644 --- a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml +++ b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml @@ -9,7 +9,7 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle ColumnLayout { id: mainItem - spacing: 30 * DefaultStyle.dp + spacing: Math.round(30 * DefaultStyle.dp) property var callHistoryGui @@ -37,41 +37,41 @@ ColumnLayout { // property alias image: buttonImg property alias button: button property string label - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) Button { id: button Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 56 * DefaultStyle.dp - Layout.preferredHeight: 56 * DefaultStyle.dp - topPadding: 16 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp + Layout.preferredWidth: Math.round(56 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(56 * DefaultStyle.dp) + topPadding: Math.round(16 * DefaultStyle.dp) + bottomPadding: Math.round(16 * DefaultStyle.dp) + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) contentImageColor: DefaultStyle.main2_600 - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) style: ButtonStyle.grey } Text { Layout.alignment: Qt.AlignHCenter text: labelButton.label font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } ColumnLayout { - spacing: 13 * DefaultStyle.dp + spacing: Math.round(13 * DefaultStyle.dp) Item { - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) Layout.preferredHeight: detailAvatar.height Layout.alignment: Qt.AlignHCenter Avatar { id: detailAvatar anchors.horizontalCenter: parent.horizontalCenter - width: 100 * DefaultStyle.dp - height: 100 * DefaultStyle.dp + width: Math.round(100 * DefaultStyle.dp) + height: Math.round(100 * DefaultStyle.dp) contact: mainItem.contact || null isConference: !!mainItem.conferenceInfo displayNameVal: mainItem.contactName @@ -81,18 +81,18 @@ ColumnLayout { id: rightButton anchors.right: parent.right anchors.verticalCenter: detailAvatar.verticalCenter - anchors.rightMargin: 20 * DefaultStyle.dp - width: 30 * DefaultStyle.dp - height: 30 * DefaultStyle.dp + anchors.rightMargin: Math.round(20 * DefaultStyle.dp) + width: Math.round(30 * DefaultStyle.dp) + height: Math.round(30 * DefaultStyle.dp) } } ColumnLayout { Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 360 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) ColumnLayout { - spacing: 2 * DefaultStyle.dp + spacing: Math.round(2 * DefaultStyle.dp) Text { Layout.preferredWidth: implicitWidth Layout.alignment: Qt.AlignHCenter @@ -101,8 +101,8 @@ ColumnLayout { text: detailAvatar.displayNameVal maximumLineCount: 1 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight capitalization: Font.Capitalize } } @@ -115,8 +115,8 @@ ColumnLayout { elide: Text.ElideMiddle maximumLineCount: 1 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -141,15 +141,15 @@ ColumnLayout { ? DefaultStyle.danger_500main : DefaultStyle.main2_500main font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } } RowLayout { Layout.alignment: Qt.AlignHCenter - spacing: 72 * DefaultStyle.dp + spacing: Math.round(72 * DefaultStyle.dp) Layout.fillWidth: true Layout.preferredHeight: childrenRect.height MediumButton { @@ -167,10 +167,10 @@ ColumnLayout { } LabelButton { visible: !mainItem.isConference - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.icon.source: AppIcons.phone label: qsTr("Appel") button.onClicked: { @@ -180,20 +180,20 @@ ColumnLayout { } LabelButton { visible: !mainItem.isConference && !SettingsCpp.disableChatFeature - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.icon.source: AppIcons.chatTeardropText label: qsTr("Message") button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation") } LabelButton { visible: !mainItem.isConference && SettingsCpp.videoEnabled - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.icon.source: AppIcons.videoCamera label: qsTr("Appel Video") button.onClicked: { @@ -208,6 +208,6 @@ ColumnLayout { Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 30 * DefaultStyle.dp + Layout.topMargin: Math.round(30 * DefaultStyle.dp) } } diff --git a/Linphone/view/Control/Container/Call/CallLayout.qml b/Linphone/view/Control/Container/Call/CallLayout.qml index 4885dfd3..5bb61f43 100644 --- a/Linphone/view/Control/Container/Call/CallLayout.qml +++ b/Linphone/view/Control/Container/Call/CallLayout.qml @@ -49,7 +49,7 @@ Item { id: callTerminatedText anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top - anchors.topMargin: 25 * DefaultStyle.dp + anchors.topMargin: Math.round(25 * DefaultStyle.dp) z: 1 visible: mainItem.callState === LinphoneEnums.CallState.End || mainItem.callState === LinphoneEnums.CallState.Error || mainItem.callState === LinphoneEnums.CallState.Released text: mainItem.conference @@ -61,8 +61,8 @@ Item { : call && call.core.lastErrorMessage || "" color: DefaultStyle.grey_0 font { - pixelSize: 22 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(22 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } @@ -78,21 +78,21 @@ Item { id: waitingForOthersComponent Rectangle { color: DefaultStyle.grey_600 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) ColumnLayout { anchors.centerIn: parent - spacing: 22 * DefaultStyle.dp + spacing: Math.round(22 * DefaultStyle.dp) width: waitText.implicitWidth Text { id: waitText text: qsTr("Waiting for other participants...") - Layout.preferredHeight: 67 * DefaultStyle.dp + Layout.preferredHeight: Math.round(67 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter color: DefaultStyle.grey_0 font { - pixelSize: 30 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(30 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } Item { @@ -141,16 +141,16 @@ Item { // text: qsTr("Waiting for other participants...") // color: DefaultStyle.frey_0 // font { - // pixelSize: 30 * DefaultStyle.dp - // weight: 300 * DefaultStyle.dp + // pixelSize: Math.round(30 * DefaultStyle.dp) + // weight: Math.round(300 * DefaultStyle.dp) // } // } // Button { // text: qsTr("Share invitation") // icon.source: AppIcons.shareNetwork // color: DefaultStyle.main2_400 - // Layout.preferredWidth: 206 * DefaultStyle.dp - // Layout.preferredHeight: 47 * DefaultStyle.dp + // Layout.preferredWidth: Math.round(206 * DefaultStyle.dp) + // Layout.preferredHeight: Math.round(47 * DefaultStyle.dp) // } // } diff --git a/Linphone/view/Control/Container/Call/Mosaic.qml b/Linphone/view/Control/Container/Call/Mosaic.qml index 7b706edf..756907fd 100644 --- a/Linphone/view/Control/Container/Call/Mosaic.qml +++ b/Linphone/view/Control/Container/Call/Mosaic.qml @@ -57,7 +57,7 @@ ColumnLayout{ GridView{ id: grid - property int margin: 10 * DefaultStyle.dp + property real margin: Math.round(10 * DefaultStyle.dp) property int itemCount: model.count ? model.count :( model.length ? model.length : 0) property int columns: 1 property int rows: 1 @@ -95,8 +95,8 @@ ColumnLayout{ cellHeight = Math.min(computedWidth, computedHeight) } onItemCountChanged: updateLayout() - property int computedWidth: (mainLayout.width - grid.margin ) / columns - property int computedHeight: (mainLayout.height - grid.margin ) / rows + property real computedWidth: (mainLayout.width - grid.margin ) / columns + property real computedHeight: (mainLayout.height - grid.margin ) / rows onComputedHeightChanged: Qt.callLater(updateCells) onComputedWidthChanged: Qt.callLater(updateCells) cellWidth: Math.min(computedWidth, computedHeight) diff --git a/Linphone/view/Control/Container/Carousel.qml b/Linphone/view/Control/Container/Carousel.qml index 871ee761..b79584b4 100644 --- a/Linphone/view/Control/Container/Carousel.qml +++ b/Linphone/view/Control/Container/Carousel.qml @@ -12,7 +12,7 @@ ColumnLayout { required property int itemsCount property int currentIndex: carouselStackLayout.currentIndex property var currentItem: carouselButton.itemAt(currentIndex) - spacing: 61 * DefaultStyle.dp + spacing: Math.round(61 * DefaultStyle.dp) function goToSlide(index) { carouselStackLayout.goToSlideAtIndex(index) @@ -67,9 +67,9 @@ ColumnLayout { Item { Rectangle { id: currentIndicator - width: 13 * DefaultStyle.dp - height: 8 * DefaultStyle.dp - radius: 30 * DefaultStyle.dp + width: Math.round(13 * DefaultStyle.dp) + height: Math.round(8 * DefaultStyle.dp) + radius: Math.round(30 * DefaultStyle.dp) color: DefaultStyle.main1_500_main z: 1 x: mainItem.currentIndex >= 0 && mainItem.currentItem ? mainItem.currentItem.x - width/2 + mainItem.currentItem.width/2 : 0 @@ -77,21 +77,21 @@ ColumnLayout { } RowLayout { id: carouselButtonsLayout - spacing: 7.5 * DefaultStyle.dp - anchors.leftMargin: 2.5 * DefaultStyle.dp + spacing: Math.round(7.5 * DefaultStyle.dp) + anchors.leftMargin: Math.round(2.5 * DefaultStyle.dp) Repeater { id: carouselButton model: mainItem.itemsCount delegate: Button { - Layout.preferredWidth: 8 * DefaultStyle.dp - Layout.preferredHeight: 8 * DefaultStyle.dp + Layout.preferredWidth: Math.round(8 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(8 * DefaultStyle.dp) topPadding: 0 bottomPadding: 0 leftPadding: 0 rightPadding: 0 background: Rectangle { color: DefaultStyle.main2_200 - radius: 30 * DefaultStyle.dp + radius: Math.round(30 * DefaultStyle.dp) anchors.fill: parent } onClicked: { diff --git a/Linphone/view/Control/Container/Contact/ContactLayout.qml b/Linphone/view/Control/Container/Contact/ContactLayout.qml index 57d51bec..bc938c3c 100644 --- a/Linphone/view/Control/Container/Contact/ContactLayout.qml +++ b/Linphone/view/Control/Container/Contact/ContactLayout.qml @@ -9,7 +9,7 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle ColumnLayout { id: mainItem - spacing: 30 * DefaultStyle.dp + spacing: Math.round(30 * DefaultStyle.dp) property FriendGui contact @@ -17,31 +17,31 @@ ColumnLayout { property alias content: detailLayout.data property alias bannerContent: bannerLayout.data property alias secondLineContent: verticalLayoutSecondLine.data - property int minimumWidthForSwitchintToRowLayout: 756 * DefaultStyle.dp - property var useVerticalLayout: width < minimumWidthForSwitchintToRowLayout * DefaultStyle.dp + property real minimumWidthForSwitchintToRowLayout: Math.round(756 * DefaultStyle.dp) + property var useVerticalLayout: width < minimumWidthForSwitchintToRowMath.round(Layout * DefaultStyle.dp) GridLayout { - Layout.leftMargin: 64 * DefaultStyle.dp - Layout.rightMargin: 64 * DefaultStyle.dp - Layout.topMargin: 56 * DefaultStyle.dp + Layout.leftMargin: Math.round(64 * DefaultStyle.dp) + Layout.rightMargin: Math.round(64 * DefaultStyle.dp) + Layout.topMargin: Math.round(56 * DefaultStyle.dp) Layout.fillWidth: true columns: mainItem.useVerticalLayout ? 1 : children.length rows: 1 - columnSpacing: 49 * DefaultStyle.dp - rowSpacing: 27 * DefaultStyle.dp + columnSpacing: Math.round(49 * DefaultStyle.dp) + rowSpacing: Math.round(27 * DefaultStyle.dp) RowLayout { - Layout.preferredWidth: 341 * DefaultStyle.dp + Layout.preferredWidth: Math.round(341 * DefaultStyle.dp) Control.Control { - // Layout.preferredWidth: 734 * DefaultStyle.dp + // Layout.preferredWidth: Math.round(734 * DefaultStyle.dp) Layout.fillWidth: true - width: 734 * DefaultStyle.dp - height: 100 * DefaultStyle.dp - rightPadding: 21 * DefaultStyle.dp + width: Math.round(734 * DefaultStyle.dp) + height: Math.round(100 * DefaultStyle.dp) + rightPadding: Math.round(21 * DefaultStyle.dp) background: GradientRectangle { anchors.fill: parent anchors.leftMargin: avatar.width / 2 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) borderGradient: Gradient { orientation: Gradient.Horizontal GradientStop { position: 0.0; color: DefaultStyle.grey_100 } @@ -55,12 +55,12 @@ ColumnLayout { } contentItem: RowLayout { id: bannerLayout - spacing: 32 * DefaultStyle.dp + spacing: Math.round(32 * DefaultStyle.dp) Avatar { id: avatar contact: mainItem.contact - Layout.preferredWidth: 100 * DefaultStyle.dp - Layout.preferredHeight: 100 * DefaultStyle.dp + Layout.preferredWidth: Math.round(100 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(100 * DefaultStyle.dp) } } } @@ -81,10 +81,10 @@ ColumnLayout { StackLayout { id: detailLayout Layout.alignment: Qt.AlignCenter - Layout.topMargin: mainItem.useVerticalLayout ? 0 : 30 * DefaultStyle.dp - Layout.leftMargin: 64 * DefaultStyle.dp - Layout.rightMargin: 64 * DefaultStyle.dp - Layout.bottomMargin: 53 * DefaultStyle.dp + Layout.topMargin: mainItem.useVerticalLayout ? 0 : Math.round(30 * DefaultStyle.dp) + Layout.leftMargin: Math.round(64 * DefaultStyle.dp) + Layout.rightMargin: Math.round(64 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(53 * DefaultStyle.dp) Layout.fillWidth: true Layout.fillHeight: true } diff --git a/Linphone/view/Control/Container/FormItemLayout.qml b/Linphone/view/Control/Container/FormItemLayout.qml index acd21222..ec41ba03 100644 --- a/Linphone/view/Control/Container/FormItemLayout.qml +++ b/Linphone/view/Control/Container/FormItemLayout.qml @@ -35,7 +35,7 @@ FocusScope{ ColumnLayout { id: layout - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) anchors.left: parent.left anchors.right: parent.right @@ -50,8 +50,8 @@ FocusScope{ textFormat: Text.RichText font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } diff --git a/Linphone/view/Control/Container/Main/MainRightPanel.qml b/Linphone/view/Control/Container/Main/MainRightPanel.qml index 3c80cc55..57755a4b 100644 --- a/Linphone/view/Control/Container/Main/MainRightPanel.qml +++ b/Linphone/view/Control/Container/Main/MainRightPanel.qml @@ -15,7 +15,7 @@ ColumnLayout { Rectangle { id: rightPanelHeader color: DefaultStyle.grey_0 - Layout.preferredHeight: 57 * DefaultStyle.dp + Layout.preferredHeight: Math.round(57 * DefaultStyle.dp) Layout.fillWidth: true z: 1 } diff --git a/Linphone/view/Control/Container/ScrollBar.qml b/Linphone/view/Control/Container/ScrollBar.qml index 4d168f0b..80d790a7 100644 --- a/Linphone/view/Control/Container/ScrollBar.qml +++ b/Linphone/view/Control/Container/ScrollBar.qml @@ -9,8 +9,8 @@ Control.ScrollBar { padding: 0 property color color: DefaultStyle.grey_850 contentItem: Rectangle { - implicitWidth: 6 * DefaultStyle.dp - radius: 32 * DefaultStyle.dp + implicitWidth: Math.round(6 * DefaultStyle.dp) + radius: Math.round(32 * DefaultStyle.dp) color: mainItem.color } } diff --git a/Linphone/view/Control/Container/Section.qml b/Linphone/view/Control/Container/Section.qml index 1e1e6657..25a378d1 100644 --- a/Linphone/view/Control/Container/Section.qml +++ b/Linphone/view/Control/Container/Section.qml @@ -7,23 +7,23 @@ Layout with line separator used in several views */ ColumnLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) property alias content: contentLayout.data property alias contentLayout: contentLayout - implicitHeight: contentLayout.implicitHeight + 1 * DefaultStyle.dp + spacing + implicitHeight: contentLayout.implicitHeight + Math.max(Math.round(1 * DefaultStyle.dp), 1) + spacing ColumnLayout { id: contentLayout - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) // width: parent.width // Layout.fillWidth: true // Layout.preferredHeight: childrenRect.height // Layout.preferredWidth: parent.width - // Layout.leftMargin: 8 * DefaultStyle.dp + // Layout.leftMargin: Math.round(8 * DefaultStyle.dp) } Rectangle { color: DefaultStyle.main2_200 Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) width: parent.width } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Container/TabBar.qml b/Linphone/view/Control/Container/TabBar.qml index 10e38906..c1e3f856 100644 --- a/Linphone/view/Control/Container/TabBar.qml +++ b/Linphone/view/Control/Container/TabBar.qml @@ -10,9 +10,9 @@ Control.TabBar { readonly property int originX: count > 0 ? itemAt(0).x : 0 - spacing: 40 * DefaultStyle.dp - property int pixelSize: 22 * DefaultStyle.dp - property int textWeight: 800 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) + property real pixelSize: Typography.h3.pixelSize + property real textWeight: Typography.h3.weight wheelEnabled: true background: Item { id: tabBarBackground @@ -20,7 +20,7 @@ Control.TabBar { Rectangle { id: barBG - height: 4 * DefaultStyle.dp + height: Math.round(4 * DefaultStyle.dp) color: DefaultStyle.grey_200 anchors.bottom: parent.bottom width: parent.width @@ -64,7 +64,7 @@ Control.TabBar { Rectangle { id: tabBackground visible: mainItem.currentIndex === index - height: 5 * DefaultStyle.dp + height: Math.round(5 * DefaultStyle.dp) color: DefaultStyle.main1_500_main anchors.bottom: parent.bottom anchors.left: parent.left @@ -93,7 +93,7 @@ Control.TabBar { elide: Text.ElideRight maximumLineCount: 1 text: modelData - bottomPadding: 5 * DefaultStyle.dp + bottomPadding: Math.round(5 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Container/VerticalTabBar.qml b/Linphone/view/Control/Container/VerticalTabBar.qml index c6cbb025..2113934d 100644 --- a/Linphone/view/Control/Container/VerticalTabBar.qml +++ b/Linphone/view/Control/Container/VerticalTabBar.qml @@ -8,8 +8,8 @@ import SettingsCpp Control.TabBar { id: mainItem - //spacing: 32 * DefaultStyle.dp - topPadding: 36 * DefaultStyle.dp + //spacing: Math.round(32 * DefaultStyle.dp) + topPadding: Math.round(36 * DefaultStyle.dp) property var model readonly property alias cornerRadius: bottomLeftCorner.radius @@ -39,8 +39,8 @@ Control.TabBar { id: unreadNotifications property int unread: 0 visible: unread > 0 - width: 15 * DefaultStyle.dp - height: 15 * DefaultStyle.dp + width: Math.round(15 * DefaultStyle.dp) + height: Math.round(15 * DefaultStyle.dp) radius: width/2 color: DefaultStyle.danger_500main Text{ @@ -50,7 +50,7 @@ Control.TabBar { horizontalAlignment: Text.AlignHCenter color: DefaultStyle.grey_0 fontSizeMode: Text.Fit - font.pixelSize: 15 * DefaultStyle.dp + font.pixelSize: Math.round(15 * DefaultStyle.dp) text: parent.unread > 100 ? '99+' : parent.unread } } @@ -78,7 +78,7 @@ Control.TabBar { id: bottomLeftCorner anchors.fill: parent color: DefaultStyle.main1_500_main - radius: 25 * DefaultStyle.dp + radius: Math.round(25 * DefaultStyle.dp) } Rectangle { color: DefaultStyle.main1_500_main @@ -101,8 +101,8 @@ Control.TabBar { id: tabButton width: mainItem.width height: visible && buttonIcon.isImageReady ? undefined : 0 - bottomInset: 32 * DefaultStyle.dp - topInset: 32 * DefaultStyle.dp + bottomInset: Math.round(32 * DefaultStyle.dp) + topInset: Math.round(32 * DefaultStyle.dp) hoverEnabled: true visible: modelData?.visible != undefined ? modelData?.visible : true UnreadNotification { @@ -114,7 +114,7 @@ Control.TabBar { ? defaultAccount.core?.unreadMessageNotifications || -1 : 0 anchors.right: parent.right - anchors.rightMargin: 15 * DefaultStyle.dp + anchors.rightMargin: Math.round(15 * DefaultStyle.dp) anchors.top: parent.top } MouseArea { @@ -125,7 +125,7 @@ Control.TabBar { contentItem: ColumnLayout { EffectImage { id: buttonIcon - property int buttonSize: mainItem.currentIndex !== index && tabButton.hovered ? 26 * DefaultStyle.dp : 24 * DefaultStyle.dp + property real buttonSize: mainItem.currentIndex !== index && tabButton.hovered ? Math.round(26 * DefaultStyle.dp) : Math.round(24 * DefaultStyle.dp) imageSource: mainItem.currentIndex === index ? modelData.selectedIcon : modelData.icon Layout.preferredWidth: buttonSize Layout.preferredHeight: buttonSize @@ -140,19 +140,19 @@ Control.TabBar { text: modelData.label font { weight: mainItem.currentIndex === index - ? 800 * DefaultStyle.dp + ? Math.round(800 * DefaultStyle.dp) : tabButton.hovered - ? 600 * DefaultStyle.dp - : 400 * DefaultStyle.dp - pixelSize: 11 * DefaultStyle.dp + ? Math.round(600 * DefaultStyle.dp) + : Math.round(400 * DefaultStyle.dp) + pixelSize: Math.round(11 * DefaultStyle.dp) } color: DefaultStyle.grey_0 Layout.fillWidth: true Layout.preferredHeight: txtMeter.height Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter - leftPadding: 3 * DefaultStyle.dp - rightPadding: 3 * DefaultStyle.dp + leftPadding: Math.round(3 * DefaultStyle.dp) + rightPadding: Math.round(3 * DefaultStyle.dp) } } TextMetrics { @@ -160,7 +160,7 @@ Control.TabBar { text: modelData.label font: buttonText.font Component.onCompleted: { - font.weight = 800 * DefaultStyle.dp + font.weight = Math.round(800 * DefaultStyle.dp) mainItem.implicitWidth = Math.max(mainItem.implicitWidth, advanceWidth + buttonIcon.buttonSize) } } diff --git a/Linphone/view/Control/Display/Call/CallHistoryListView.qml b/Linphone/view/Control/Display/Call/CallHistoryListView.qml index 967a8c89..2aa557cf 100644 --- a/Linphone/view/Control/Display/Call/CallHistoryListView.qml +++ b/Linphone/view/Control/Display/Call/CallHistoryListView.qml @@ -15,7 +15,7 @@ ListView { property SearchBar searchBar property bool loading: false property string searchText: searchBar?.text - property double busyIndicatorSize: 60 * DefaultStyle.dp + property real busyIndicatorSize: Math.round(60 * DefaultStyle.dp) signal resultsReceived @@ -33,14 +33,14 @@ ListView { onFilterTextChanged: maxDisplayItems = initialDisplayItems initialDisplayItems: Math.max( 20, - 2 * mainItem.height / (56 * DefaultStyle.dp)) + 2 * mainItem.height / (Math.round(56 * DefaultStyle.dp))) displayItemsStep: 3 * initialDisplayItems / 2 onModelReset: { mainItem.resultsReceived() } } flickDeceleration: 10000 - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Keys.onPressed: event => { if (event.key == Qt.Key_Escape) { @@ -123,12 +123,12 @@ ListView { property int lastMouseContainsIndex: -1 delegate: FocusScope { width: mainItem.width - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) RowLayout { z: 1 anchors.fill: parent - anchors.leftMargin: 10 * DefaultStyle.dp - spacing: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) + spacing: Math.round(10 * DefaultStyle.dp) Avatar { id: historyAvatar property var contactObj: UtilsCpp.findFriendByAddress( @@ -136,8 +136,8 @@ ListView { contact: contactObj?.value || null displayNameVal: modelData.core.displayName secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified - width: 45 * DefaultStyle.dp - height: 45 * DefaultStyle.dp + width: Math.round(45 * DefaultStyle.dp) + height: Math.round(45 * DefaultStyle.dp) isConference: modelData.core.isConference shadowEnabled: false asynchronous: false @@ -145,20 +145,20 @@ ListView { ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Text { id: friendAddress Layout.fillWidth: true maximumLineCount: 1 text: historyAvatar.displayNameVal font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight capitalization: Font.Capitalize } } RowLayout { - spacing: 6 * DefaultStyle.dp + spacing: Math.round(6 * DefaultStyle.dp) EffectImage { id: statusIcon imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined @@ -175,8 +175,8 @@ ListView { || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted || modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : modelData.core.isOutgoing ? DefaultStyle.info_500_main : DefaultStyle.success_500main - Layout.preferredWidth: 12 * DefaultStyle.dp - Layout.preferredHeight: 12 * DefaultStyle.dp + Layout.preferredWidth: Math.round(12 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(12 * DefaultStyle.dp) transform: Rotation { angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined @@ -195,8 +195,8 @@ ListView { // text: modelData.core.date text: UtilsCpp.formatDate(modelData.core.date) font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -232,7 +232,7 @@ ListView { Rectangle { anchors.fill: parent opacity: 0.7 - radius: 8 * DefaultStyle.dp + radius: Math.round(8 * DefaultStyle.dp) color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.main2_100 visible: mainItem.lastMouseContainsIndex === index diff --git a/Linphone/view/Control/Display/Call/CallListView.qml b/Linphone/view/Control/Display/Call/CallListView.qml index 2d2ba616..b340a45f 100644 --- a/Linphone/view/Control/Display/Call/CallListView.qml +++ b/Linphone/view/Control/Display/Call/CallListView.qml @@ -14,7 +14,7 @@ ListView { sourceModel: AppCpp.calls } implicitHeight: contentHeight - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) clip: true onCountChanged: forceLayout() @@ -24,13 +24,13 @@ ListView { property string currentRemoteAddress: callProxy.currentCall ? callProxy.currentCall.core.remoteAddress : "" delegate: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) width: mainItem.width - height: 45 * DefaultStyle.dp + height: Math.round(45 * DefaultStyle.dp) Avatar { id: delegateAvatar - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData.core.remoteAddress isConference: modelData.core.isConference shadowEnabled: false @@ -43,29 +43,29 @@ ListView { text: modelData.core.isConference ? modelData.core.conference.core.subject : remoteNameObj ? remoteNameObj.value : "" - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) Layout.fillWidth: true maximumLineCount: 1 } Text { id: callStateText property string type: modelData.core.isConference ? qsTr('Réunion') : qsTr('Appel') - Layout.rightMargin: 2 * DefaultStyle.dp + Layout.rightMargin: Math.round(2 * DefaultStyle.dp) text: modelData.core.state === LinphoneEnums.CallState.Paused || modelData.core.state === LinphoneEnums.CallState.PausedByRemote ? type + qsTr(" en pause") : type + qsTr(" en cours") font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } Item{Layout.fillWidth: true} Button { id: transferButton - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter visible: mainItem.isTransferList && mainItem.currentRemoteAddress !== modelData.core.remoteAddress icon.source: AppIcons.transferCall @@ -77,21 +77,21 @@ ListView { Button { id: pausingButton enabled: !(modelData.core.state === LinphoneEnums.CallState.PausedByRemote) - Layout.preferredWidth: 28 * DefaultStyle.dp - Layout.preferredHeight: 28 * DefaultStyle.dp + Layout.preferredWidth: Math.round(28 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter - leftPadding: 5 * DefaultStyle.dp - rightPadding: 5 * DefaultStyle.dp - topPadding: 5 * DefaultStyle.dp - bottomPadding: 5 * DefaultStyle.dp + leftPadding: Math.round(5 * DefaultStyle.dp) + rightPadding: Math.round(5 * DefaultStyle.dp) + topPadding: Math.round(5 * DefaultStyle.dp) + bottomPadding: Math.round(5 * DefaultStyle.dp) property bool pausedByUser: modelData.core.state === LinphoneEnums.CallState.Paused color: pausedByUser ? DefaultStyle.success_500main : DefaultStyle.grey_500 contentImageColor: DefaultStyle.grey_0 KeyNavigation.right: endCallButton KeyNavigation.left: endCallButton icon.source: pausedByUser ? AppIcons.play : AppIcons.pause - icon.width: 18 * DefaultStyle.dp - icon.height: 18 * DefaultStyle.dp + icon.width: Math.round(18 * DefaultStyle.dp) + icon.height: Math.round(18 * DefaultStyle.dp) onClicked: modelData.core.lSetPaused(!modelData.core.paused) TextMetrics { id: pauseMeter @@ -101,14 +101,14 @@ ListView { } SmallButton { id: endCallButton - Layout.preferredWidth: 38 * DefaultStyle.dp - Layout.preferredHeight: 28 * DefaultStyle.dp + Layout.preferredWidth: Math.round(38 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) style: ButtonStyle.phoneRed KeyNavigation.left: pausingButton KeyNavigation.right: pausingButton contentImageColor: DefaultStyle.grey_0 - icon.width: 18 * DefaultStyle.dp - icon.height: 18 * DefaultStyle.dp + icon.width: Math.round(18 * DefaultStyle.dp) + icon.height: Math.round(18 * DefaultStyle.dp) onClicked: { mainWindow.callTerminatedByUser = true mainWindow.endCall(modelData) diff --git a/Linphone/view/Control/Display/Call/CallStatistics.qml b/Linphone/view/Control/Display/Call/CallStatistics.qml index 03b42c02..40b24adb 100644 --- a/Linphone/view/Control/Display/Call/CallStatistics.qml +++ b/Linphone/view/Control/Display/Call/CallStatistics.qml @@ -8,63 +8,63 @@ ColumnLayout { id: mainItem property var call property string objectName: "statsPanel" - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) RoundedPane { Layout.fillWidth: true - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - topPadding: 13 * DefaultStyle.dp - bottomPadding: 13 * DefaultStyle.dp + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) + topPadding: Math.round(13 * DefaultStyle.dp) + bottomPadding: Math.round(13 * DefaultStyle.dp) - Layout.topMargin: 13 * DefaultStyle.dp - Layout.leftMargin: 16 * DefaultStyle.dp - Layout.rightMargin: 16 * DefaultStyle.dp + Layout.topMargin: Math.round(13 * DefaultStyle.dp) + Layout.leftMargin: Math.round(16 * DefaultStyle.dp) + Layout.rightMargin: Math.round(16 * DefaultStyle.dp) contentItem: ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Text { text: qsTr("Audio") Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Typography.p2.weight } } ColumnLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Text { text: mainItem.call ? mainItem.call.core.audioStats.codec : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.audioStats.bandwidth : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.audioStats.lossRate : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.audioStats.jitterBufferSize : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } @@ -72,68 +72,68 @@ ColumnLayout { } RoundedPane { Layout.fillWidth: true - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - topPadding: 13 * DefaultStyle.dp - bottomPadding: 13 * DefaultStyle.dp + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) + topPadding: Math.round(13 * DefaultStyle.dp) + bottomPadding: Math.round(13 * DefaultStyle.dp) - Layout.leftMargin: 16 * DefaultStyle.dp - Layout.rightMargin: 16 * DefaultStyle.dp + Layout.leftMargin: Math.round(16 * DefaultStyle.dp) + Layout.rightMargin: Math.round(16 * DefaultStyle.dp) visible: mainItem.call?.core.localVideoEnabled || mainItem.call?.core.remoteVideoEnabled || false contentItem: ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Text { text: qsTr("Vidéo") Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Typography.p2.weight } } ColumnLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Text { text: mainItem.call ? mainItem.call.core.videoStats.codec : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.videoStats.bandwidth : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.videoStats.lossRate : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.videoStats.resolution : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: mainItem.call ? mainItem.call.core.videoStats.fps : "" Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Display/Contact/AllContactListView.qml b/Linphone/view/Control/Display/Contact/AllContactListView.qml index d0e63967..3ae19f22 100644 --- a/Linphone/view/Control/Display/Contact/AllContactListView.qml +++ b/Linphone/view/Control/Display/Contact/AllContactListView.qml @@ -45,12 +45,12 @@ Flickable { property bool haveFavorites: false property bool haveContacts: count > 0 - property int sectionsPixelSize: 16 * DefaultStyle.dp - property int sectionsWeight: 800 * DefaultStyle.dp - property int sectionsSpacing: 18 * DefaultStyle.dp - property int busyIndicatorSize: 40 * DefaultStyle.dp + property real sectionsPixelSize: Typography.h4.pixelSize + property real sectionsWeight: Typography.h4.weight + property real sectionsSpacing: Math.round(18 * DefaultStyle.dp) + property real busyIndicatorSize: Math.round(40 * DefaultStyle.dp) - property int itemsRightMargin: 39 * DefaultStyle.dp + property real itemsRightMargin: Math.round(39 * DefaultStyle.dp) property int count: contactsList.count + suggestionsList.count + favoritesList.count contentHeight: contentsLayout.height @@ -235,7 +235,7 @@ Flickable { Control.ScrollBar.vertical: ScrollBar { id: scrollbar z: 1 - topPadding: 24 * DefaultStyle.dp // Avoid to be on top of collapse button + topPadding: Math.round(24 * DefaultStyle.dp) // Avoid to be on top of collapse button active: true interactive: true visible: mainItem.contentHeight > mainItem.height @@ -245,7 +245,7 @@ Flickable { ColumnLayout { id: contentsLayout width: mainItem.width - spacing: 0 //20 * DefaultStyle.dp + spacing: 0 //Math.round(20 * DefaultStyle.dp) BusyIndicator { id: busyIndicator @@ -307,7 +307,7 @@ Flickable { visible: contentHeight > 0 Layout.fillWidth: true Layout.preferredHeight: implicitHeight - Layout.topMargin: favoritesList.height > 0 ? 4 * DefaultStyle.dp : 0 + Layout.topMargin: favoritesList.height > 0 ? Math.round(4 * DefaultStyle.dp) : 0 interactive: false highlightText: mainItem.highlightText showActions: mainItem.showActions @@ -346,7 +346,7 @@ Flickable { || SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap | MagicSearchProxy.FilteringTypes.CardDAV : 0) initialDisplayItems: Math.max( 20, - 2 * mainItem.height / (63 * DefaultStyle.dp)) + 2 * mainItem.height / (Math.round(63 * DefaultStyle.dp))) displayItemsStep: 3 * initialDisplayItems / 2 onLocalFriendCreated: index => { contactsList.selectIndex(index) @@ -359,7 +359,7 @@ Flickable { Layout.fillWidth: true Layout.preferredHeight: implicitHeight Layout.topMargin: contactsList.height + favoritesList.height - > 0 ? 4 * DefaultStyle.dp : 0 + > 0 ? Math.round(4 * DefaultStyle.dp) : 0 interactive: false showInitials: false highlightText: mainItem.highlightText @@ -396,7 +396,7 @@ Flickable { && contactsList.expanded ? 0 : Math.max( 20, 2 * mainItem.height - / (63 * DefaultStyle.dp)) + / (Math.round(63 * DefaultStyle.dp))) onInitialDisplayItemsChanged: maxDisplayItems = initialDisplayItems displayItemsStep: 3 * initialDisplayItems / 2 onModelReset: maxDisplayItems = initialDisplayItems diff --git a/Linphone/view/Control/Display/Contact/Avatar.qml b/Linphone/view/Control/Display/Contact/Avatar.qml index 5204fe01..c2dac732 100644 --- a/Linphone/view/Control/Display/Contact/Avatar.qml +++ b/Linphone/view/Control/Display/Contact/Avatar.qml @@ -95,7 +95,7 @@ Loader{ z: 1 color: "transparent" border { - width: 2 * DefaultStyle.dp + width: Math.round(2 * DefaultStyle.dp) color: mainItem.secured ? DefaultStyle.info_500_main : DefaultStyle.danger_500main } EffectImage { @@ -136,7 +136,7 @@ Loader{ : DefaultStyle.main2_500main : "transparent" border { - width: 2 * DefaultStyle.dp + width: Math.round(2 * DefaultStyle.dp) color: DefaultStyle.grey_0 } } @@ -162,7 +162,7 @@ Loader{ text: initialItem.initials font { pixelSize: initialItem.height * 36 / 120 - weight: 800 * DefaultStyle.dp + weight: Typography.h4.weight capitalization: Font.AllUppercase } } diff --git a/Linphone/view/Control/Display/Contact/Contact.qml b/Linphone/view/Control/Display/Contact/Contact.qml index 9e147f22..28128817 100644 --- a/Linphone/view/Control/Display/Contact/Contact.qml +++ b/Linphone/view/Control/Display/Contact/Contact.qml @@ -11,7 +11,7 @@ import SettingsCpp Control.Control{ id: mainItem - padding: 10 * DefaultStyle.dp + padding: Math.round(10 * DefaultStyle.dp) property AccountGui account property color backgroundColor: DefaultStyle.grey_0 @@ -20,7 +20,7 @@ Control.Control{ signal edit() background: Rectangle { - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) color: mainItem.backgroundColor MouseArea{ id: mouseArea @@ -31,11 +31,11 @@ Control.Control{ contentItem: RowLayout{ spacing: 0 RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Avatar{ id: avatar - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) account: mainItem.account MouseArea{ anchors.fill: parent @@ -43,9 +43,9 @@ Control.Control{ } } Item { - Layout.preferredWidth: 200 * DefaultStyle.dp + Layout.preferredWidth: Math.round(200 * DefaultStyle.dp) Layout.fillHeight: true - Layout.rightMargin: 10 * DefaultStyle.dp + Layout.rightMargin: Math.round(10 * DefaultStyle.dp) ContactDescription{ id: description anchors.fill: parent @@ -55,18 +55,18 @@ Control.Control{ } Control.Control { id: registrationStatusItem - Layout.minimumWidth: 49 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - topPadding: 4 * DefaultStyle.dp - bottomPadding: 4 * DefaultStyle.dp - leftPadding: 8 * DefaultStyle.dp - rightPadding: 8 * DefaultStyle.dp - Layout.preferredWidth: text.implicitWidth + (2 * 8 * DefaultStyle.dp) + Layout.minimumWidth: Math.round(49 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + topPadding: Math.round(4 * DefaultStyle.dp) + bottomPadding: Math.round(4 * DefaultStyle.dp) + leftPadding: Math.round(8 * DefaultStyle.dp) + rightPadding: Math.round(8 * DefaultStyle.dp) + Layout.preferredWidth: text.implicitWidth + (2 * Math.round(8 * DefaultStyle.dp)) background: Rectangle{ id: registrationStatus anchors.fill: parent color: DefaultStyle.main2_200 - radius: 90 * DefaultStyle.dp + radius: Math.round(90 * DefaultStyle.dp) } contentItem: Text { id: text @@ -88,8 +88,8 @@ Control.Control{ // repeat: true // onTriggered: text.mode = (++text.mode) % 4 // } - font.weight: 300 * DefaultStyle.dp - font.pixelSize: 12 * DefaultStyle.dp + font.weight: Math.round(300 * DefaultStyle.dp) + font.pixelSize: Math.round(12 * DefaultStyle.dp) color: mode == 0 ? DefaultStyle.success_500main : mode == 1 @@ -107,31 +107,31 @@ Control.Control{ } } Item{ - Layout.preferredWidth: 26 * DefaultStyle.dp - Layout.preferredHeight: 26 * DefaultStyle.dp + Layout.preferredWidth: Math.round(26 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(26 * DefaultStyle.dp) Layout.fillHeight: true - Layout.leftMargin: 40 * DefaultStyle.dp + Layout.leftMargin: Math.round(40 * DefaultStyle.dp) visible: mainItem.account.core.unreadCallNotifications > 0 Rectangle{ id: unreadNotifications anchors.verticalCenter: parent.verticalCenter - width: 26 * DefaultStyle.dp - height: 26 * DefaultStyle.dp + width: Math.round(26 * DefaultStyle.dp) + height: Math.round(26 * DefaultStyle.dp) radius: width/2 color: DefaultStyle.danger_500main border.color: DefaultStyle.grey_0 - border.width: 2 * DefaultStyle.dp + border.width: Math.round(2 * DefaultStyle.dp) Text{ id: unreadCount anchors.fill: parent - anchors.margins: 2 * DefaultStyle.dp + anchors.margins: Math.round(2 * DefaultStyle.dp) verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter color: DefaultStyle.grey_0 minimumPixelSize: 5 fontSizeMode: Text.Fit - font.pixelSize: 11 * DefaultStyle.dp - font.weight: 700 * DefaultStyle.dp + font.pixelSize: Math.round(11 * DefaultStyle.dp) + font.weight: Math.round(700 * DefaultStyle.dp) text: mainItem.account.core.unreadCallNotifications >= 100 ? '99+' : mainItem.account.core.unreadCallNotifications } } @@ -144,10 +144,10 @@ Control.Control{ } } Voicemail { - Layout.leftMargin: 18 * DefaultStyle.dp - Layout.rightMargin: 20 * DefaultStyle.dp - Layout.preferredWidth: 30 * DefaultStyle.dp - Layout.preferredHeight: 26 * DefaultStyle.dp + Layout.leftMargin: Math.round(18 * DefaultStyle.dp) + Layout.rightMargin: Math.round(20 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(30 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(26 * DefaultStyle.dp) scaleFactor: 0.7 showMwi: mainItem.account.core.showMwi visible: mainItem.account.core.voicemailAddress.length > 0 || mainItem.account.core.showMwi @@ -163,11 +163,11 @@ Control.Control{ EffectImage { id: manageAccount imageSource: AppIcons.manageProfile - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter visible: !SettingsCpp.hideAccountSettings - width: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit colorizationColor: DefaultStyle.main2_500main MouseArea{ diff --git a/Linphone/view/Control/Display/Contact/ContactListItem.qml b/Linphone/view/Control/Display/Contact/ContactListItem.qml index 3fc22d3b..07df59be 100644 --- a/Linphone/view/Control/Display/Contact/ContactListItem.qml +++ b/Linphone/view/Control/Display/Contact/ContactListItem.qml @@ -10,7 +10,7 @@ import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle FocusScope { id: mainItem - implicitHeight: visible ? 56 * DefaultStyle.dp : 0 + implicitHeight: visible ? Math.round(56 * DefaultStyle.dp) : 0 property var searchResultItem property bool showInitials: true // Display Initials of Display name. property bool showDefaultAddress: true // Display address below display name. @@ -30,7 +30,7 @@ FocusScope { property var previousInitial // Use directly previous initial - property int itemsRightMargin: 39 * DefaultStyle.dp + property real itemsRightMargin: Math.round(39 * DefaultStyle.dp) property var displayName: searchResultItem.core.fullName property string initial: displayName ? displayName[0].toLocaleLowerCase( @@ -45,15 +45,15 @@ FocusScope { anchors.left: parent.left visible: mainItem.showInitials anchors.verticalCenter: parent.verticalCenter - anchors.rightMargin: 15 * DefaultStyle.dp + anchors.rightMargin: Math.round(15 * DefaultStyle.dp) verticalAlignment: Text.AlignVCenter - width: 20 * DefaultStyle.dp + width: Math.round(20 * DefaultStyle.dp) opacity: previousInitial != mainItem.initial ? 1 : 0 text: mainItem.initial color: DefaultStyle.main2_400 font { - pixelSize: 20 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) capitalization: Font.AllUppercase } } @@ -64,12 +64,12 @@ FocusScope { anchors.rightMargin: mainItem.itemsRightMargin anchors.top: parent.top anchors.bottom: parent.bottom - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) z: 1 Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp - Layout.leftMargin: 5 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.leftMargin: Math.round(5 * DefaultStyle.dp) contact: searchResultItem shadowEnabled: false } @@ -79,17 +79,15 @@ FocusScope { text: UtilsCpp.boldTextPart(mainItem.displayName, mainItem.highlightText) font { - pixelSize: mainItem.showDefaultAddress ? 16 * DefaultStyle.dp : 14 - * DefaultStyle.dp + pixelSize: mainItem.showDefaultAddress ? Typography.h4.pixelSize : Typography.p1.pixelSize capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase - weight: mainItem.showDefaultAddress ? 800 * DefaultStyle.dp : 400 - * DefaultStyle.dp + weight: mainItem.showDefaultAddress ? Typography.h4.weight : Typography.p1.weight } maximumLineCount: 1 Layout.fillWidth: true } Text { - Layout.topMargin: 2 * DefaultStyle.dp + Layout.topMargin: Math.round(2 * DefaultStyle.dp) Layout.fillWidth: true visible: mainItem.showDefaultAddress property string address: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(searchResultItem.core.defaultAddress) : searchResultItem.core.defaultAddress @@ -97,8 +95,8 @@ FocusScope { maximumLineCount: 1 elide: Text.ElideRight font { - weight: 300 * DefaultStyle.dp - pixelSize: 12 * DefaultStyle.dp + weight: Math.round(300 * DefaultStyle.dp) + pixelSize: Math.round(12 * DefaultStyle.dp) } } } @@ -110,37 +108,37 @@ FocusScope { asynchronous: true active: mainItem.showActions || mainItem.showContactMenu || mainItem.multiSelectionEnabled - Layout.rightMargin: active ? 10 * DefaultStyle.dp : 0 + Layout.rightMargin: active ? Math.round(10 * DefaultStyle.dp) : 0 sourceComponent: RowLayout { id: actionsRow z: 1 visible: actionButtons.visible || friendPopup.visible || mainItem.multiSelectionEnabled - spacing: visible ? 16 * DefaultStyle.dp : 0 + spacing: visible ? Math.round(16 * DefaultStyle.dp) : 0 enabled: visible EffectImage { id: isSelectedCheck visible: mainItem.multiSelectionEnabled && (mainItem.selectedContacts.indexOf( searchResultItem.core.defaultAddress) != -1) - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.check colorizationColor: DefaultStyle.main1_500_main } RowLayout { id: actionButtons visible: mainItem.showActions - spacing: visible ? 10 * DefaultStyle.dp : 0 + spacing: visible ? Math.round(10 * DefaultStyle.dp) : 0 IconButton { id: callButton - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.phone focus: visible - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) style: ButtonStyle.grey onClicked: UtilsCpp.createCall( searchResultItem.core.defaultFullAddress) @@ -150,13 +148,13 @@ FocusScope { IconButton { id: videoCallButton visible: SettingsCpp.videoEnabled - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.videoCamera focus: visible && !callButton.visible - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) style: ButtonStyle.grey onClicked: UtilsCpp.createCall( searchResultItem.core.defaultFullAddress, @@ -170,14 +168,14 @@ FocusScope { id: chatButton visible: actionButtons.visible && !SettingsCpp.disableChatFeature - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.chatTeardropText focus: visible && !callButton.visible && !videoCallButton.visible - radius: 40 * DefaultStyle.dp + radius: Math.round(40 * DefaultStyle.dp) style: ButtonStyle.grey KeyNavigation.left: videoCallButton KeyNavigation.right: callButton @@ -187,7 +185,7 @@ FocusScope { id: friendPopup z: 1 popup.x: 0 - popup.padding: 10 * DefaultStyle.dp + popup.padding: Math.round(10 * DefaultStyle.dp) visible: mainItem.showContactMenu && (contactArea.containsMouse || hovered || popup.opened) @@ -201,7 +199,7 @@ FocusScope { "Enlever des favoris") : qsTr( "Mettre en favori") icon.source: searchResultItem.core.starred ? AppIcons.heartFill : AppIcons.heart - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) textColor: DefaultStyle.main2_500main hoveredImageColor: searchResultItem.core.starred ? DefaultStyle.main1_700 : DefaultStyle.danger_700 contentImageColor: searchResultItem.core.starred ? DefaultStyle.danger_500main : DefaultStyle.main2_600 @@ -215,7 +213,7 @@ FocusScope { IconLabelButton { text: qsTr("Partager") icon.source: AppIcons.shareNetwork - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) textColor: DefaultStyle.main2_500main onClicked: { var vcard = searchResultItem.core.getVCard() @@ -242,7 +240,7 @@ FocusScope { IconLabelButton { text: qsTr("Supprimer") icon.source: AppIcons.trashCan - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) visible: !searchResultItem.core.readOnly onClicked: { mainItem.contactDeletionRequested( @@ -271,7 +269,7 @@ FocusScope { } Rectangle { anchors.fill: contactArea - radius: 8 * DefaultStyle.dp + radius: Math.round(8 * DefaultStyle.dp) opacity: 0.7 color: mainItem.isSelected ? DefaultStyle.main2_200 : DefaultStyle.main2_100 visible: mainItem.isLastHovered || mainItem.isSelected diff --git a/Linphone/view/Control/Display/Contact/ContactListView.qml b/Linphone/view/Control/Display/Contact/ContactListView.qml index 8dd69ad2..6c010da2 100644 --- a/Linphone/view/Control/Display/Contact/ContactListView.qml +++ b/Linphone/view/Control/Display/Contact/ContactListView.qml @@ -37,13 +37,13 @@ ListView { property bool haveFavorites: false property bool haveContacts: count > 0 - property int sectionsPixelSize: 16 * DefaultStyle.dp - property int sectionsWeight: 800 * DefaultStyle.dp - property int sectionsSpacing: 18 * DefaultStyle.dp + property real sectionsPixelSize: Typography.h4.pixelSize + property real sectionsWeight: Typography.h4.weight + property real sectionsSpacing: Math.round(18 * DefaultStyle.dp) - property int itemsRightMargin: 39 * DefaultStyle.dp + property real itemsRightMargin: Math.round(39 * DefaultStyle.dp) property bool expanded: true - property int headerHeight: headerItem?.height + property real headerHeight: headerItem?.height signal contactDeletionRequested(FriendGui contact) signal contactSelected(FriendGui contact) // Click/Space/Enter @@ -55,7 +55,7 @@ ListView { highlightFollowsCurrentItem: false cacheBuffer: 400 implicitHeight: contentHeight - spacing: expanded ? 4 * DefaultStyle.dp : 0 + spacing: expanded ? Math.round(4 * DefaultStyle.dp) : 0 property var _currentItemY: currentItem?.y on_CurrentItemYChanged: if(_currentItemY){ @@ -151,7 +151,7 @@ ListView { Item{// Do not use directly RowLayout : there is an issue where the layout doesn't update on visible Layout.fillWidth: true Layout.preferredHeight: mainItem.count > 0 ? headerTitleLayout.implicitHeight : 0 - Layout.bottomMargin: 4 * DefaultStyle.dp + Layout.bottomMargin: Math.round(4 * DefaultStyle.dp) RowLayout { id: headerTitleLayout anchors.fill: parent @@ -174,9 +174,9 @@ ListView { icon.source: mainItem.expanded ? AppIcons.upArrow : AppIcons.downArrow Layout.fillHeight: true Layout.preferredWidth: height - Layout.rightMargin: 23 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + Layout.rightMargin: Math.round(23 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) focus: true onClicked: mainItem.expanded = !mainItem.expanded } diff --git a/Linphone/view/Control/Display/Contact/Voicemail.qml b/Linphone/view/Control/Display/Contact/Voicemail.qml index f4f5b2ed..f63c4f5a 100644 --- a/Linphone/view/Control/Display/Contact/Voicemail.qml +++ b/Linphone/view/Control/Display/Contact/Voicemail.qml @@ -10,8 +10,8 @@ Rectangle{ id: mainItem property int voicemailCount: 0 property bool showMwi: false - width: 42 * DefaultStyle.dp * scaleFactor - height: 36 * DefaultStyle.dp * scaleFactor + width: Math.round(42 * DefaultStyle.dp) * scaleFactor + height: Math.round(36 * DefaultStyle.dp) * scaleFactor property real scaleFactor: 1.0 signal clicked() color: 'transparent' @@ -20,7 +20,7 @@ Rectangle{ anchors.left: parent.left icon.source: AppIcons.voicemail icon.color: DefaultStyle.main2_600 - width: 33 * DefaultStyle.dp * scaleFactor + width: Math.round(33 * DefaultStyle.dp) * scaleFactor height: width icon.width: width icon.height: width @@ -35,11 +35,11 @@ Rectangle{ Text { anchors.top: parent.top anchors.right: parent.right - width: 14 * DefaultStyle.dp * scaleFactor + width: Math.round(14 * DefaultStyle.dp) * scaleFactor height: width horizontalAlignment: Text.AlignHCenter - font.weight: 700 * DefaultStyle.dp - font.pixelSize: 13 * DefaultStyle.dp * scaleFactor + font.weight: Typography.p2.pixelSize + font.pixelSize: Typography.p2.weight * scaleFactor color: DefaultStyle.danger_500main text: voicemailCount >= 100 ? '99+' : voicemailCount visible: showMwi && voicemailCount > 0 @@ -51,12 +51,12 @@ Rectangle{ anchors.right: parent.right color: DefaultStyle.danger_500main visible: showMwi && voicemailCount == 0 - width: 14 * DefaultStyle.dp * scaleFactor + width: Math.round(14 * DefaultStyle.dp) * scaleFactor height: width radius: width / 2 EffectImage { anchors.fill: parent - anchors.margins: 1.5 * DefaultStyle.dp * scaleFactor + anchors.margins: Math.round(1.5 * DefaultStyle.dp) * scaleFactor imageSource: AppIcons.bellMwi colorizationColor: DefaultStyle.grey_0 } diff --git a/Linphone/view/Control/Display/EffectImage.qml b/Linphone/view/Control/Display/EffectImage.qml index c0516293..ce11f735 100644 --- a/Linphone/view/Control/Display/EffectImage.qml +++ b/Linphone/view/Control/Display/EffectImage.qml @@ -13,8 +13,8 @@ Loader { property var imageSource property var fillMode: Image.PreserveAspectFit property var colorizationColor - property int imageWidth: width - property int imageHeight: height + property real imageWidth: width + property real imageHeight: height property bool useColor: colorizationColor != undefined property bool shadowEnabled: false property bool isImageReady: false diff --git a/Linphone/view/Control/Display/GradientRectangle.qml b/Linphone/view/Control/Display/GradientRectangle.qml index 590c176d..7771afe0 100644 --- a/Linphone/view/Control/Display/GradientRectangle.qml +++ b/Linphone/view/Control/Display/GradientRectangle.qml @@ -3,11 +3,11 @@ import Linphone Item { id: mainItem - property int borderWidth: 1 * DefaultStyle.dp + property real borderWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1) property alias borderGradient: border.gradient property alias gradient: fill.gradient property alias color: fill.color - property int radius + property real radius Rectangle { id: border radius: mainItem.radius @@ -24,4 +24,4 @@ Item { radius: mainItem.radius } } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Display/Meeting/MeetingListView.qml b/Linphone/view/Control/Display/Meeting/MeetingListView.qml index df4b4764..e315d204 100644 --- a/Linphone/view/Control/Display/Meeting/MeetingListView.qml +++ b/Linphone/view/Control/Display/Meeting/MeetingListView.qml @@ -21,7 +21,7 @@ ListView { clip: true cacheBuffer: height/2 - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) highlightFollowsCurrentItem: false function selectIndex(index){ @@ -86,7 +86,7 @@ ListView { id: confInfoProxy filterText: searchBarText filterType: ConferenceInfoProxy.None - initialDisplayItems: Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp)) + initialDisplayItems: Math.max(20, 2 * mainItem.height / (Math.round(63 * DefaultStyle.dp))) displayItemsStep: initialDisplayItems/2 function selectData(confInfoGui){ mainItem.currentIndex = loadUntil(confInfoGui) @@ -105,7 +105,7 @@ ListView { ScrollBar.vertical: ScrollBar { id: scrollbar - rightPadding: 8 * DefaultStyle.dp + rightPadding: Math.round(8 * DefaultStyle.dp) active: true interactive: true @@ -115,14 +115,14 @@ ListView { section { criteria: ViewSection.FullString delegate: Text { - topPadding: 24 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp + topPadding: Math.round(24 * DefaultStyle.dp) + bottomPadding: Math.round(16 * DefaultStyle.dp) text: section - height: 29 * DefaultStyle.dp + topPadding + bottomPadding + height: Math.round(29 * DefaultStyle.dp) + topPadding + bottomPadding wrapMode: Text.NoWrap font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Math.round(800 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -131,7 +131,7 @@ ListView { delegate: FocusScope { id: itemDelegate - height: 63 * DefaultStyle.dp + (!isFirst && dateDay.visible ? topOffset : 0) + height: Math.round(63 * DefaultStyle.dp) + (!isFirst && dateDay.visible ? topOffset : 0) width: mainItem.width enabled: !isCanceled && haveModel @@ -143,7 +143,7 @@ ListView { property string dateString: UtilsCpp.toDateString(dateTime) property string previousDateString: previousConfInfoGui ? UtilsCpp.toDateString(previousConfInfoGui.core ? previousConfInfoGui.core.dateTime : UtilsCpp.getCurrentDateTime()) : '' property bool isFirst : ListView.previousSection !== ListView.section - property int topOffset: (dateDay.visible && !isFirst? 8 * DefaultStyle.dp : 0) + property real topOffset: (dateDay.visible && !isFirst? Math.round(8 * DefaultStyle.dp) : 0) property var endDateTime: itemGui.core ? itemGui.core.endDateTime : UtilsCpp.getCurrentDateTime() property bool haveModel: itemGui.core ? itemGui.core.haveModel : false property bool isCanceled: itemGui.core ? itemGui.core.state === LinphoneEnums.ConferenceInfoState.Cancelled : false @@ -155,34 +155,34 @@ ListView { anchors.topMargin: !itemDelegate.isFirst && dateDay.visible ? itemDelegate.topOffset : 0 spacing: 0 Item{ - Layout.preferredWidth: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) visible: !dateDay.visible } ColumnLayout { id: dateDay Layout.fillWidth: false - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.minimumWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 51 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.minimumWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(51 * DefaultStyle.dp) visible: previousDateString.length == 0 || previousDateString != dateString spacing: 0 Text { - Layout.preferredHeight: 19 * DefaultStyle.dp + Layout.preferredHeight: Math.round(19 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter text: day.substring(0,3) + '.' color: DefaultStyle.main2_500main wrapMode: Text.NoWrap elide: Text.ElideNone font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight capitalization: Font.Capitalize } } Rectangle { id: dayNum - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter radius: height/2 property var isCurrentDay: UtilsCpp.isCurrentDay(dateTime) @@ -197,48 +197,48 @@ ListView { color: dayNum.isCurrentDay ? DefaultStyle.grey_0 : DefaultStyle.main2_500main wrapMode: Text.NoWrap font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Math.round(800 * DefaultStyle.dp) } } } Item{Layout.fillHeight:true;Layout.fillWidth: true} } Item { - Layout.preferredWidth: 265 * DefaultStyle.dp - Layout.preferredHeight: 63 * DefaultStyle.dp - Layout.leftMargin: 23 * DefaultStyle.dp + Layout.preferredWidth: Math.round(265 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(63 * DefaultStyle.dp) + Layout.leftMargin: Math.round(23 * DefaultStyle.dp) Rectangle { id: conferenceInfoDelegate anchors.fill: parent anchors.rightMargin: 5 // margin to avoid clipping shadows at right - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) visible: itemDelegate.haveModel || itemDelegate.activeFocus color: itemDelegate.isSelected ? DefaultStyle.main2_200 : DefaultStyle.grey_0 // mainItem.currentIndex === index ColumnLayout { anchors.fill: parent anchors.left: parent.left - anchors.leftMargin: 16 * DefaultStyle.dp - anchors.rightMargin: 16 * DefaultStyle.dp - anchors.topMargin: 10 * DefaultStyle.dp - anchors.bottomMargin: 10 * DefaultStyle.dp - spacing: 2 * DefaultStyle.dp + anchors.leftMargin: Math.round(16 * DefaultStyle.dp) + anchors.rightMargin: Math.round(16 * DefaultStyle.dp) + anchors.topMargin: Math.round(10 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(10 * DefaultStyle.dp) + spacing: Math.round(2 * DefaultStyle.dp) visible: itemDelegate.haveModel RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.usersThree colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } Text { text: itemGui.core? itemGui.core.subject : "" Layout.fillWidth: true maximumLineCount: 1 font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } } @@ -246,8 +246,8 @@ ListView { text: itemDelegate.isCanceled ? qsTr("Réunion annulée") : UtilsCpp.toDateHourString(dateTime) + " - " + UtilsCpp.toDateHourString(endDateTime) color: itemDelegate.isCanceled ? DefaultStyle.danger_500main : DefaultStyle.main2_500main font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } @@ -262,16 +262,16 @@ ListView { } Text { anchors.fill: parent - anchors.rightMargin: 5 * DefaultStyle.dp // margin to avoid clipping shadows at right - anchors.leftMargin: 16 * DefaultStyle.dp + anchors.rightMargin: Math.round(5 * DefaultStyle.dp) // margin to avoid clipping shadows at right + anchors.leftMargin: Math.round(16 * DefaultStyle.dp) verticalAlignment: Text.AlignVCenter visible: !itemDelegate.haveModel text: qsTr("Aucune réunion aujourd'hui") lineHeightMode: Text.FixedHeight - lineHeight: 17.71 * DefaultStyle.dp + lineHeight: Math.round(18 * DefaultStyle.dp) font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } MouseArea { diff --git a/Linphone/view/Control/Display/Participant/ParticipantDeviceListView.qml b/Linphone/view/Control/Display/Participant/ParticipantDeviceListView.qml index ffa9d728..2151b280 100644 --- a/Linphone/view/Control/Display/Participant/ParticipantDeviceListView.qml +++ b/Linphone/view/Control/Display/Participant/ParticipantDeviceListView.qml @@ -10,8 +10,8 @@ ListView { height: contentHeight visible: contentHeight > 0 clip: true - rightMargin: 5 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + rightMargin: Math.round(5 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) property string searchBarText @@ -31,27 +31,27 @@ ListView { } delegate: Item { - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) width: mainItem.width RowLayout { id: participantDelegate anchors.left: parent.left - anchors.leftMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) anchors.right: parent.right - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) z: 1 Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData.core.address shadowEnabled: false } Text { text: modelData.core.displayName - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase maximumLineCount: 1 Layout.fillWidth: true diff --git a/Linphone/view/Control/Display/Participant/ParticipantListView.qml b/Linphone/view/Control/Display/Participant/ParticipantListView.qml index 2fc93e95..e0aeec56 100644 --- a/Linphone/view/Control/Display/Participant/ParticipantListView.qml +++ b/Linphone/view/Control/Display/Participant/ParticipantListView.qml @@ -11,8 +11,8 @@ ListView { height: contentHeight visible: contentHeight > 0 clip: true - rightMargin: 5 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + rightMargin: Math.round(5 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) property string searchBarText @@ -36,27 +36,27 @@ ListView { } delegate: Item { - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) width: mainItem.width RowLayout { id: participantDelegate anchors.left: parent.left - anchors.leftMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) anchors.right: parent.right - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) z: 1 Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData.core.sipAddress shadowEnabled: false } Text { text: modelData.core.displayName - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase maximumLineCount: 1 Layout.fillWidth: true @@ -67,8 +67,8 @@ ListView { text: qsTr("Admin") color: DefaultStyle.main2_400 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } RowLayout { @@ -77,15 +77,15 @@ ListView { onIsMeChanged: if (isMe) mainItem.me = modelData enabled: mainItem.isMeAdmin && !modelData.core.isMe opacity: enabled ? 1.0 : 0 - spacing: 26 * DefaultStyle.dp + spacing: Math.round(26 * DefaultStyle.dp) Switch { Component.onCompleted: if (modelData.core.isAdmin) toggle() //TODO : Utilser checked et onToggled (pas compris) onToggled: participantModel.setParticipantAdminStatus(modelData.core, position === 1) } SmallButton { - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) color: DefaultStyle.main2_100 style: ButtonStyle.hoveredBackground icon.source: AppIcons.closeX @@ -98,14 +98,14 @@ ListView { footer: Rectangle { color: DefaultStyle.grey_100 visible: mainItem.isMeAdmin - height: 74 * DefaultStyle.dp + height: Math.round(74 * DefaultStyle.dp) width: mainItem.width MediumButton { anchors.centerIn: parent - height: 40 * DefaultStyle.dp + height: Math.round(40 * DefaultStyle.dp) icon.source: AppIcons.plusCircle - icon.width: 16 * DefaultStyle.dp - icon.height: 16 * DefaultStyle.dp + icon.width: Math.round(16 * DefaultStyle.dp) + icon.height: Math.round(16 * DefaultStyle.dp) text: qsTr("Ajouter des participants") style: ButtonStyle.secondary onClicked: mainItem.addParticipantRequested() diff --git a/Linphone/view/Control/Display/ProgressBar.qml b/Linphone/view/Control/Display/ProgressBar.qml index a82ee21a..19fb799e 100644 --- a/Linphone/view/Control/Display/ProgressBar.qml +++ b/Linphone/view/Control/Display/ProgressBar.qml @@ -5,29 +5,29 @@ import Linphone ProgressBar { id: mainItem - padding: 3 * DefaultStyle.dp + padding: Math.round(3 * DefaultStyle.dp) property color backgroundColor: DefaultStyle.main2_100 property color innerColor: DefaultStyle.info_500_main property color innerTextColor: centeredText ? DefaultStyle.info_500_main : DefaultStyle.grey_0 property bool innerTextVisible: true property string innerText: Number.parseFloat(value*100).toFixed(0) + "%" - property int barWidth: mainItem.visualPosition * mainItem.width + property real barWidth: mainItem.visualPosition * mainItem.width property bool centeredText: textSize.width >= barWidth TextMetrics{ id: textSize text: mainItem.innerText font { - pixelSize: 10 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(10 * DefaultStyle.dp) + weight: Math.round(700 * DefaultStyle.dp) bold: true } } background: Rectangle { color: mainItem.backgroundColor - radius: 50 * DefaultStyle.dp + radius: Math.round(50 * DefaultStyle.dp) anchors.fill: mainItem width: mainItem.width height: mainItem.height @@ -37,7 +37,7 @@ ProgressBar { Rectangle { id: bar color: mainItem.innerColor - radius: 50 * DefaultStyle.dp + radius: Math.round(50 * DefaultStyle.dp) width: mainItem.barWidth height: parent.height } @@ -51,8 +51,8 @@ ProgressBar { color: mainItem.innerTextColor maximumLineCount: 1 font { - pixelSize: 10 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(10 * DefaultStyle.dp) + weight: Math.round(700 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Display/RoundedPane.qml b/Linphone/view/Control/Display/RoundedPane.qml index ab67ede9..5181578d 100644 --- a/Linphone/view/Control/Display/RoundedPane.qml +++ b/Linphone/view/Control/Display/RoundedPane.qml @@ -4,12 +4,12 @@ import Linphone Control.Control { id: mainItem - // width: 360 * DefaultStyle.dp + // width: Math.round(360 * DefaultStyle.dp) property color backgroundColor: DefaultStyle.grey_0 - padding: 10 * DefaultStyle.dp + padding: Math.round(10 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) color: mainItem.backgroundColor } } diff --git a/Linphone/view/Control/Display/Settings/SettingsMenuItem.qml b/Linphone/view/Control/Display/Settings/SettingsMenuItem.qml index d9a9cb1d..e11d6c2f 100644 --- a/Linphone/view/Control/Display/Settings/SettingsMenuItem.qml +++ b/Linphone/view/Control/Display/Settings/SettingsMenuItem.qml @@ -7,7 +7,7 @@ import Linphone Item { id: mainItem - height: visible ? 50 * DefaultStyle.dp : 0 + height: visible ? Math.round(50 * DefaultStyle.dp) : 0 anchors.right: parent.right anchors.left: parent.left @@ -30,15 +30,15 @@ Item { id: background anchors.fill: parent color: DefaultStyle.main2_200 - radius: 35 * DefaultStyle.dp + radius: Math.round(35 * DefaultStyle.dp) visible: parent.containsMouse || isSelected || mainItem.shadowEnabled } Rectangle { id: backgroundRightFiller anchors.right: parent.right color: DefaultStyle.main2_200 - width: 35 * DefaultStyle.dp - height: 50 * DefaultStyle.dp + width: Math.round(35 * DefaultStyle.dp) + height: Math.round(50 * DefaultStyle.dp) visible: parent.containsMouse || isSelected } // MultiEffect { diff --git a/Linphone/view/Control/Display/Sticker.qml b/Linphone/view/Control/Display/Sticker.qml index 5db38d3d..d9b3e68b 100644 --- a/Linphone/view/Control/Display/Sticker.qml +++ b/Linphone/view/Control/Display/Sticker.qml @@ -25,7 +25,7 @@ Item { property bool displayBorder : participantDevice && participantDevice.core.isSpeaking || false property alias displayPresence: avatar.displayPresence property color color: DefaultStyle.grey_600 - property int radius: 15 * DefaultStyle.dp + property real radius: Math.round(15 * DefaultStyle.dp) property bool remoteIsPaused: participantDevice ? participantDevice.core.isPaused : previewEnabled @@ -70,15 +70,15 @@ Item { radius: mainItem.radius anchors.fill: parent border.color: DefaultStyle.main2_200 - border.width: mainItem.displayBorder ? 3 * DefaultStyle.dp : 0 - property int minSize: Math.min(height, width) + border.width: mainItem.displayBorder ? Math.round(3 * DefaultStyle.dp) : 0 + property real minSize: Math.min(height, width) Item { id: noCameraLayout anchors.fill: parent visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady ColumnLayout { anchors.top: parent.top - anchors.topMargin: 81 * DefaultStyle.dp + anchors.topMargin: Math.round(81 * DefaultStyle.dp) anchors.horizontalCenter: parent.horizontalCenter // Layout.alignment: Qt.AlignHCenter |Qt.AlignTop spacing: 0 @@ -90,8 +90,8 @@ Item { BusyIndicator { indicatorColor: DefaultStyle.main2_100 Layout.alignment: Qt.AlignHCenter - indicatorHeight: 42 * DefaultStyle.dp - indicatorWidth: 42 * DefaultStyle.dp + indicatorHeight: Math.round(42 * DefaultStyle.dp) + indicatorWidth: Math.round(42 * DefaultStyle.dp) } } Item{ @@ -100,7 +100,7 @@ Item { anchors.centerIn: parent height: mainItem.conference ? background.minSize * 142 / 372 - : 120 * DefaultStyle.dp + : Math.round(120 * DefaultStyle.dp) width: height Avatar{ id: avatar @@ -117,29 +117,29 @@ Item { spacing: 0 visible: mainItem.participantDevice && (mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Joining || mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Alerting) || false BusyIndicator { - Layout.preferredHeight: 42 * DefaultStyle.dp + Layout.preferredHeight: Math.round(42 * DefaultStyle.dp) indicatorColor: DefaultStyle.main2_100 Layout.alignment: Qt.AlignHCenter - indicatorHeight: 42 * DefaultStyle.dp - indicatorWidth: 42 * DefaultStyle.dp + indicatorHeight: Math.round(42 * DefaultStyle.dp) + indicatorWidth: Math.round(42 * DefaultStyle.dp) } Text { - Layout.preferredHeight: 27 * DefaultStyle.dp - Layout.topMargin: 15 * DefaultStyle.dp // (84-27)-42 + Layout.preferredHeight: Math.round(27 * DefaultStyle.dp) + Layout.topMargin: Math.round(15 * DefaultStyle.dp) // (84-27)-42 text: qsTr('rejoint...') color: DefaultStyle.grey_0 Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter font { - pixelSize: 20 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } } ColumnLayout { anchors.centerIn: parent - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) visible: mainItem.remoteIsPaused EffectImage { imageSource: AppIcons.pause @@ -153,8 +153,8 @@ Item { Layout.alignment: Qt.AlignHCenter text: qsTr("En pause") font { - pixelSize: 20 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } @@ -162,7 +162,7 @@ Item { spacing: 0 visible: mainItem.displayAll && !mainItem.remoteIsPaused && !mainItem.conference anchors.top: centerItem.bottom - anchors.topMargin: 21 * DefaultStyle.dp + anchors.topMargin: Math.round(21 * DefaultStyle.dp) anchors.left: parent.left anchors.right: parent.right Text { @@ -171,8 +171,8 @@ Item { text: mainItem.displayName color: DefaultStyle.grey_0 font { - pixelSize: 22 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(22 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -183,8 +183,8 @@ Item { text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_text) : _text color: DefaultStyle.grey_0 font { - pixelSize: 14 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -248,9 +248,9 @@ Item { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - anchors.leftMargin: 10 * DefaultStyle.dp - anchors.rightMargin: 10 * DefaultStyle.dp - anchors.bottomMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(10 * DefaultStyle.dp) width: implicitWidth maximumLineCount: 1 property string _text: mainItem.displayName != '' @@ -261,8 +261,8 @@ Item { text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_text) : _text color: DefaultStyle.grey_0 font { - pixelSize: 14 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } @@ -279,22 +279,22 @@ Item { RowLayout{ anchors.right: parent.right anchors.top: parent.top - anchors.rightMargin: 8 * DefaultStyle.dp - anchors.topMargin: 8 * DefaultStyle.dp + anchors.rightMargin: Math.round(8 * DefaultStyle.dp) + anchors.topMargin: Math.round(8 * DefaultStyle.dp) - height: 18 * DefaultStyle.dp + height: Math.round(18 * DefaultStyle.dp) spacing: 0 Rectangle { id: muteIcon - Layout.preferredWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) - Layout.preferredHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) + Layout.preferredWidth: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp)) + Layout.preferredHeight: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp)) visible: mainItem.mutedStatus color: DefaultStyle.grey_0 radius: width /2 EffectImage { anchors.centerIn: parent - imageWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) - imageHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) + imageWidth: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp)) + imageHeight: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp)) imageSource: AppIcons.microphoneSlash colorizationColor: DefaultStyle.main2_500main } diff --git a/Linphone/view/Control/Display/TemporaryText.qml b/Linphone/view/Control/Display/TemporaryText.qml index 8a4d8474..f555bfc0 100644 --- a/Linphone/view/Control/Display/TemporaryText.qml +++ b/Linphone/view/Control/Display/TemporaryText.qml @@ -20,8 +20,8 @@ Text { } } font { - pixelSize: 13 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Typography.b3.pixelSize + weight: Typography.b3.weight } Timer { id: autoHideErrorMessage diff --git a/Linphone/view/Control/Display/Text.qml b/Linphone/view/Control/Display/Text.qml index 39549530..e302daef 100644 --- a/Linphone/view/Control/Display/Text.qml +++ b/Linphone/view/Control/Display/Text.qml @@ -8,8 +8,8 @@ Quick.Text { width: txtMeter.advanceWidth font { family: DefaultStyle.defaultFont - pixelSize: 10 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Math.round(10 * DefaultStyle.dp) + weight: Typography.p1.weight bold: true } color: DefaultStyle.main2_600 diff --git a/Linphone/view/Control/Display/ToolTip.qml b/Linphone/view/Control/Display/ToolTip.qml index 437c5e5e..d6df05e9 100644 --- a/Linphone/view/Control/Display/ToolTip.qml +++ b/Linphone/view/Control/Display/ToolTip.qml @@ -10,7 +10,7 @@ Control.ToolTip { id: tooltipBackground opacity: 0.7 color: DefaultStyle.main2_200 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } contentItem: Text { text: mainItem.text diff --git a/Linphone/view/Control/Form/Call/ChangeLayoutForm.qml b/Linphone/view/Control/Form/Call/ChangeLayoutForm.qml index a0d3f6c6..40a63b57 100644 --- a/Linphone/view/Control/Form/Call/ChangeLayoutForm.qml +++ b/Linphone/view/Control/Form/Call/ChangeLayoutForm.qml @@ -12,15 +12,15 @@ FocusScope { ColumnLayout { anchors.fill: parent - anchors.topMargin: 16 * DefaultStyle.dp - anchors.bottomMargin: 16 * DefaultStyle.dp - anchors.leftMargin: 17 * DefaultStyle.dp - anchors.rightMargin: 17 * DefaultStyle.dp - spacing: 12 * DefaultStyle.dp + anchors.topMargin: Math.round(16 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) + anchors.leftMargin: Math.round(17 * DefaultStyle.dp) + anchors.rightMargin: Math.round(17 * DefaultStyle.dp) + spacing: Math.round(12 * DefaultStyle.dp) // Text { // Layout.fillWidth: true // text: qsTr("La disposition choisie sera enregistrée pour vos prochaines réunions") - // font.pixelSize: 14 * DefaultStyle.dp + // font.pixelSize: Math.round(14 * DefaultStyle.dp) // color: DefaultStyle.main2_500main // } RoundedPane { @@ -37,9 +37,9 @@ FocusScope { id: radiobutton checkOnClick: false color: DefaultStyle.main1_500_main - indicatorSize: 20 * DefaultStyle.dp + indicatorSize: Math.round(20 * DefaultStyle.dp) leftPadding: indicator.width + spacing - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) checkable: false // Qt Documentation is wrong: It is true by default. We don't want to change the checked state if the layout change is not effective. checked: index == 0 ? mainItem.conferenceLayout === LinphoneEnums.ConferenceLayout.Grid @@ -49,11 +49,11 @@ FocusScope { onClicked: mainItem.changeLayoutRequested(index) contentItem: RowLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) EffectImage { id: radioButtonImg - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) imageSource: modelData.imgUrl colorizationColor: DefaultStyle.main2_500main } @@ -61,7 +61,7 @@ FocusScope { text: modelData.text color: DefaultStyle.main2_500main verticalAlignment: Text.AlignVCenter - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) Layout.fillWidth: true } } @@ -71,4 +71,4 @@ FocusScope { } Item {Layout.fillHeight: true} } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Form/Login/LoginForm.qml b/Linphone/view/Control/Form/Login/LoginForm.qml index dba119ba..8481b53e 100644 --- a/Linphone/view/Control/Form/Login/LoginForm.qml +++ b/Linphone/view/Control/Form/Login/LoginForm.qml @@ -7,18 +7,18 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle ColumnLayout { id: mainItem - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) FormItemLayout { id: username - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) label: qsTr("Nom d'utilisateur") mandatory: true enableErrorText: true contentItem: TextField { id: usernameEdit - Layout.preferredWidth: 360 * DefaultStyle.dp - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) isError: username.errorTextVisible || (errorText.isVisible && text.length > 0) } } @@ -26,14 +26,14 @@ ColumnLayout { Layout.preferredHeight: password.implicitHeight FormItemLayout { id: password - width: 346 * DefaultStyle.dp + width: Math.round(346 * DefaultStyle.dp) label: qsTr("Mot de passe") mandatory: true enableErrorText: true contentItem: TextField { id: passwordEdit - Layout.preferredWidth: 360 * DefaultStyle.dp - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) isError: password.errorTextVisible || (errorText.isVisible && text.length > 0) hidden: true } @@ -53,8 +53,8 @@ ColumnLayout { } RowLayout { - Layout.topMargin: 7 * DefaultStyle.dp - spacing: 29 * DefaultStyle.dp + Layout.topMargin: Math.round(7 * DefaultStyle.dp) + spacing: Math.round(29 * DefaultStyle.dp) BigButton { id: connectionButton style: ButtonStyle.main @@ -67,8 +67,8 @@ ColumnLayout { verticalAlignment: Text.AlignVCenter font { - pixelSize: 18 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Typography.b1.pixelSize + weight: Typography.b1.weight } color: DefaultStyle.grey_0 } diff --git a/Linphone/view/Control/Form/Settings/EncryptionSettings.qml b/Linphone/view/Control/Form/Settings/EncryptionSettings.qml index 27e6330d..ff7c00f4 100644 --- a/Linphone/view/Control/Form/Settings/EncryptionSettings.qml +++ b/Linphone/view/Control/Form/Settings/EncryptionSettings.qml @@ -11,30 +11,30 @@ ColumnLayout { property var call RoundedPane { Layout.fillWidth: true - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - topPadding: 13 * DefaultStyle.dp - bottomPadding: 13 * DefaultStyle.dp + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(16 * DefaultStyle.dp) + topPadding: Math.round(13 * DefaultStyle.dp) + bottomPadding: Math.round(13 * DefaultStyle.dp) contentItem: ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) Text { text: qsTr("Chiffrement :") Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Typography.p2.weight } } ColumnLayout { Layout.alignment: Qt.AlignHCenter - spacing: 7 * DefaultStyle.dp + spacing: Math.round(7 * DefaultStyle.dp) Text { property bool isPostQuantum: mainItem.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && mainItem.call.core.zrtpStats.isPostQuantum text: qsTr("Chiffrement du média : %1%2").arg(isPostQuantum ? "post Quantum " : "").arg(mainItem.call.core.encryptionString) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } ColumnLayout { @@ -43,40 +43,40 @@ ColumnLayout { text: qsTr("Cipher algorithm : %1").arg(mainItem.call && mainItem.call.core.zrtpStats.cipherAlgo) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: qsTr("Key agreement algorithm : %1").arg(mainItem.call && mainItem.call.core.zrtpStats.keyAgreementAlgo) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: qsTr("Hash algorithm : %1").arg(mainItem.call && mainItem.call.core.zrtpStats.hashAlgo) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: qsTr("Authentication algorithm : %1").arg(mainItem.call && mainItem.call.core.zrtpStats.authenticationAlgo) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } Text { text: qsTr("SAS algorithm : %1").arg(mainItem.call && mainItem.call.core.zrtpStats.sasAlgo) Layout.alignment: Qt.AlignHCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } @@ -89,9 +89,9 @@ ColumnLayout { Layout.fillWidth: true text: qsTr("Validation chiffrement") onClicked: mainItem.encryptionValidationRequested() - Layout.bottomMargin: 13 * DefaultStyle.dp - Layout.leftMargin: 16 * DefaultStyle.dp - Layout.rightMargin: 16 * DefaultStyle.dp + Layout.bottomMargin: Math.round(13 * DefaultStyle.dp) + Layout.leftMargin: Math.round(16 * DefaultStyle.dp) + Layout.rightMargin: Math.round(16 * DefaultStyle.dp) style: ButtonStyle.main } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Form/Settings/MultimediaSettings.qml b/Linphone/view/Control/Form/Settings/MultimediaSettings.qml index b45b89c8..fcb3496c 100644 --- a/Linphone/view/Control/Form/Settings/MultimediaSettings.qml +++ b/Linphone/view/Control/Form/Settings/MultimediaSettings.qml @@ -13,31 +13,31 @@ ColumnLayout { property string microDevice: inputAudioDeviceCBox.currentText property bool ringerDevicesVisible: false property bool backgroundVisible: true - spacing: 40 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) RoundedPane { background.visible: mainItem.backgroundVisible Layout.alignment: Qt.AlignHCenter height: contentItem.implicitHeight + topPadding + bottomPadding Layout.fillWidth: true - topPadding: background.visible ? 25 * DefaultStyle.dp : 0 - bottomPadding: background.visible ? 25 * DefaultStyle.dp : 0 - leftPadding: background.visible ? 25 * DefaultStyle.dp : 0 - rightPadding: background.visible ? 25 * DefaultStyle.dp : 0 + topPadding: background.visible ? Math.round(25 * DefaultStyle.dp) : 0 + bottomPadding: background.visible ? Math.round(25 * DefaultStyle.dp) : 0 + leftPadding: background.visible ? Math.round(25 * DefaultStyle.dp) : 0 + rightPadding: background.visible ? Math.round(25 * DefaultStyle.dp) : 0 contentItem: ColumnLayout { spacing: mainItem.spacing ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) visible: mainItem.ringerDevicesVisible RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.bellRinger colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) } Text { text: qsTr("Sonnerie - Appels entrants") @@ -48,7 +48,7 @@ ColumnLayout { } ComboSetting { Layout.fillWidth: true - Layout.topMargin: 12 * DefaultStyle.dp + Layout.topMargin: Math.round(12 * DefaultStyle.dp) Layout.preferredWidth: parent.width entries: SettingsCpp.ringerDevices propertyName: "ringerDevice" @@ -60,16 +60,16 @@ ColumnLayout { } } ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.speaker colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) } Text { text: qsTr("Haut-parleurs") @@ -81,7 +81,7 @@ ColumnLayout { id: outputAudioDeviceCBox Layout.fillWidth: true Layout.preferredWidth: parent.width - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) entries: SettingsCpp.playbackDevices propertyName: "playbackDevice" propertyOwner: SettingsCpp @@ -107,16 +107,16 @@ ColumnLayout { } } ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.microphone colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) } Text { text: qsTr("Microphone") @@ -128,7 +128,7 @@ ColumnLayout { id: inputAudioDeviceCBox Layout.fillWidth: true Layout.preferredWidth: parent.width - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) entries: SettingsCpp.captureDevices propertyName: "captureDevice" propertyOwner: SettingsCpp @@ -165,16 +165,16 @@ ColumnLayout { id: audioTestSlider Layout.fillWidth: true enabled: false - Layout.preferredHeight: 10 * DefaultStyle.dp + Layout.preferredHeight: Math.round(10 * DefaultStyle.dp) background: Rectangle { x: audioTestSlider.leftPadding y: audioTestSlider.topPadding + audioTestSlider.availableHeight / 2 - height / 2 - implicitWidth: 200 * DefaultStyle.dp - implicitHeight: 10 * DefaultStyle.dp + implicitWidth: Math.round(200 * DefaultStyle.dp) + implicitHeight: Math.round(10 * DefaultStyle.dp) width: audioTestSlider.availableWidth height: implicitHeight - radius: 2 * DefaultStyle.dp + radius: Math.round(2 * DefaultStyle.dp) color: DefaultStyle.grey_850 Rectangle { @@ -185,24 +185,24 @@ ColumnLayout { GradientStop { position: 0.0; color: DefaultStyle.vue_meter_light_green } GradientStop { position: 1.0; color: DefaultStyle.vue_meter_dark_green} } - radius: 2 * DefaultStyle.dp + radius: Math.round(2 * DefaultStyle.dp) } } handle: Item {visible: false} } } ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) visible: SettingsCpp.videoEnabled RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.videoCamera colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) } Text { text: qsTr("Caméra") @@ -214,7 +214,7 @@ ColumnLayout { id: videoDevicesCbox Layout.fillWidth: true Layout.preferredWidth: parent.width - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) entries: SettingsCpp.videoDevices propertyName: "videoDevice" propertyOwner: SettingsCpp diff --git a/Linphone/view/Control/Form/Settings/ScreencastSettings.qml b/Linphone/view/Control/Form/Settings/ScreencastSettings.qml index 42be4912..aa5c14c6 100644 --- a/Linphone/view/Control/Form/Settings/ScreencastSettings.qml +++ b/Linphone/view/Control/Form/Settings/ScreencastSettings.qml @@ -14,19 +14,19 @@ ColumnLayout { property bool isLocalScreenSharing : conference?.core.isLocalScreenSharing || false property bool screenSharingAvailable: !!conference && (!conference.core.isScreenSharingEnabled || isLocalScreenSharing) - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) onIsLocalScreenSharingChanged: {if(isLocalScreenSharing) mainItem.call.core.videoSourceDescriptor = mainItem.desc } Text { Layout.fillWidth: true text: qsTr("Veuillez choisir l’écran ou la fenêtre que vous souihaitez partager au autres participants") - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) color: DefaultStyle.main2_500main } TabBar { Layout.fillWidth: true id: bar - pixelSize: 16 * DefaultStyle.dp + pixelSize: Math.round(16 * DefaultStyle.dp) model: [qsTr("Ecran entier"), qsTr("Fenêtre")] } component ScreenPreviewLayout: Control.Control { @@ -36,19 +36,19 @@ ColumnLayout { property int screenIndex property bool selected: false property bool displayScreen: true - property int horizontalMargin: 0 - leftPadding: 18 * DefaultStyle.dp - rightPadding: 18 * DefaultStyle.dp - topPadding: 13 * DefaultStyle.dp - bottomPadding: 13 * DefaultStyle.dp + property real horizontalMargin: 0 + leftPadding: Math.round(18 * DefaultStyle.dp) + rightPadding: Math.round(18 * DefaultStyle.dp) + topPadding: Math.round(13 * DefaultStyle.dp) + bottomPadding: Math.round(13 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent anchors.leftMargin: screenPreview.horizontalMargin anchors.rightMargin: screenPreview.horizontalMargin color: screenPreview.selected ? DefaultStyle.main2_100 : DefaultStyle.grey_0 - border.width: 2 * DefaultStyle.dp + border.width: Math.round(2 * DefaultStyle.dp) border.color: screenPreview.selected ? DefaultStyle.main2_400 : DefaultStyle.main2_200 - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) MouseArea { anchors.fill: parent onClicked: { @@ -63,7 +63,7 @@ ColumnLayout { Layout.fillHeight: true Image { anchors.centerIn: parent - //Layout.preferredHeight: 170 * DefaultStyle.dp + //Layout.preferredHeight: Math.round(170 * DefaultStyle.dp) source: $modelData?.windowId ? "image://window/"+ $modelData.windowId : "image://screen/"+ $modelData.screenIndex sourceSize.width: parent.width sourceSize.height: parent.height @@ -71,11 +71,11 @@ ColumnLayout { } } RowLayout{ - Layout.topMargin: 6 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + Layout.topMargin: Math.round(6 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) Image{ - Layout.preferredHeight: 15 * DefaultStyle.dp - Layout.preferredWidth: 15 * DefaultStyle.dp + Layout.preferredHeight: Math.round(15 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(15 * DefaultStyle.dp) visible: !!$modelData?.windowId source: visible ? "image://window_icon/"+ $modelData.windowId : '' sourceSize.width: width @@ -86,7 +86,7 @@ ColumnLayout { Layout.fillWidth: true text: !!$modelData?.windowId ? $modelData.name : qsTr("Ecran %1").arg(screenIndex+1) horizontalAlignment: Text.AlignHCenter - font.pixelSize: (displayScreen ? 14 : 10)* DefaultStyle.dp + font.pixelSize: Math.round((displayScreen ? 14 : 10) * DefaultStyle.dp) elide: Text.ElideRight maximumLineCount: 1 } @@ -97,7 +97,7 @@ ColumnLayout { currentIndex: bar.currentIndex ListView{ id: screensLayout - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) clip: true //property int selectedIndex model: ScreenProxy{ @@ -106,9 +106,9 @@ ColumnLayout { } onVisibleChanged: if(visible) screensList.update() delegate: ScreenPreviewLayout { - horizontalMargin: (28 - 20 ) * DefaultStyle.dp // 20 coming from CallsWindow panel + horizontalMargin: Math.round((28 - 20 ) * DefaultStyle.dp) // 20 coming from CallsWindow panel width: screensLayout.width - height: 219 * DefaultStyle.dp + height: Math.round(219 * DefaultStyle.dp) screenIndex: index onClicked: {//screensLayout.selectedIndex = index screensLayout.currentIndex = index @@ -131,14 +131,14 @@ ColumnLayout { currentIndex: -1 onVisibleChanged: if(visible) windowsList.update() cellWidth: width / 2 - cellHeight: (112 + 15) * DefaultStyle.dp + cellHeight: Math.round((112 + 15) * DefaultStyle.dp) clip: true delegate: Item{ width: windowsLayout.cellWidth height: windowsLayout.cellHeight ScreenPreviewLayout { anchors.fill: parent - anchors.margins: 7 * DefaultStyle.dp + anchors.margins: Math.round(7 * DefaultStyle.dp) displayScreen: false screenIndex: index onClicked: { diff --git a/Linphone/view/Control/Input/Calendar.qml b/Linphone/view/Control/Input/Calendar.qml index cf826dab..215a5f85 100644 --- a/Linphone/view/Control/Input/Calendar.qml +++ b/Linphone/view/Control/Input/Calendar.qml @@ -40,15 +40,15 @@ ListView { ColumnLayout { anchors.fill: parent property int currentMonth: model.month - spacing: 18 * DefaultStyle.dp + spacing: Math.round(18 * DefaultStyle.dp) RowLayout { Layout.fillWidth: true - spacing: 38 * DefaultStyle.dp + spacing: Math.round(38 * DefaultStyle.dp) Text { text: UtilsCpp.toDateMonthAndYearString(new Date(model.year, model.month, 15))// 15 because of timezones that can change the date for localeString font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight capitalization: Font.Capitalize } } @@ -57,8 +57,8 @@ ListView { } Button { id: previousButton - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) icon.width: width icon.height: height style: ButtonStyle.noBackground @@ -67,8 +67,8 @@ ListView { } Button { id: nextButton - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) icon.width: width icon.height: height style: ButtonStyle.noBackground @@ -78,7 +78,7 @@ ListView { } ColumnLayout { - spacing: 12 * DefaultStyle.dp + spacing: Math.round(12 * DefaultStyle.dp) Control.DayOfWeekRow { locale: monthGrid.locale Layout.column: 1 @@ -89,8 +89,8 @@ ListView { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -146,9 +146,9 @@ ListView { Rectangle { anchors.centerIn: parent - width: 30 * DefaultStyle.dp - height: 30 * DefaultStyle.dp - radius: 50 * DefaultStyle.dp + width: Math.round(30 * DefaultStyle.dp) + height: Math.round(30 * DefaultStyle.dp) + radius: Math.round(50 * DefaultStyle.dp) color: isSelectedDay ? DefaultStyle.main1_500_main : "transparent" border.width: focusDay.activeFocus || hoveringArea.containsMouse ? 1 : 0 @@ -164,8 +164,8 @@ ListView { ? DefaultStyle.main2_700 : DefaultStyle.main2_400 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Input/DecoratedTextField.qml b/Linphone/view/Control/Input/DecoratedTextField.qml index 2565de12..b9052faf 100644 --- a/Linphone/view/Control/Input/DecoratedTextField.qml +++ b/Linphone/view/Control/Input/DecoratedTextField.qml @@ -32,7 +32,7 @@ FormItemLayout { contentItem: TextField { id: textField - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) placeholderText: useTitleAsPlaceHolder ? mainItem.title : mainItem.placeHolder initialText: (mainItem.propertyOwnerGui ? mainItem.propertyOwnerGui.core[mainItem.propertyName] : mainItem.propertyOwner[mainItem.propertyName]) || '' customWidth: mainItem.parent.width diff --git a/Linphone/view/Control/Input/DigitInput.qml b/Linphone/view/Control/Input/DigitInput.qml index e474b2e0..027b7f75 100644 --- a/Linphone/view/Control/Input/DigitInput.qml +++ b/Linphone/view/Control/Input/DigitInput.qml @@ -4,7 +4,7 @@ import Linphone Control.TextField { id: mainItem - property int inputSize: 100 * DefaultStyle.dp + property real inputSize: Math.round(100 * DefaultStyle.dp) color: activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500main validator: IntValidator{bottom: 0; top: 9} @@ -24,7 +24,7 @@ Control.TextField { // horizontalAlignment: Control.TextField.AlignHCenter font.family: DefaultStyle.defaultFont font.pixelSize: inputSize / 2 - font.weight: 300 * DefaultStyle.dp + font.weight: Math.round(300 * DefaultStyle.dp) background: Item { anchors.fill: parent @@ -32,7 +32,7 @@ Control.TextField { // height: mainItem.inputSize Rectangle { id: background - border.width: Math.max(DefaultStyle.dp, 1) + border.width: Math.round(Math.max(DefaultStyle.dp), 1) border.color: mainItem.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500main radius: mainItem.inputSize * 0.15 width: mainItem.inputSize * 0.9 @@ -42,11 +42,11 @@ Control.TextField { id: indicator visible: mainItem.activeFocus color: DefaultStyle.main1_500_main - height : Math.max(0.5, 1 * DefaultStyle.dp) + height : Math.max(1, Math.round(1 * DefaultStyle.dp)) width: mainItem.inputSize * 0.67 anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.bottomMargin: (mainItem.inputSize / 8) * DefaultStyle.dp + anchors.bottomMargin: Math.round((mainItem.inputSize / 8) * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Input/NumericPad.qml b/Linphone/view/Control/Input/NumericPad.qml index aeea1ee4..61feb529 100644 --- a/Linphone/view/Control/Input/NumericPad.qml +++ b/Linphone/view/Control/Input/NumericPad.qml @@ -90,8 +90,8 @@ FocusScope{ Layout.GridLayout { id: numPadGrid columns: 3 - columnSpacing: 40 * DefaultStyle.dp - rowSpacing: 10 * DefaultStyle.dp + columnSpacing: (40 * DefaultStyle.dp) + rowSpacing: (10 * DefaultStyle.dp) function getButtonAt(index){ index = (index+15) % 15 if(index >= 0){ @@ -113,8 +113,8 @@ FocusScope{ id: numPadButton Layout.Layout.alignment: Qt.AlignHCenter required property int index - implicitWidth: 60 * DefaultStyle.dp - implicitHeight: 60 * DefaultStyle.dp + implicitWidth: (60 * DefaultStyle.dp) + implicitHeight: (60 * DefaultStyle.dp) onClicked: { mainItem.buttonPressed(text) } @@ -123,10 +123,10 @@ FocusScope{ KeyNavigation.up: numPadGrid.getButtonAt(index - 3) KeyNavigation.down: numPadGrid.getButtonAt(index + 3) style: ButtonStyle.numericPad - radius: 71 * DefaultStyle.dp + radius: (71 * DefaultStyle.dp) text: index + 1 - textSize: 32 * DefaultStyle.dp - textWeight: 400 * DefaultStyle.dp + textSize: (32 * DefaultStyle.dp) + textWeight: (400 * DefaultStyle.dp) } } Repeater { @@ -139,8 +139,8 @@ FocusScope{ BigButton { id: digitButton Layout.Layout.alignment: Qt.AlignHCenter - implicitWidth: 60 * DefaultStyle.dp - implicitHeight: 60 * DefaultStyle.dp + implicitWidth: (60 * DefaultStyle.dp) + implicitHeight: (60 * DefaultStyle.dp) onClicked: mainItem.buttonPressed(pressText.text) onPressAndHold: mainItem.buttonPressed(longPressText.text) @@ -149,7 +149,7 @@ FocusScope{ KeyNavigation.right: numPadGrid.getButtonAt((index + 1)+9) KeyNavigation.up: numPadGrid.getButtonAt((index - 3)+9) KeyNavigation.down: numPadGrid.getButtonAt((index + 3)+9) - radius: 71 * DefaultStyle.dp + radius: (71 * DefaultStyle.dp) style: ButtonStyle.numericPad contentItem: Item { @@ -163,7 +163,7 @@ FocusScope{ horizontalAlignment: Text.AlignHCenter Component.onCompleted: {if (modelData.longPressText === undefined) anchors.centerIn= parent} text: modelData.pressText - font.pixelSize: 32 * DefaultStyle.dp + font.pixelSize: (32 * DefaultStyle.dp) } Text { id: longPressText @@ -175,7 +175,7 @@ FocusScope{ horizontalAlignment: Text.AlignHCenter visible: modelData.longPressText ? modelData.longPressText.length > 0 : false text: modelData.longPressText ? modelData.longPressText : "" - font.pixelSize: 22 * DefaultStyle.dp + font.pixelSize: (22 * DefaultStyle.dp) } } } @@ -187,12 +187,12 @@ FocusScope{ Button { id: launchCallButton visible: mainItem.lastRowVisible - implicitWidth: 75 * DefaultStyle.dp - implicitHeight: 55 * DefaultStyle.dp + implicitWidth: (75 * DefaultStyle.dp) + implicitHeight: (55 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp - radius: 71 * DefaultStyle.dp + icon.width: (32 * DefaultStyle.dp) + icon.height: (32 * DefaultStyle.dp) + radius: (71 * DefaultStyle.dp) style: ButtonStyle.phoneGreen onClicked: mainItem.launchCall() @@ -205,17 +205,17 @@ FocusScope{ Button { id: eraseButton visible: mainItem.lastRowVisible - leftPadding: 5 * DefaultStyle.dp - rightPadding: 5 * DefaultStyle.dp - topPadding: 5 * DefaultStyle.dp - bottomPadding: 5 * DefaultStyle.dp + leftPadding: (5 * DefaultStyle.dp) + rightPadding: (5 * DefaultStyle.dp) + topPadding: (5 * DefaultStyle.dp) + bottomPadding: (5 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter icon.source: AppIcons.backspaceFill style: ButtonStyle.noBackground - icon.width: 38 * DefaultStyle.dp - icon.height: 38 * DefaultStyle.dp - Layout.Layout.preferredWidth: 38 * DefaultStyle.dp - Layout.Layout.preferredHeight: 38 * DefaultStyle.dp + icon.width: (38 * DefaultStyle.dp) + icon.height: (38 * DefaultStyle.dp) + Layout.Layout.preferredWidth: (38 * DefaultStyle.dp) + Layout.Layout.preferredHeight: (38 * DefaultStyle.dp) onClicked: mainItem.wipe() diff --git a/Linphone/view/Control/Input/PhoneNumberInput.qml b/Linphone/view/Control/Input/PhoneNumberInput.qml index 1e33508c..32795d21 100644 --- a/Linphone/view/Control/Input/PhoneNumberInput.qml +++ b/Linphone/view/Control/Input/PhoneNumberInput.qml @@ -11,7 +11,7 @@ ColumnLayout { property string placeholderText : "" property bool mandatory: false property bool enableErrorText: true - property int textInputWidth: width + property real textInputWidth: width property string initialPhoneNumber readonly property string phoneNumber: textField.text readonly property string countryCode: combobox.currentText @@ -23,8 +23,8 @@ ColumnLayout { text: mainItem.label + (mainItem.mandatory ? "*" : "") color: (combobox.hasActiveFocus || textField.hasActiveFocus) ? DefaultStyle.main1_500_main : DefaultStyle.main2_600 font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } @@ -34,8 +34,8 @@ ColumnLayout { Rectangle { id: contentBackground width: mainItem.textInputWidth - height: 49 * DefaultStyle.dp - radius: 63 * DefaultStyle.dp + height: Math.round(49 * DefaultStyle.dp) + radius: Math.round(63 * DefaultStyle.dp) color: DefaultStyle.grey_100 border.color: mainItem.errorMessage.length > 0 ? DefaultStyle.danger_500main @@ -46,14 +46,14 @@ ColumnLayout { anchors.fill: parent CountryIndicatorCombobox { id: combobox - implicitWidth: 110 * DefaultStyle.dp + implicitWidth: Math.round(110 * DefaultStyle.dp) defaultCallingCode: mainItem.defaultCallingCode } Rectangle { - Layout.preferredWidth: 1 * DefaultStyle.dp + Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1) Layout.fillHeight: true - Layout.topMargin: 10 * DefaultStyle.dp - Layout.bottomMargin: 10 * DefaultStyle.dp + Layout.topMargin: Math.round(10 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(10 * DefaultStyle.dp) color: DefaultStyle.main2_600 } TextField { @@ -76,7 +76,7 @@ ColumnLayout { elide: Text.ElideRight wrapMode: Text.Wrap font { - pixelSize: 13 * DefaultStyle.dp + pixelSize: Math.round(13 * DefaultStyle.dp) family: DefaultStyle.defaultFont bold: true } diff --git a/Linphone/view/Control/Input/SearchBar.qml b/Linphone/view/Control/Input/SearchBar.qml index 938c3e2f..be31fd37 100644 --- a/Linphone/view/Control/Input/SearchBar.qml +++ b/Linphone/view/Control/Input/SearchBar.qml @@ -8,7 +8,7 @@ FocusScope { id: mainItem property string placeholderText: "" property color placeholderTextColor: DefaultStyle.main2_400 - property int textInputWidth: 350 * DefaultStyle.dp + property real textInputWidth: Math.round(350 * DefaultStyle.dp) property color borderColor: "transparent" property color focusedBorderColor: DefaultStyle.main2_500main property string text: textField.searchText @@ -38,12 +38,12 @@ FocusScope { implicitWidth: mainItem.textInputWidth - implicitHeight: 50 * DefaultStyle.dp + implicitHeight: Math.round(50 * DefaultStyle.dp) Rectangle{ id: backgroundItem anchors.fill: parent - radius: 28 * DefaultStyle.dp + radius: Math.round(28 * DefaultStyle.dp) color: DefaultStyle.grey_100 border.color: textField.activeFocus ? mainItem.focusedBorderColor : mainItem.borderColor } @@ -53,15 +53,15 @@ FocusScope { colorizationColor: DefaultStyle.main2_500main anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) imageSource: AppIcons.magnifier - width: 20 * DefaultStyle.dp - height: 20 * DefaultStyle.dp + width: Math.round(20 * DefaultStyle.dp) + height: Math.round(20 * DefaultStyle.dp) } Control.TextField { id: textField anchors.left: magnifier.visible ? magnifier.right : parent.left - anchors.leftMargin: magnifier.visible ? 0 : 10 * DefaultStyle.dp + anchors.leftMargin: magnifier.visible ? 0 : Math.round(10 * DefaultStyle.dp) anchors.right: clearTextButton.left anchors.verticalCenter: parent.verticalCenter @@ -73,8 +73,8 @@ FocusScope { width: mainItem.width - dialerButton.width echoMode: (mainItem.hidden && !dialerButton.checked) ? TextInput.Password : TextInput.Normal font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight family: DefaultStyle.defaultFont } color: DefaultStyle.main2_600 @@ -87,7 +87,7 @@ FocusScope { cursorDelegate: Rectangle { visible: textField.cursorVisible color: DefaultStyle.main2_500main - width: 1 * DefaultStyle.dp + width: Math.max(Math.round(1 * DefaultStyle.dp), 1) } Timer{ id: delayTimer @@ -104,11 +104,11 @@ FocusScope { icon.source: AppIcons.dialer contentImageColor: dialerButton.checked ? DefaultStyle.main1_500_main : DefaultStyle.main2_600 hoveredImageColor: contentImageColor - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: 20 * DefaultStyle.dp + anchors.rightMargin: Math.round(20 * DefaultStyle.dp) onClicked: { if(!checked){ mainItem.openNumericPadRequested() @@ -119,14 +119,14 @@ FocusScope { Button { id: clearTextButton visible: textField.text.length > 0 && mainItem.enabled - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackground icon.source: AppIcons.closeX anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 20 * DefaultStyle.dp + anchors.rightMargin: Math.round(20 * DefaultStyle.dp) onClicked: { textField.clear() } diff --git a/Linphone/view/Control/Input/TextArea.qml b/Linphone/view/Control/Input/TextArea.qml index 13162e5d..99bea614 100644 --- a/Linphone/view/Control/Input/TextArea.qml +++ b/Linphone/view/Control/Input/TextArea.qml @@ -7,14 +7,14 @@ TextEdit { id: mainItem property string placeholderText - property int placeholderPixelSize: 14 * DefaultStyle.dp - property int placeholderWeight: 400 * DefaultStyle.dp + property real placeholderPixelSize: Typography.p1.pixelSize + property real placeholderWeight: Typography.p1.weight property color placeholderTextColor: color property alias background: background.data property bool hoverEnabled: false property bool hovered: mouseArea.hoverEnabled && mouseArea.containsMouse - topPadding: 5 * DefaultStyle.dp - bottomPadding: 5 * DefaultStyle.dp + topPadding: Math.round(5 * DefaultStyle.dp) + bottomPadding: Math.round(5 * DefaultStyle.dp) activeFocusOnTab: true MouseArea { diff --git a/Linphone/view/Control/Input/TextField.qml b/Linphone/view/Control/Input/TextField.qml index 41e8c850..674ecb66 100644 --- a/Linphone/view/Control/Input/TextField.qml +++ b/Linphone/view/Control/Input/TextField.qml @@ -7,12 +7,12 @@ import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle Control.TextField { id: mainItem property var customWidth - width: (customWidth ? customWidth - 1 : 360) * DefaultStyle.dp - height: 49 * DefaultStyle.dp - leftPadding: 15 * DefaultStyle.dp + width: Math.round((customWidth ? customWidth - 1 : 360) * DefaultStyle.dp) + height: Math.round(49 * DefaultStyle.dp) + leftPadding: Math.round(15 * DefaultStyle.dp) rightPadding: eyeButton.visible - ? 5 * DefaultStyle.dp + eyeButton.width + eyeButton.rightMargin - : 15 * DefaultStyle.dp + ? Math.round(5 * DefaultStyle.dp) + eyeButton.width + eyeButton.rightMargin + : Math.round(15 * DefaultStyle.dp) echoMode: (hidden && !eyeButton.checked) ? TextInput.Password : TextInput.Normal // Workaround for Windows slowness when first typing a password @@ -27,8 +27,8 @@ Control.TextField { placeholderTextColor: DefaultStyle.placeholders font { family: DefaultStyle.defaultFont - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } selectByMouse: true activeFocusOnTab: true @@ -43,8 +43,8 @@ Control.TextField { property color disabledBackgroundColor: DefaultStyle.grey_200 property color backgroundBorderColor: DefaultStyle.grey_200 property string initialText - property int pixelSize: 14 * DefaultStyle.dp - property int weight: 400 * DefaultStyle.dp + property real pixelSize: Typography.p1.pixelSize + property real weight: Typography.p1.weight // fill propertyName and propertyOwner to check text validity property string propertyName @@ -115,7 +115,7 @@ Control.TextField { id: inputBackground visible: mainItem.backgroundVisible anchors.fill: parent - radius: 79 * DefaultStyle.dp + radius: Math.round(79 * DefaultStyle.dp) color: mainItem.enabled ? mainItem.backgroundColor : mainItem.disabledBackgroundColor border.color: mainItem.isError ? DefaultStyle.danger_500main : mainItem.activeFocus ? DefaultStyle.main1_500_main : mainItem.backgroundBorderColor } @@ -123,7 +123,7 @@ Control.TextField { cursorDelegate: Rectangle { id: cursor color: DefaultStyle.main1_500_main - width: 1 * DefaultStyle.dp + width: Math.max(Math.round(1 * DefaultStyle.dp), 1) anchors.verticalCenter: mainItem.verticalCenter SequentialAnimation { @@ -174,14 +174,14 @@ Control.TextField { Button { id: eyeButton KeyNavigation.left: mainItem - property int rightMargin: 15 * DefaultStyle.dp + property real rightMargin: Math.round(15 * DefaultStyle.dp) z: 1 visible: mainItem.hidden checkable: true style: ButtonStyle.noBackground icon.source: eyeButton.checked ? AppIcons.eyeShow : AppIcons.eyeHide - width: 20 * DefaultStyle.dp - height: 20 * DefaultStyle.dp + width: Math.round(20 * DefaultStyle.dp) + height: Math.round(20 * DefaultStyle.dp) icon.width: width icon.height: height anchors.verticalCenter: parent.verticalCenter diff --git a/Linphone/view/Control/Input/TimeComboBox.qml b/Linphone/view/Control/Input/TimeComboBox.qml index 82a73e6d..8a331c8d 100644 --- a/Linphone/view/Control/Input/TimeComboBox.qml +++ b/Linphone/view/Control/Input/TimeComboBox.qml @@ -21,10 +21,10 @@ ComboBox { property alias contentText: input property var minTime property var maxTime - popup.width: 73 * DefaultStyle.dp + popup.width: Math.round(73 * DefaultStyle.dp) listView.model: 48 - listView.height: Math.min(204 * DefaultStyle.dp, listView.contentHeight) - popup.height: Math.min(204 * DefaultStyle.dp, listView.contentHeight) + listView.height: Math.min(Math.round(204 * DefaultStyle.dp), listView.contentHeight) + popup.height: Math.min(Math.round(204 * DefaultStyle.dp), listView.contentHeight) editable: true popup.closePolicy: Popup.PressOutsideParent | Popup.CloseOnPressOutside onCurrentTextChanged: input.text = currentText @@ -52,8 +52,8 @@ ComboBox { } } font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } text: mainItem.selectedTimeString Keys.onPressed: (event) => { @@ -74,12 +74,12 @@ ComboBox { text: Qt.formatDateTime(currentDateTime, "hh:mm") width: mainItem.width visible: mainItem.minTime == undefined || UtilsCpp.timeOffset(mainItem.minTime, currentDateTime) > 0 - height: visible ? 25 * DefaultStyle.dp : 0 + height: visible ? Math.round(25 * DefaultStyle.dp) : 0 verticalAlignment: TextInput.AlignVCenter horizontalAlignment: TextInput.AlignHCenter font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } MouseArea { anchors.fill: parent @@ -97,4 +97,4 @@ ComboBox { } } } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Popup/Dialog/AuthenticationDialog.qml b/Linphone/view/Control/Popup/Dialog/AuthenticationDialog.qml index a523575d..73458714 100644 --- a/Linphone/view/Control/Popup/Dialog/AuthenticationDialog.qml +++ b/Linphone/view/Control/Popup/Dialog/AuthenticationDialog.qml @@ -17,11 +17,11 @@ Dialog { readonly property string password: passwordEdit.text property var callback// Define cb(var) function - topPadding: 20 * DefaultStyle.dp - bottomPadding: 20 * DefaultStyle.dp - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - width: 637 * DefaultStyle.dp + topPadding:Math.round( 20 * DefaultStyle.dp) + bottomPadding:Math.round( 20 * DefaultStyle.dp) + leftPadding:Math.round( 20 * DefaultStyle.dp) + rightPadding:Math.round( 20 * DefaultStyle.dp) + width:Math.round( 637 * DefaultStyle.dp) modal: true closePolicy: Popup.NoAutoClose @@ -33,19 +33,19 @@ Dialog { Component.onDestruction: if(callback) callback.destroy() content: ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing:Math.round( 20 * DefaultStyle.dp) id: contentLayout Text { Layout.fillWidth: true - Layout.preferredWidth: 250 * DefaultStyle.dp + Layout.preferredWidth:Math.round( 250 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap text: qsTr("Impossible de vous authentifier. Merci de vérifier votre mot de passe.") - font.pixelSize: 16 * DefaultStyle.dp + font.pixelSize:Math.round( 16 * DefaultStyle.dp) } ColumnLayout { - spacing: 10 * DefaultStyle.dp + spacing:Math.round( 10 * DefaultStyle.dp) FormItemLayout { Layout.fillWidth: true label: qsTr("Identité") @@ -90,7 +90,7 @@ Dialog { buttons: [ MediumButton { id: cancelButton - Layout.topMargin: 10 * DefaultStyle.dp + Layout.topMargin: Math.round( 10 * DefaultStyle.dp) text: qsTr("Annuler") style: ButtonStyle.secondary onClicked: mainItem.rejected() @@ -99,7 +99,7 @@ Dialog { }, MediumButton { id: connectButton - Layout.topMargin: 10 * DefaultStyle.dp + Layout.topMargin:Math.round( 10 * DefaultStyle.dp) text: qsTr("Se connecter") style: ButtonStyle.main KeyNavigation.up: passwordEdit diff --git a/Linphone/view/Control/Popup/Dialog/Dialog.qml b/Linphone/view/Control/Popup/Dialog/Dialog.qml index d5e247a2..84d846af 100644 --- a/Linphone/view/Control/Popup/Dialog/Dialog.qml +++ b/Linphone/view/Control/Popup/Dialog/Dialog.qml @@ -10,12 +10,12 @@ Popup { modal: true anchors.centerIn: parent closePolicy: Control.Popup.NoAutoClose - leftPadding: title.length === 0 ? 10 * DefaultStyle.dp : 33 * DefaultStyle.dp - rightPadding: title.length === 0 ? 10 * DefaultStyle.dp : 33 * DefaultStyle.dp - topPadding: title.length === 0 ? 10 * DefaultStyle.dp : 37 * DefaultStyle.dp - bottomPadding: title.length === 0 ? 10 * DefaultStyle.dp : 37 * DefaultStyle.dp + leftPadding: title.length === 0 ? Math.round(10 * DefaultStyle.dp) : Math.round(33 * DefaultStyle.dp) + rightPadding: title.length === 0 ? Math.round(10 * DefaultStyle.dp) : Math.round(33 * DefaultStyle.dp) + topPadding: title.length === 0 ? Math.round(10 * DefaultStyle.dp) : Math.round(37 * DefaultStyle.dp) + bottomPadding: title.length === 0 ? Math.round(10 * DefaultStyle.dp) : Math.round(37 * DefaultStyle.dp) underlineColor: DefaultStyle.main1_500_main - radius: title.length === 0 ? 16 * DefaultStyle.dp : 0 + radius: title.length === 0 ? Math.round(16 * DefaultStyle.dp) : 0 property string title property var titleColor: DefaultStyle.main1_500_main property string text @@ -47,7 +47,7 @@ Popup { ColumnLayout { id: child anchors.fill: parent - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) Text{ id: titleText @@ -56,8 +56,8 @@ Popup { text: mainItem.title color: mainItem.titleColor font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } wrapMode: Text.Wrap horizontalAlignment: Text.AlignLeft @@ -76,8 +76,8 @@ Popup { Layout.alignment: Qt.AlignCenter text: mainItem.text font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } wrapMode: Text.Wrap horizontalAlignment: titleText.visible ? Text.AlignLeft : Text.AlignHCenter @@ -86,12 +86,12 @@ Popup { id: detailsText visible: text.length != 0 Layout.fillWidth: true - //Layout.preferredWidth: 278 * DefaultStyle.dp + //Layout.preferredWidth: Math.round(278 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter text: mainItem.details font { - pixelSize: 13 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight italic: true } wrapMode: Text.Wrap @@ -107,7 +107,7 @@ Popup { RowLayout { id: buttonsLayout Layout.alignment: Qt.AlignBottom | ( titleText.visible ? Qt.AlignRight : Qt.AlignHCenter) - spacing: titleText.visible ? 20 * DefaultStyle.dp : 10 * DefaultStyle.dp + spacing: titleText.visible ? Math.round(20 * DefaultStyle.dp) : Math.round(10 * DefaultStyle.dp) // Default buttons only visible if no other children // have been set diff --git a/Linphone/view/Control/Popup/Dialog/ZrtpAuthenticationDialog.qml b/Linphone/view/Control/Popup/Dialog/ZrtpAuthenticationDialog.qml index 0fa1d41b..cd1db427 100644 --- a/Linphone/view/Control/Popup/Dialog/ZrtpAuthenticationDialog.qml +++ b/Linphone/view/Control/Popup/Dialog/ZrtpAuthenticationDialog.qml @@ -9,11 +9,11 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle // ============================================================================= Dialog { id: mainItem - width: 436 * DefaultStyle.dp - rightPadding: 0 * DefaultStyle.dp - leftPadding: 0 * DefaultStyle.dp - topPadding: 85 * DefaultStyle.dp + 24 * DefaultStyle.dp - bottomPadding: 24 * DefaultStyle.dp + width: Math.round(436 * DefaultStyle.dp) + rightPadding: Math.round(0 * DefaultStyle.dp) + leftPadding: Math.round(0 * DefaultStyle.dp) + topPadding: Math.round(85 * DefaultStyle.dp) + Math.round(24 * DefaultStyle.dp) + bottomPadding: Math.round(24 * DefaultStyle.dp) modal: true closePolicy: Popup.NoAutoClose @@ -39,10 +39,10 @@ Dialog { radius: mainItem.radius Layout.ColumnLayout { anchors.top: parent.top - anchors.topMargin: 18 * DefaultStyle.dp + anchors.topMargin: Math.round(18 * DefaultStyle.dp) anchors.horizontalCenter: parent.horizontalCenter Item { - // spacing: 14 * DefaultStyle.dp + // spacing: Math.round(14 * DefaultStyle.dp) Layout.Layout.preferredWidth: childrenRect.width Layout.Layout.preferredHeight: childrenRect.height Layout.Layout.fillWidth: true @@ -50,19 +50,19 @@ Dialog { id: trustShield anchors.centerIn: parent source: AppIcons.trustedWhite - sourceSize.width: 24 * DefaultStyle.dp - sourceSize.height: 24 * DefaultStyle.dp - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + sourceSize.width: Math.round(24 * DefaultStyle.dp) + sourceSize.height: Math.round(24 * DefaultStyle.dp) + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) } EffectImage { anchors.left: trustShield.right - anchors.leftMargin: 14 * DefaultStyle.dp + anchors.leftMargin: Math.round(14 * DefaultStyle.dp) visible: mainItem.securityError imageSource: AppIcons.shieldWarning colorizationColor: DefaultStyle.main2_700 - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) } } Text { @@ -70,8 +70,8 @@ Dialog { color: DefaultStyle.grey_0 Layout.Layout.alignment: Qt.AlignHCenter font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } } Item{Layout.Layout.fillHeight: true} @@ -80,8 +80,8 @@ Dialog { visible: !mainItem.securityError anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 10 * DefaultStyle.dp - anchors.rightMargin: 17 * DefaultStyle.dp + anchors.topMargin: Math.round(10 * DefaultStyle.dp) + anchors.rightMargin: Math.round(17 * DefaultStyle.dp) style: ButtonStyle.noBackground text: qsTr("Passer") textColor: DefaultStyle.grey_0 @@ -97,9 +97,9 @@ Dialog { Rectangle { z: 1 width: mainItem.width - height: parent.height - 85 * DefaultStyle.dp + height: parent.height - Math.round(85 * DefaultStyle.dp) x: parent.x - y: parent.y + 85 * DefaultStyle.dp + y: parent.y + Math.round(85 * DefaultStyle.dp) color: DefaultStyle.grey_0 radius: mainItem.radius } @@ -116,21 +116,21 @@ Dialog { content: [ Layout.ColumnLayout { visible: !mainItem.securityError - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter Layout.Layout.fillWidth: true Layout.ColumnLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter Text { - Layout.Layout.preferredWidth: 343 * DefaultStyle.dp + Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter text: !mainItem.isTokenVerified && mainItem.isCaseMismatch ? qsTr("Pour garantir le chiffrement, nous avons besoin de réauthentifier l’appareil de votre correspondant. Echangez vos codes :") : qsTr("Pour garantir le chiffrement, nous avons besoin d’authentifier l’appareil de votre correspondant. Veuillez échanger vos codes : ") wrapMode: Text.WordWrap - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } Layout.ColumnLayout { spacing: 0 @@ -139,15 +139,15 @@ Dialog { text: qsTr("Votre code :") horizontalAlignment: Text.AlignHCenter Layout.Layout.alignment: Qt.AlignHCenter - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } Text { text: mainItem.call && mainItem.call.core.localToken || "" horizontalAlignment: Text.AlignHCenter Layout.Layout.alignment: Qt.AlignHCenter font { - pixelSize: 18 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.b1.pixelSize + weight: Typography.b1.weight } } } @@ -155,17 +155,17 @@ Dialog { Rectangle { color: "transparent" border.color: DefaultStyle.main2_200 - border.width: Math.max(0.5, 1 * DefaultStyle.dp) - radius: 15 * DefaultStyle.dp - Layout.Layout.preferredWidth: 292 * DefaultStyle.dp - Layout.Layout.preferredHeight: 233 * DefaultStyle.dp + border.width: Math.max(1, Math.round(1 * DefaultStyle.dp)) + radius: Math.round(15 * DefaultStyle.dp) + Layout.Layout.preferredWidth: Math.round(292 * DefaultStyle.dp) + Layout.Layout.preferredHeight: Math.round(233 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter Layout.ColumnLayout { anchors.fill: parent - anchors.topMargin: 10 * DefaultStyle.dp + anchors.topMargin: Math.round(10 * DefaultStyle.dp) Text { text: qsTr("Code correspondant :") - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter } Layout.GridLayout { @@ -173,22 +173,22 @@ Dialog { Layout.Layout.alignment: Qt.AlignHCenter rows: 2 columns: 2 - rowSpacing: 32 * DefaultStyle.dp - columnSpacing: 32 * DefaultStyle.dp + rowSpacing: Math.round(32 * DefaultStyle.dp) + columnSpacing: Math.round(32 * DefaultStyle.dp) property var correctIndex property var modelList Repeater { model: mainItem.call && mainItem.call.core.remoteTokens || "" Button { - Layout.Layout.preferredWidth: 70 * DefaultStyle.dp - Layout.Layout.preferredHeight: 70 * DefaultStyle.dp - width: 70 * DefaultStyle.dp - height: 70 * DefaultStyle.dp + Layout.Layout.preferredWidth: Math.round(70 * DefaultStyle.dp) + Layout.Layout.preferredHeight: Math.round(70 * DefaultStyle.dp) + width: Math.round(70 * DefaultStyle.dp) + height: Math.round(70 * DefaultStyle.dp) color: DefaultStyle.grey_0 - textSize: 32 * DefaultStyle.dp - textWeight: 400 * DefaultStyle.dp + textSize: Math.round(32 * DefaultStyle.dp) + textWeight: Math.round(400 * DefaultStyle.dp) text: modelData - radius: 71 * DefaultStyle.dp + radius: Math.round(71 * DefaultStyle.dp) textColor: DefaultStyle.main2_600 onClicked: { console.log("CHECK TOKEN", modelData) @@ -205,24 +205,24 @@ Dialog { spacing: 0 Text { - width: 303 * DefaultStyle.dp - // Layout.Layout.preferredWidth: 343 * DefaultStyle.dp + width: Math.round(303 * DefaultStyle.dp) + // Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter Layout.Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter text: qsTr("Le code fourni ne correspond pas.") wrapMode: Text.WordWrap - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } Text { - width: 303 * DefaultStyle.dp - // Layout.Layout.preferredWidth: 343 * DefaultStyle.dp + width: Math.round(303 * DefaultStyle.dp) + // Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter Layout.Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter text: qsTr("La confidentialité de votre appel peut être compromise !") wrapMode: Text.WordWrap - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } } ] @@ -231,7 +231,7 @@ Dialog { Layout.Layout.alignment: Qt.AlignHCenter MediumButton { Layout.Layout.alignment: Qt.AlignHCenter - Layout.Layout.preferredWidth: 247 * DefaultStyle.dp + Layout.Layout.preferredWidth: Math.round(247 * DefaultStyle.dp) text: qsTr("Aucune correspondance") color: DefaultStyle.grey_0 borderColor: DefaultStyle.danger_500main @@ -242,13 +242,13 @@ Dialog { } } MediumButton { - Layout.Layout.preferredWidth: 247 * DefaultStyle.dp + Layout.Layout.preferredWidth: Math.round(247 * DefaultStyle.dp) Layout.Layout.alignment: Qt.AlignHCenter visible: mainItem.securityError style: ButtonStyle.phoneRed onClicked: mainItem.call.core.lTerminate() - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) text: qsTr("Raccrocher") } } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Popup/InformationPopup.qml b/Linphone/view/Control/Popup/InformationPopup.qml index 1ecd2589..29251c66 100644 --- a/Linphone/view/Control/Popup/InformationPopup.qml +++ b/Linphone/view/Control/Popup/InformationPopup.qml @@ -18,9 +18,9 @@ Popup { closePolicy: Popup.NoAutoClose x : parent.x + parent.width - width // y : parent.y + parent.height - height - rightMargin: 20 * DefaultStyle.dp - bottomMargin: 20 * DefaultStyle.dp - padding: 20 * DefaultStyle.dp + rightMargin: Math.round(20 * DefaultStyle.dp) + bottomMargin: Math.round(20 * DefaultStyle.dp) + padding: Math.round(20 * DefaultStyle.dp) underlineColor: mainItem.isSuccess ? DefaultStyle.success_500main : DefaultStyle.danger_500main radius: 0 onHoveredChanged: { @@ -35,22 +35,22 @@ Popup { } } contentItem: RowLayout { - spacing: 24 * DefaultStyle.dp + spacing: Math.round(24 * DefaultStyle.dp) EffectImage { imageSource: mainItem.isSuccess ? AppIcons.smiley : AppIcons.smileySad colorizationColor: mainItem.isSuccess ? DefaultStyle.success_500main : DefaultStyle.danger_500main - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp - width: 32 * DefaultStyle.dp - height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) + width: Math.round(32 * DefaultStyle.dp) + height: Math.round(32 * DefaultStyle.dp) } Rectangle { - Layout.preferredWidth: 1 * DefaultStyle.dp + Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1) Layout.preferredHeight: parent.height color: DefaultStyle.main2_200 } ColumnLayout { - spacing: 2 * DefaultStyle.dp + spacing: Math.round(2 * DefaultStyle.dp) RowLayout { spacing: 0 Text { @@ -58,15 +58,15 @@ Popup { text: mainItem.title color: mainItem.isSuccess ? DefaultStyle.success_500main : DefaultStyle.danger_500main font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } Button { - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp - icon.width: 20 * DefaultStyle.dp - icon.height: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) + icon.width: Math.round(20 * DefaultStyle.dp) + icon.height: Math.round(20 * DefaultStyle.dp) Layout.alignment: Qt.AlignTop | Qt.AlignRight visible: mainItem.hovered || hovered style: ButtonStyle.noBackground @@ -77,13 +77,13 @@ Popup { Text { Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.maximumWidth: 300 * DefaultStyle.dp + Layout.maximumWidth: Math.round(300 * DefaultStyle.dp) text: mainItem.description wrapMode: Text.WordWrap color: DefaultStyle.main2_500main font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Control/Popup/Loading/LoadingPopup.qml b/Linphone/view/Control/Popup/Loading/LoadingPopup.qml index 49942fa0..ee5479db 100644 --- a/Linphone/view/Control/Popup/Loading/LoadingPopup.qml +++ b/Linphone/view/Control/Popup/Loading/LoadingPopup.qml @@ -12,18 +12,18 @@ Popup { modal: true closePolicy: Control.Popup.NoAutoClose anchors.centerIn: parent - padding: 20 * DefaultStyle.dp + padding: Math.round(20 * DefaultStyle.dp) underlineColor: DefaultStyle.main1_500_main - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) // onAboutToShow: width = contentText.implicitWidth contentItem: ColumnLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) // width: childrenRect.width // height: childrenRect.height BusyIndicator{ Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 33 * DefaultStyle.dp - Layout.preferredHeight: 33 * DefaultStyle.dp + Layout.preferredWidth: Math.round(33 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(33 * DefaultStyle.dp) } Text { id: contentText @@ -31,7 +31,7 @@ Popup { Layout.fillWidth: true Layout.fillHeight: true text: mainItem.text - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } MediumButton { visible: mainItem.cancelButtonVisible diff --git a/Linphone/view/Control/Popup/Notification/Notification.qml b/Linphone/view/Control/Popup/Notification/Notification.qml index b49cfba4..b7b4bd70 100644 --- a/Linphone/view/Control/Popup/Notification/Notification.qml +++ b/Linphone/view/Control/Popup/Notification/Notification.qml @@ -11,8 +11,8 @@ DesktopPopup { property var notificationData: ({ timelineModel : null }) - property int overriddenHeight: 120 * DefaultStyle.dp - property int overriddenWidth: 300 * DefaultStyle.dp + property real overriddenHeight: Math.round(120 * DefaultStyle.dp) + property real overriddenWidth: Math.round(300 * DefaultStyle.dp) property double radius: 0 property color backgroundColor: DefaultStyle.grey_0 property double backgroundOpacity: 1 @@ -56,7 +56,7 @@ DesktopPopup { opacity: mainItem.backgroundOpacity // border { // color: DefaultStyle.grey_400 - // width: 1 * DefaultStyle.dp + // width: Math.round(1 * DefaultStyle.dp) // } } MultiEffect { diff --git a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml index 5cd8955d..f48b049f 100644 --- a/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml +++ b/Linphone/view/Control/Popup/Notification/NotificationReceivedCall.qml @@ -8,10 +8,10 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle Notification { id: mainItem - radius: 20 * DefaultStyle.dp + radius: Math.round(20 * DefaultStyle.dp) backgroundColor: DefaultStyle.grey_600 backgroundOpacity: 0.8 - overriddenWidth: 400 * DefaultStyle.dp + overriddenWidth: Math.round(400 * DefaultStyle.dp) overriddenHeight: content.height readonly property var call: notificationData && notificationData.call @@ -29,41 +29,41 @@ Notification { Popup { id: content visible: mainItem.visible - leftPadding: 32 * DefaultStyle.dp - rightPadding: 32 * DefaultStyle.dp - topPadding: 9 * DefaultStyle.dp - bottomPadding: 18 * DefaultStyle.dp + leftPadding: Math.round(32 * DefaultStyle.dp) + rightPadding: Math.round(32 * DefaultStyle.dp) + topPadding: Math.round(9 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) anchors.centerIn: parent background: Item{} contentItem: ColumnLayout { anchors.verticalCenter: parent.verticalCenter - spacing: 9 * DefaultStyle.dp + spacing: Math.round(9 * DefaultStyle.dp) RowLayout { - spacing: 4 * DefaultStyle.dp + spacing: Math.round(4 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Image { - Layout.preferredWidth: 12 * DefaultStyle.dp - Layout.preferredHeight: 12 * DefaultStyle.dp + Layout.preferredWidth: Math.round(12 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(12 * DefaultStyle.dp) source: AppIcons.logo } Text { text: "Linphone" color: DefaultStyle.grey_0 font { - pixelSize: 12 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Typography.b3.weight capitalization: Font.Capitalize } } } ColumnLayout { - spacing: 17 * DefaultStyle.dp + spacing: Math.round(17 * DefaultStyle.dp) ColumnLayout { - spacing: 14 * DefaultStyle.dp + spacing: Math.round(14 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter Avatar { - Layout.preferredWidth: 60 * DefaultStyle.dp - Layout.preferredHeight: 60 * DefaultStyle.dp + Layout.preferredWidth: Math.round(60 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(60 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter call: mainItem.call isConference: mainItem.call && mainItem.call.core.isConference @@ -73,14 +73,14 @@ Notification { Text { text: call.core.remoteName Layout.fillWidth: true - Layout.maximumWidth: (mainItem.width - content.leftPadding - content.rightPadding) * DefaultStyle.dp + Layout.maximumWidth: mainItem.width - content.leftPadding - content.rightPadding Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter maximumLineCount: 1 color: DefaultStyle.grey_0 font { - pixelSize: 20 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Typography.b3.weight capitalization: Font.Capitalize } } @@ -89,8 +89,8 @@ Notification { Layout.alignment: Qt.AlignHCenter color: DefaultStyle.grey_0 font { - pixelSize: 14 * DefaultStyle.dp - weight: 500 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) + weight: Math.round(500 * DefaultStyle.dp) } } } @@ -98,18 +98,18 @@ Notification { RowLayout { Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - spacing: 26 * DefaultStyle.dp + spacing: Math.round(26 * DefaultStyle.dp) Button { - spacing: 6 * DefaultStyle.dp + spacing: Math.round(6 * DefaultStyle.dp) style: ButtonStyle.phoneGreen - Layout.preferredWidth: 118 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(118 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) asynchronous: false - icon.width: 19 * DefaultStyle.dp - icon.height: 19 * DefaultStyle.dp + icon.width: Math.round(19 * DefaultStyle.dp) + icon.height: Math.round(19 * DefaultStyle.dp) text: qsTr("Répondre") - textSize: 14 * DefaultStyle.dp - textWeight: 500 * DefaultStyle.dp + textSize: Math.round(14 * DefaultStyle.dp) + textWeight: Math.round(500 * DefaultStyle.dp) onClicked: { console.debug("[NotificationReceivedCall] Accept click") UtilsCpp.openCallsWindow(mainItem.call) @@ -117,16 +117,16 @@ Notification { } } Button { - spacing: 6 * DefaultStyle.dp + spacing: Math.round(6 * DefaultStyle.dp) style: ButtonStyle.phoneRed - Layout.preferredWidth: 118 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(118 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) asynchronous: false - icon.width: 19 * DefaultStyle.dp - icon.height: 19 * DefaultStyle.dp + icon.width: Math.round(19 * DefaultStyle.dp) + icon.height: Math.round(19 * DefaultStyle.dp) text: qsTr("Refuser") - textSize: 14 * DefaultStyle.dp - textWeight: 500 * DefaultStyle.dp + textSize: Math.round(14 * DefaultStyle.dp) + textWeight: Math.round(500 * DefaultStyle.dp) onClicked: { console.debug("[NotificationReceivedCall] Decline click") mainItem.call.core.lDecline() diff --git a/Linphone/view/Control/Popup/Notification/TemporaryNotification.qml b/Linphone/view/Control/Popup/Notification/TemporaryNotification.qml index fc240cdf..b1581a7e 100644 --- a/Linphone/view/Control/Popup/Notification/TemporaryNotification.qml +++ b/Linphone/view/Control/Popup/Notification/TemporaryNotification.qml @@ -4,13 +4,13 @@ import Linphone Control.Control { id: mainItem - // width: 269 * DefaultStyle.dp + // width: Math.round(269 * DefaultStyle.dp) y: -height z: 1 - topPadding: 8 * DefaultStyle.dp - bottomPadding: 8 * DefaultStyle.dp - leftPadding: 37 * DefaultStyle.dp - rightPadding: 37 * DefaultStyle.dp + topPadding: Math.round(8 * DefaultStyle.dp) + bottomPadding: Math.round(8 * DefaultStyle.dp) + leftPadding: Math.round(37 * DefaultStyle.dp) + rightPadding: Math.round(37 * DefaultStyle.dp) anchors.horizontalCenter: parent.horizontalCenter clip: true @@ -41,15 +41,15 @@ Control.Control { anchors.fill: parent color: DefaultStyle.grey_0 border.color: mainItem.contentColor - border.width: 1 * DefaultStyle.dp - radius: 50 * DefaultStyle.dp + border.width: Math.max(Math.round(1 * DefaultStyle.dp), 1) + radius: Math.round(50 * DefaultStyle.dp) } contentItem: RowLayout { Image { visible: mainItem.imageSource != undefined source: mainItem.imageSource - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit Layout.fillWidth: true } @@ -58,8 +58,8 @@ Control.Control { text: mainItem.text Layout.fillWidth: true font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) } } } -} \ No newline at end of file +} diff --git a/Linphone/view/Control/Popup/NumericPadPopup.qml b/Linphone/view/Control/Popup/NumericPadPopup.qml index 77060802..428e53bd 100644 --- a/Linphone/view/Control/Popup/NumericPadPopup.qml +++ b/Linphone/view/Control/Popup/NumericPadPopup.qml @@ -9,10 +9,10 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle Control.Popup { id: mainItem closePolicy: Control.Popup.CloseOnEscape - leftPadding: 72 * DefaultStyle.dp - rightPadding: 72 * DefaultStyle.dp - topPadding: 41 * DefaultStyle.dp - bottomPadding: 18 * DefaultStyle.dp + leftPadding: Math.round(72 * DefaultStyle.dp) + rightPadding: Math.round(72 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) property bool closeButtonVisible: true property bool roundedBottom: false property bool lastRowVisible: true @@ -29,7 +29,7 @@ Control.Popup { width: parent.width height: parent.height color: DefaultStyle.grey_100 - radius: 20 * DefaultStyle.dp + radius: Math.round(20 * DefaultStyle.dp) } MultiEffect { id: effect @@ -57,11 +57,11 @@ Control.Popup { visible: mainItem.closeButtonVisible anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 10 * DefaultStyle.dp - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.topMargin: Math.round(10 * DefaultStyle.dp) + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) icon.source: AppIcons.closeX - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackground onClicked: mainItem.close() } diff --git a/Linphone/view/Control/Popup/Popup.qml b/Linphone/view/Control/Popup/Popup.qml index 6059471f..5736093c 100644 --- a/Linphone/view/Control/Popup/Popup.qml +++ b/Linphone/view/Control/Popup/Popup.qml @@ -7,14 +7,14 @@ Control.Popup{ id: mainItem padding: 0 property color underlineColor : DefaultStyle.main1_500_main - property int radius: 16 * DefaultStyle.dp + property real radius: Math.round(16 * DefaultStyle.dp) property bool hovered: mouseArea.containsMouse background: Item{ Rectangle { visible: mainItem.underlineColor != undefined width: mainItem.width - height: mainItem.height + 2 * DefaultStyle.dp + height: mainItem.height + Math.round(2 * DefaultStyle.dp) color: mainItem.underlineColor radius: mainItem.radius } diff --git a/Linphone/view/Control/Tool/MovableMouseArea.qml b/Linphone/view/Control/Tool/MovableMouseArea.qml index 76925620..71ba801e 100644 --- a/Linphone/view/Control/Tool/MovableMouseArea.qml +++ b/Linphone/view/Control/Tool/MovableMouseArea.qml @@ -13,7 +13,7 @@ MouseArea{ yClicked = mouseY } } - property int margin: 0 + property real margin: 0 // Position buffer property int xClicked : 0 property int yClicked : 0 diff --git a/Linphone/view/Control/Tool/Prototype/CallPrototype.qml b/Linphone/view/Control/Tool/Prototype/CallPrototype.qml index fc0a1254..f6a31244 100644 --- a/Linphone/view/Control/Tool/Prototype/CallPrototype.qml +++ b/Linphone/view/Control/Tool/Prototype/CallPrototype.qml @@ -129,7 +129,7 @@ Window { TextField { id: usernameToCall label: "Username to call" - Layout.preferredWidth: 250 * DefaultStyle.dp + Layout.preferredWidth: Math.round(250 * DefaultStyle.dp) } Button{ text: 'Call' diff --git a/Linphone/view/Control/Tool/Prototype/CanvasCircle.qml b/Linphone/view/Control/Tool/Prototype/CanvasCircle.qml index c813250f..922160c2 100644 --- a/Linphone/view/Control/Tool/Prototype/CanvasCircle.qml +++ b/Linphone/view/Control/Tool/Prototype/CanvasCircle.qml @@ -2,7 +2,7 @@ import QtQuick Item { id: root - property int size: 150 + property real size: 150 property color borderColor property color innerColor width: size @@ -22,7 +22,7 @@ Item { Canvas { id: c property bool animated: false - property int offset: 0 + property real offset: 0 anchors.fill: parent antialiasing: true onOffsetChanged: requestPaint() @@ -58,4 +58,4 @@ Item { } } } -} \ No newline at end of file +} diff --git a/Linphone/view/Page/Form/Call/NewCallForm.qml b/Linphone/view/Page/Form/Call/NewCallForm.qml index 1d8ac8f8..6a079346 100644 --- a/Linphone/view/Page/Form/Call/NewCallForm.qml +++ b/Linphone/view/Page/Form/Call/NewCallForm.qml @@ -23,15 +23,15 @@ FocusScope { ColumnLayout { anchors.fill: parent - spacing: 22 * DefaultStyle.dp + spacing: Math.round(22 * DefaultStyle.dp) ColumnLayout { - spacing: 18 * DefaultStyle.dp + spacing: Math.round(18 * DefaultStyle.dp) visible: mainItem.displayCurrentCalls Text { text: qsTr("Appels en cours") font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } Flickable { @@ -63,12 +63,12 @@ FocusScope { } onVisibleChanged: if (!visible) mainItem.numPadPopup.close() contentItem: ColumnLayout { - spacing: 38 * DefaultStyle.dp + spacing: Math.round(38 * DefaultStyle.dp) SearchBar { id: searchBar Layout.alignment: Qt.AlignTop Layout.fillWidth: true - Layout.rightMargin: 39 * DefaultStyle.dp + Layout.rightMargin: Math.round(39 * DefaultStyle.dp) focus: true color: mainItem.searchBarColor borderColor: mainItem.searchBarBorderColor @@ -78,19 +78,19 @@ FocusScope { } ColumnLayout { id: content - spacing: 32 * DefaultStyle.dp + spacing: Math.round(32 * DefaultStyle.dp) Button { id: grouCallButton visible: mainItem.groupCallVisible && !SettingsCpp.disableMeetingsFeature - Layout.preferredWidth: 320 * DefaultStyle.dp - Layout.preferredHeight: 44 * DefaultStyle.dp + Layout.preferredWidth: Math.round(320 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(44 * DefaultStyle.dp) padding: 0 KeyNavigation.up: searchBar KeyNavigation.down: contactList onClicked: mainItem.groupCallCreationRequested() background: Rectangle { anchors.fill: parent - radius: 50 * DefaultStyle.dp + radius: Math.round(50 * DefaultStyle.dp) gradient: Gradient { orientation: Gradient.Horizontal GradientStop { position: 0.0; color: DefaultStyle.main2_100} @@ -98,20 +98,20 @@ FocusScope { } } contentItem: RowLayout { - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter Image { source: AppIcons.groupCall - Layout.preferredWidth: 44 * DefaultStyle.dp - sourceSize.width: 44 * DefaultStyle.dp + Layout.preferredWidth: Math.round(44 * DefaultStyle.dp) + sourceSize.width: Math.round(44 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit } Text { text: "Appel de groupe" color: DefaultStyle.grey_1000 font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } Item { @@ -119,8 +119,8 @@ FocusScope { } EffectImage { imageSource: AppIcons.rightArrow - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) colorizationColor: DefaultStyle.main2_500main } } diff --git a/Linphone/view/Page/Form/Contact/ContactDescription.qml b/Linphone/view/Page/Form/Contact/ContactDescription.qml index 9e89aa87..0cc4dfcb 100644 --- a/Linphone/view/Page/Form/Contact/ContactDescription.qml +++ b/Linphone/view/Page/Form/Contact/ContactDescription.qml @@ -19,8 +19,8 @@ ColumnLayout{ Layout.fillWidth: true verticalAlignment: (bottomTextItem.visible?Text.AlignBottom:Text.AlignVCenter) visible: text != "" - font.weight: 400 * DefaultStyle.dp - font.pixelSize: 14 * DefaultStyle.dp + font.weight: Typography.p1.weight + font.pixelSize: Typography.p1.pixelSize color: DefaultStyle.main2_700 text: mainItem.topText width: mainItem.width @@ -33,8 +33,8 @@ ColumnLayout{ Layout.fillWidth: true verticalAlignment: (topTextItem.visible?Text.AlignTop:Text.AlignVCenter) visible: text != '' - font.weight: 300 * DefaultStyle.dp - font.pixelSize: 12 * DefaultStyle.dp + font.weight: Math.round(300 * DefaultStyle.dp) + font.pixelSize: Math.round(12 * DefaultStyle.dp) color: DefaultStyle.main2_400 text: mainItem.bottomText maximumLineCount: 1 diff --git a/Linphone/view/Page/Form/Contact/ContactEdition.qml b/Linphone/view/Page/Form/Contact/ContactEdition.qml index 26dabd0e..7f082f34 100644 --- a/Linphone/view/Page/Form/Contact/ContactEdition.qml +++ b/Linphone/view/Page/Form/Contact/ContactEdition.qml @@ -24,7 +24,7 @@ MainRightPanel { property string title: qsTr("Modifier contact") property string saveButtonText: qsTr("Enregistrer") property string oldPictureUri - property int addressCount: 0 + property int addressCount: 0 signal closeEdition(var redirectAddress) @@ -34,31 +34,31 @@ MainRightPanel { mainItem.contact.core.undo() mainItem.closeEdition('') } - width: 278 * DefaultStyle.dp + width: Math.round(278 * DefaultStyle.dp) text: qsTr("Les changements seront annulés. Souhaitez-vous continuer ?") } headerContent: [ Text { anchors.left: parent.left - anchors.leftMargin: 31 * DefaultStyle.dp + anchors.leftMargin: Math.round(31 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter text: mainItem.title font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Typography.h4.weight } }, Button { style: ButtonStyle.noBackground anchors.right: parent.right - anchors.rightMargin: 41 * DefaultStyle.dp + anchors.rightMargin: Math.round(41 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.closeX - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) onClicked: { if (contact.core.isSaved) mainItem.closeEdition('') else showConfirmationLambdaPopup("", qsTr("Les changements seront annulés. Souhaitez-vous continuer ?"), "", function(confirmed) { @@ -102,8 +102,8 @@ MainRightPanel { visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0 icon.source: AppIcons.camera text: qsTr("Ajouter une image") - textSize: 16 * DefaultStyle.dp - textWeight: 800 * DefaultStyle.dp + textSize: Typography.h4.pixelSize + textWeight: Typography.h4.weight textColor: DefaultStyle.main2_700 hoveredTextColor: DefaultStyle.main2_800 pressedTextColor: DefaultStyle.main2_900 @@ -113,7 +113,7 @@ MainRightPanel { RowLayout { visible: mainItem.contact && mainItem.contact.core.pictureUri.length != 0 Layout.alignment: Qt.AlignHCenter - spacing: 32 * DefaultStyle.dp + spacing: Math.round(32 * DefaultStyle.dp) IconLabelButton { id: editButton Layout.preferredWidth: width @@ -122,8 +122,8 @@ MainRightPanel { textColor: DefaultStyle.main2_700 hoveredTextColor: DefaultStyle.main2_800 pressedTextColor: DefaultStyle.main2_900 - textSize: 16 * DefaultStyle.dp - textWeight: 800 * DefaultStyle.dp + textSize: Typography.h4.pixelSize + textWeight: Typography.h4.weight KeyNavigation.right: removeButton onClicked: fileDialog.open() } @@ -146,8 +146,8 @@ MainRightPanel { textColor: DefaultStyle.main2_700 hoveredTextColor: DefaultStyle.main2_800 pressedTextColor: DefaultStyle.main2_900 - textSize: 16 * DefaultStyle.dp - textWeight: 800 * DefaultStyle.dp + textSize: Typography.h4.pixelSize + textWeight: Typography.h4.weight KeyNavigation.left: editButton onClicked: mainItem.contact.core.pictureUri = "" } @@ -156,7 +156,7 @@ MainRightPanel { ] content: Flickable { id: editionLayout - contentWidth: 421 * DefaultStyle.dp + contentWidth: Math.round(421 * DefaultStyle.dp) contentY: 0 signal ensureVisibleRequested(Item item) @@ -184,7 +184,7 @@ MainRightPanel { ScrollBar.horizontal: Control.ScrollBar { } ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) anchors.left: parent.left anchors.right: parent.right @@ -195,7 +195,7 @@ MainRightPanel { label: qsTr("Prénom") contentItem: TextField { id: givenNameEdit - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) initialText: contact.core.givenName onTextEdited: { contact.core.givenName = givenNameEdit.text @@ -260,7 +260,7 @@ MainRightPanel { label: modelData.label contentItem: RowLayout { id: addressLayout - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) function updateFocus(event){ if(event.key == Qt.Key_Up){ if(index - 1 >=0 ) @@ -278,7 +278,7 @@ MainRightPanel { } TextField { id: addressTextField - Layout.preferredWidth: 421 * DefaultStyle.dp + Layout.preferredWidth: Math.round(421 * DefaultStyle.dp) Layout.preferredHeight: height onEditingFinished: { if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text) @@ -292,12 +292,12 @@ MainRightPanel { } Button { id: removeAddressButton - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter icon.source: AppIcons.closeX - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackground KeyNavigation.left: addressTextField Keys.onPressed: (event) => addressLayout.updateFocus(event) @@ -347,7 +347,7 @@ MainRightPanel { label: modelData.label contentItem: RowLayout { id: phoneNumberLayout - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) function updateFocus(event){ if(event.key == Qt.Key_Up){ if(index - 1 >=0 ) @@ -365,7 +365,7 @@ MainRightPanel { } TextField { id: phoneTextField - Layout.preferredWidth: 421 * DefaultStyle.dp + Layout.preferredWidth: Math.round(421 * DefaultStyle.dp) Layout.preferredHeight: height initialText: modelData.address backgroundColor: DefaultStyle.grey_0 @@ -378,13 +378,13 @@ MainRightPanel { } Button { id: removePhoneButton - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter style: ButtonStyle.noBackground icon.source: AppIcons.closeX - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) KeyNavigation.left: phoneTextField Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event) onClicked: mainItem.contact.core.removePhoneNumber(index) diff --git a/Linphone/view/Page/Form/Login/LoginPage.qml b/Linphone/view/Page/Form/Login/LoginPage.qml index 24a72ea8..23cc96d7 100644 --- a/Linphone/view/Page/Form/Login/LoginPage.qml +++ b/Linphone/view/Page/Form/Login/LoginPage.qml @@ -19,7 +19,7 @@ LoginLayout { BigButton { enabled: mainItem.showBackButton opacity: mainItem.showBackButton ? 1.0 : 0 - Layout.leftMargin: 79 * DefaultStyle.dp + Layout.leftMargin: Math.round(79 * DefaultStyle.dp) icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground onClicked: { @@ -28,20 +28,20 @@ LoginLayout { } }, RowLayout { - spacing: 15 * DefaultStyle.dp - Layout.leftMargin: 21 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) + Layout.leftMargin: Math.round(21 * DefaultStyle.dp) EffectImage { fillMode: Image.PreserveAspectFit imageSource: AppIcons.profile colorizationColor: DefaultStyle.main2_600 - Layout.preferredHeight: 34 * DefaultStyle.dp - Layout.preferredWidth: 34 * DefaultStyle.dp + Layout.preferredHeight: Math.round(34 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(34 * DefaultStyle.dp) } Text { text: qsTr("Connexion") font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } } }, @@ -50,13 +50,13 @@ LoginLayout { }, RowLayout { visible: !SettingsCpp.assistantHideCreateAccount - spacing: 20 * DefaultStyle.dp - Layout.rightMargin: 51 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) + Layout.rightMargin: Math.round(51 * DefaultStyle.dp) Text { - Layout.rightMargin: 15 * DefaultStyle.dp + Layout.rightMargin: Math.round(15 * DefaultStyle.dp) text: qsTr("Pas encore de compte ?") - font.pixelSize: 14 * DefaultStyle.dp - font.weight: 400 * DefaultStyle.dp + font.pixelSize: Typography.p1.pixelSize + font.weight: Typography.p1.weight } BigButton { Layout.alignment: Qt.AlignRight @@ -73,8 +73,8 @@ LoginLayout { Flickable { anchors.left: parent.left anchors.top: parent.top - anchors.leftMargin: 127 * DefaultStyle.dp - anchors.topMargin: 70 * DefaultStyle.dp + anchors.leftMargin: Math.round(127 * DefaultStyle.dp) + anchors.topMargin: Math.round(70 * DefaultStyle.dp) anchors.bottom: parent.bottom ColumnLayout { id: content @@ -84,8 +84,8 @@ LoginLayout { } BigButton { Layout.preferredWidth: loginForm.width - Layout.preferredHeight: 47 * DefaultStyle.dp - Layout.topMargin: 39 * DefaultStyle.dp + Layout.preferredHeight: Math.round(47 * DefaultStyle.dp) + Layout.topMargin: Math.round(39 * DefaultStyle.dp) visible: !SettingsCpp.assistantHideThirdPartyAccount text: qsTr("Compte SIP tiers") style: ButtonStyle.secondary @@ -93,8 +93,8 @@ LoginLayout { } BigButton { Layout.preferredWidth: loginForm.width - Layout.preferredHeight: 47 * DefaultStyle.dp - Layout.topMargin: 25 * DefaultStyle.dp + Layout.preferredHeight: Math.round(47 * DefaultStyle.dp) + Layout.topMargin: Math.round(25 * DefaultStyle.dp) text: qsTr("Configuration distante") style: ButtonStyle.secondary onClicked: {fetchConfigDialog.open()} @@ -105,22 +105,22 @@ LoginLayout { z: -1 anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 129 * DefaultStyle.dp - anchors.rightMargin: 127 * DefaultStyle.dp - width: 395 * DefaultStyle.dp - height: 350 * DefaultStyle.dp + anchors.topMargin: Math.round(129 * DefaultStyle.dp) + anchors.rightMargin: Math.round(127 * DefaultStyle.dp) + width: Math.round(395 * DefaultStyle.dp) + height: Math.round(350 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: AppIcons.loginImage } ] Dialog{ id: fetchConfigDialog - height: 315 * DefaultStyle.dp - width: 637 * DefaultStyle.dp - leftPadding: 33 * DefaultStyle.dp - rightPadding: 33 * DefaultStyle.dp - topPadding: 41 * DefaultStyle.dp - bottomPadding: 29 * DefaultStyle.dp + height: Math.round(315 * DefaultStyle.dp) + width: Math.round(637 * DefaultStyle.dp) + leftPadding: Math.round(33 * DefaultStyle.dp) + rightPadding: Math.round(33 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(29 * DefaultStyle.dp) radius: 0 title: qsTr('Télécharger une configuration distante') text: qsTr('Veuillez entrer le lien de configuration qui vous a été fourni :') @@ -139,7 +139,7 @@ LoginLayout { TextField{ id: configUrl Layout.fillWidth: true - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) placeholderText: qsTr('Lien de configuration distante') } ] diff --git a/Linphone/view/Page/Form/Login/SIPLoginPage.qml b/Linphone/view/Page/Form/Login/SIPLoginPage.qml index 068fce59..5772b40a 100644 --- a/Linphone/view/Page/Form/Login/SIPLoginPage.qml +++ b/Linphone/view/Page/Form/Login/SIPLoginPage.qml @@ -15,14 +15,14 @@ LoginLayout { titleContent: [ RowLayout { - Layout.leftMargin: 119 * DefaultStyle.dp + Layout.leftMargin: Math.round(119 * DefaultStyle.dp) visible: !SettingsCpp.assistantHideThirdPartyAccount - spacing: 21 * DefaultStyle.dp + spacing: Math.round(21 * DefaultStyle.dp) Button { id: backButton visible: mainItem.showBackButton - Layout.preferredHeight: 24 * DefaultStyle.dp - Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground onClicked: { @@ -33,15 +33,15 @@ LoginLayout { EffectImage { fillMode: Image.PreserveAspectFit imageSource: AppIcons.profile - Layout.preferredHeight: 34 * DefaultStyle.dp - Layout.preferredWidth: 34 * DefaultStyle.dp + Layout.preferredHeight: Math.round(34 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(34 * DefaultStyle.dp) colorizationColor: DefaultStyle.main2_600 } Text { text: qsTr("Compte SIP tiers") font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } scaleLettersFactor: 1.1 } @@ -51,14 +51,14 @@ LoginLayout { }, RowLayout { visible: !SettingsCpp.assistantHideCreateAccount - Layout.rightMargin: 51 * DefaultStyle.dp - spacing: 20 * DefaultStyle.dp + Layout.rightMargin: Math.round(51 * DefaultStyle.dp) + spacing: Math.round(20 * DefaultStyle.dp) Text { - Layout.rightMargin: 15 * DefaultStyle.dp + Layout.rightMargin: Math.round(15 * DefaultStyle.dp) text: qsTr("Pas encore de compte ?") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } BigButton { @@ -83,19 +83,19 @@ LoginLayout { flickableDirection: Flickable.VerticalFlick ColumnLayout { id: content - spacing: 85 * DefaultStyle.dp + spacing: Math.round(85 * DefaultStyle.dp) ColumnLayout { spacing: 0 ColumnLayout { - spacing: 28 * DefaultStyle.dp + spacing: Math.round(28 * DefaultStyle.dp) Text { Layout.fillWidth: true Layout.preferredWidth: rootStackView.width wrapMode: Text.WordWrap color: DefaultStyle.main2_900 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400* DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } text: "Certaines fonctionnalités nécessitent un compte Linphone, comme la messagerie de groupe, les vidéoconférences..." } @@ -105,8 +105,8 @@ LoginLayout { wrapMode: Text.WordWrap color: DefaultStyle.main2_900 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400* DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } text:"Ces fonctionnalités sont cachées lorsque vous vous enregistrez avec un compte SIP tiers." } @@ -116,8 +116,8 @@ LoginLayout { wrapMode: Text.WordWrap color: DefaultStyle.main2_900 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400* DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } text: "Pour les activer dans un projet commercial, veuillez nous contacter. " } @@ -125,7 +125,7 @@ LoginLayout { SmallButton { id: openLinkButton Layout.alignment: Qt.AlignCenter - Layout.topMargin: 18 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) text: "linphone.org/contact" style: ButtonStyle.secondary onClicked: { @@ -136,7 +136,7 @@ LoginLayout { } } ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) BigButton { id: createAccountButton style: ButtonStyle.secondary @@ -176,11 +176,11 @@ LoginLayout { flickableDirection: Flickable.VerticalFlick ColumnLayout { id: content - spacing: 2 * DefaultStyle.dp - width: 361 * DefaultStyle.dp + spacing: Math.round(2 * DefaultStyle.dp) + width: Math.round(361 * DefaultStyle.dp) ColumnLayout { - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) FormItemLayout { id: username label: qsTr("Nom d'utilisateur") @@ -190,7 +190,7 @@ LoginLayout { contentItem: TextField { id: usernameEdit isError: username.errorTextVisible || errorText.isVisible - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.down: passwordEdit } } @@ -204,7 +204,7 @@ LoginLayout { id: passwordEdit isError: password.errorTextVisible || errorText.isVisible hidden: true - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.up: usernameEdit KeyNavigation.down: domainEdit } @@ -219,7 +219,7 @@ LoginLayout { id: domainEdit isError: domain.errorTextVisible initialText: SettingsCpp.assistantThirdPartySipAccountDomain - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.up: passwordEdit KeyNavigation.down: displayName } @@ -235,7 +235,7 @@ LoginLayout { Layout.fillWidth: true contentItem: TextField { id: displayName - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) KeyNavigation.up: domainEdit KeyNavigation.down: transportCbox } @@ -246,8 +246,8 @@ LoginLayout { Layout.fillWidth: true contentItem: ComboBox { id: transportCbox - height: 49 * DefaultStyle.dp - width: 360 * DefaultStyle.dp + height: Math.round(49 * DefaultStyle.dp) + width: Math.round(360 * DefaultStyle.dp) textRole: "text" valueRole: "value" model: [ @@ -275,7 +275,7 @@ LoginLayout { BigButton { id: connectionButton - Layout.topMargin: 32 * DefaultStyle.dp + Layout.topMargin: Math.round(32 * DefaultStyle.dp) style: ButtonStyle.main contentItem: StackLayout { id: connectionButtonContent @@ -286,8 +286,8 @@ LoginLayout { verticalAlignment: Text.AlignVCenter font { - pixelSize: 18 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Typography.b1.pixelSize + weight: Typography.b1.weight } color: DefaultStyle.grey_0 } @@ -358,18 +358,18 @@ LoginLayout { anchors.top: parent.top anchors.left: parent.left anchors.bottom: parent.bottom - anchors.topMargin: 70 * DefaultStyle.dp - anchors.leftMargin: 127 * DefaultStyle.dp - width: 361 * DefaultStyle.dp + anchors.topMargin: Math.round(70 * DefaultStyle.dp) + anchors.leftMargin: Math.round(127 * DefaultStyle.dp) + width: Math.round(361 * DefaultStyle.dp) }, Image { z: -1 anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 129 * DefaultStyle.dp - anchors.rightMargin: 127 * DefaultStyle.dp - width: 395 * DefaultStyle.dp - height: 350 * DefaultStyle.dp + anchors.topMargin: Math.round(129 * DefaultStyle.dp) + anchors.rightMargin: Math.round(127 * DefaultStyle.dp) + width: Math.round(395 * DefaultStyle.dp) + height: Math.round(350 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: AppIcons.loginImage } diff --git a/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml b/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml index 3692afa0..16238632 100644 --- a/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml +++ b/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml @@ -24,7 +24,7 @@ FocusScope{ ColumnLayout { anchors.fill: parent - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) ListView { id: participantList Layout.fillWidth: true @@ -40,14 +40,14 @@ FocusScope{ } } delegate: FocusScope { - height: 56 * DefaultStyle.dp - width: participantList.width - scrollbar.implicitWidth - 28 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) + width: participantList.width - scrollbar.implicitWidth - Math.round(28 * DefaultStyle.dp) RowLayout { anchors.fill: parent - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData shadowEnabled: false } @@ -56,19 +56,19 @@ FocusScope{ maximumLineCount: 1 property var nameObj: UtilsCpp.getDisplayName(modelData) text: nameObj ? nameObj.value : "" - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) font.capitalization: Font.Capitalize } Item { Layout.fillWidth: true } Button { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackgroundOrange icon.source: AppIcons.closeX - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) focus: true onClicked: contactList.removeSelectedContactByAddress(modelData) } @@ -82,15 +82,15 @@ FocusScope{ anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 8 * DefaultStyle.dp + anchors.rightMargin: Math.round(8 * DefaultStyle.dp) } } SearchBar { id: searchBar Layout.fillWidth: true - Layout.topMargin: 6 * DefaultStyle.dp - Layout.rightMargin: 28 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.topMargin: Math.round(6 * DefaultStyle.dp) + Layout.rightMargin: Math.round(28 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) placeholderText: mainItem.placeHolderText focus: participantList.count == 0 color: mainItem.searchBarColor @@ -102,22 +102,22 @@ FocusScope{ } ColumnLayout { id: content - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) Text { visible: !contactList.loading && contactList.count === 0 Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 137 * DefaultStyle.dp + Layout.topMargin: Math.round(137 * DefaultStyle.dp) text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "") font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } AllContactListView{ id: contactList Layout.fillWidth: true Layout.fillHeight: true - itemsRightMargin: 28 * DefaultStyle.dp + itemsRightMargin: Math.round(28 * DefaultStyle.dp) multiSelectionEnabled: true showContactMenu: false confInfoGui: mainItem.conferenceInfoGui diff --git a/Linphone/view/Page/Form/Meeting/MeetingForm.qml b/Linphone/view/Page/Form/Meeting/MeetingForm.qml index 8c162a55..d2d2d7f5 100644 --- a/Linphone/view/Page/Form/Meeting/MeetingForm.qml +++ b/Linphone/view/Page/Form/Meeting/MeetingForm.qml @@ -15,7 +15,7 @@ FocusScope { ColumnLayout { id: formLayout - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) anchors.fill: parent Component.onCompleted: { @@ -26,14 +26,14 @@ FocusScope { RowLayout { visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature - Layout.topMargin: 20 * DefaultStyle.dp - Layout.bottomMargin: 20 * DefaultStyle.dp - spacing: 18 * DefaultStyle.dp + Layout.topMargin: Math.round(20 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(20 * DefaultStyle.dp) + spacing: Math.round(18 * DefaultStyle.dp) CheckableButton { - Layout.preferredWidth: 151 * DefaultStyle.dp + Layout.preferredWidth: Math.round(151 * DefaultStyle.dp) icon.source: AppIcons.usersThree - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) enabled: false text: qsTr("Réunion") checked: true @@ -41,11 +41,11 @@ FocusScope { style: ButtonStyle.secondary } CheckableButton { - Layout.preferredWidth: 151 * DefaultStyle.dp + Layout.preferredWidth: Math.round(151 * DefaultStyle.dp) enabled: false icon.source: AppIcons.slide - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) text: qsTr("Broadcast") autoExclusive: true style: ButtonStyle.secondary @@ -55,12 +55,12 @@ FocusScope { visible: mainItem.isCreation spacing: formLayout.spacing content: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.usersThree colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } TextInput { id: confTitle @@ -69,8 +69,8 @@ FocusScope { text: defaultText color: DefaultStyle.main2_600 font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Typography.h3.weight } focus: true onActiveFocusChanged: if(activeFocus) { @@ -90,16 +90,16 @@ FocusScope { EffectImage { imageSource: AppIcons.clock colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } CalendarComboBox { id: startDate background.visible: mainItem.isCreation indicator.visible: mainItem.isCreation - contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp + contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000) Layout.fillWidth: true - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) KeyNavigation.up: confTitle KeyNavigation.down: startHour onSelectedDateChanged: { @@ -113,17 +113,17 @@ FocusScope { }, RowLayout { Item { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } RowLayout { TimeComboBox { id: startHour // indicator.visible: mainItem.isCreation - Layout.preferredWidth: 94 * DefaultStyle.dp - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredWidth: Math.round(94 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) background.visible: mainItem.isCreation - contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp + contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000) KeyNavigation.up: startDate KeyNavigation.down: timeZoneCbox KeyNavigation.left: endHour @@ -140,10 +140,10 @@ FocusScope { TimeComboBox { id: endHour // indicator.visible: mainItem.isCreation - Layout.preferredWidth: 94 * DefaultStyle.dp - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredWidth: Math.round(94 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) background.visible: mainItem.isCreation - contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp + contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000) onSelectedDateTimeChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime KeyNavigation.up: startDate KeyNavigation.down: timeZoneCbox @@ -159,8 +159,8 @@ FocusScope { property int min: (durationSec - hour*3600)/60 text: (hour > 0 ? hour + "h" : "") + (min > 0 ? min + "mn" : "") font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } } } @@ -169,12 +169,12 @@ FocusScope { ComboBox { id: timeZoneCbox Layout.fillWidth: true - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) hoverEnabled: true oneLine: true - listView.implicitHeight: 250 * DefaultStyle.dp + listView.implicitHeight: Math.round(250 * DefaultStyle.dp) constantImageSource: AppIcons.globe - weight: 700 * DefaultStyle.dp + weight: Typography.p2l.weight leftMargin: 0 currentIndex: mainItem.conferenceInfoGui && model.count > 0 ? model.getIndex(mainItem.conferenceInfoGui.core.timeZoneModel) : -1 background: Rectangle { @@ -196,28 +196,28 @@ FocusScope { Section { spacing: formLayout.spacing content: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.note colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } TextArea { id: descriptionEdit Layout.fillWidth: true - Layout.preferredWidth: 275 * DefaultStyle.dp - leftPadding: 8 * DefaultStyle.dp - rightPadding: 8 * DefaultStyle.dp + Layout.preferredWidth: Math.round(275 * DefaultStyle.dp) + leftPadding: Math.round(8 * DefaultStyle.dp) + rightPadding: Math.round(8 * DefaultStyle.dp) hoverEnabled: true placeholderText: qsTr("Ajouter une description") placeholderTextColor: DefaultStyle.main2_600 - placeholderWeight: 700 * DefaultStyle.dp + placeholderWeight: Typography.p2l.weight color: DefaultStyle.main2_600 Component.onCompleted: text = conferenceInfoGui.core.description font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } onEditingFinished: mainItem.conferenceInfoGui.core.description = text Keys.onPressed: (event)=> { @@ -230,7 +230,7 @@ FocusScope { background: Rectangle { anchors.fill: parent color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent" - radius: 4 * DefaultStyle.dp + radius: Math.round(4 * DefaultStyle.dp) } } } @@ -241,26 +241,26 @@ FocusScope { Button { id: addParticipantsButton Layout.fillWidth: true - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent color: addParticipantsButton.hovered || addParticipantsButton.activeFocus ? DefaultStyle.grey_100 : "transparent" - radius: 4 * DefaultStyle.dp + radius: Math.round(4 * DefaultStyle.dp) } contentItem: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.usersThree colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } Text { Layout.fillWidth: true text: qsTr("Ajouter des participants") font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } } } @@ -270,36 +270,36 @@ FocusScope { id: participantList Layout.fillWidth: true Layout.preferredHeight: contentHeight - Layout.maximumHeight: 250 * DefaultStyle.dp + Layout.maximumHeight: Math.round(250 * DefaultStyle.dp) clip: true model: mainItem.conferenceInfoGui.core.participants delegate: Item { - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) width: participantList.width RowLayout { anchors.fill: parent - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData.address shadowEnabled: false } Text { property var displayNameObj: UtilsCpp.getDisplayName(modelData.address) text: displayNameObj?.value || "" - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) font.capitalization: Font.Capitalize } Item { Layout.fillWidth: true } Button { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp - Layout.rightMargin: 10 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) + Layout.rightMargin: Math.round(10 * DefaultStyle.dp) icon.source: AppIcons.closeX style: ButtonStyle.noBackgroundOrange onClicked: mainItem.conferenceInfoGui.core.removeParticipant(index) @@ -316,7 +316,7 @@ FocusScope { } Item { Layout.fillHeight: true - Layout.minimumHeight: 1 * DefaultStyle.dp + Layout.minimumHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) } } } diff --git a/Linphone/view/Page/Form/Register/RegisterCheckingPage.qml b/Linphone/view/Page/Form/Register/RegisterCheckingPage.qml index cf165d01..aca4c707 100644 --- a/Linphone/view/Page/Form/Register/RegisterCheckingPage.qml +++ b/Linphone/view/Page/Form/Register/RegisterCheckingPage.qml @@ -17,11 +17,11 @@ LoginLayout { onCtrlIsPressedChanged: console.log("ctrl is pressed", ctrlIsPressed) titleContent: [ RowLayout { - spacing: 21 * DefaultStyle.dp - Layout.leftMargin: 119 * DefaultStyle.dp + spacing: Math.round(21 * DefaultStyle.dp) + Layout.leftMargin: Math.round(119 * DefaultStyle.dp) Button { - Layout.preferredHeight: 24 * DefaultStyle.dp - Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground onClicked: { @@ -32,8 +32,8 @@ LoginLayout { EffectImage { fillMode: Image.PreserveAspectFit imageSource: AppIcons.profile - Layout.preferredHeight: 34 * DefaultStyle.dp - Layout.preferredWidth: 34 * DefaultStyle.dp + Layout.preferredHeight: Math.round(34 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(34 * DefaultStyle.dp) colorizationColor: DefaultStyle.main2_600 } Text { @@ -43,8 +43,8 @@ LoginLayout { text = qsTr("Inscription | Confirmer votre ") + completeString } font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } scaleLettersFactor: 1.1 } @@ -58,14 +58,14 @@ LoginLayout { ColumnLayout { anchors.left: parent.left anchors.top: parent.top - anchors.topMargin: 51 * DefaultStyle.dp - anchors.leftMargin: 127 * DefaultStyle.dp - spacing: 104 * DefaultStyle.dp + anchors.topMargin: Math.round(51 * DefaultStyle.dp) + anchors.leftMargin: Math.round(127 * DefaultStyle.dp) + spacing: Math.round(104 * DefaultStyle.dp) Text { font { bold: true - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } color: DefaultStyle.main2_700 text: { @@ -74,7 +74,7 @@ LoginLayout { } } RowLayout { - spacing: 45 * DefaultStyle.dp + spacing: Math.round(45 * DefaultStyle.dp) Repeater { model: 4 id: repeater @@ -139,12 +139,12 @@ LoginLayout { } } RowLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Text { text: "Didn't receive the code ?" color: DefaultStyle.main2_700 - font.pixelSize: 14 * DefaultStyle.dp - font.weight: 400 * DefaultStyle.dp + font.pixelSize: Typography.p1.pixelSize + font.weight: Typography.p1.weight } BigButton { style: ButtonStyle.secondary @@ -158,10 +158,10 @@ LoginLayout { Image { anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 140 * DefaultStyle.dp - anchors.rightMargin: 97 * DefaultStyle.dp - width: 477 * DefaultStyle.dp - height: 345 * DefaultStyle.dp + anchors.topMargin: Math.round(140 * DefaultStyle.dp) + anchors.rightMargin: Math.round(97 * DefaultStyle.dp) + width: Math.round(477 * DefaultStyle.dp) + height: Math.round(345 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: AppIcons.verif_page_image } diff --git a/Linphone/view/Page/Form/Register/RegisterPage.qml b/Linphone/view/Page/Form/Register/RegisterPage.qml index 85ab663a..c0840f6e 100644 --- a/Linphone/view/Page/Form/Register/RegisterPage.qml +++ b/Linphone/view/Page/Form/Register/RegisterPage.qml @@ -32,8 +32,8 @@ LoginLayout { titleContent: [ RowLayout { - spacing: 21 * DefaultStyle.dp - Layout.leftMargin: 79 * DefaultStyle.dp + spacing: Math.round(21 * DefaultStyle.dp) + Layout.leftMargin: Math.round(79 * DefaultStyle.dp) BigButton { style: ButtonStyle.noBackground icon.source: AppIcons.leftArrow @@ -45,16 +45,16 @@ LoginLayout { EffectImage { fillMode: Image.PreserveAspectFit imageSource: AppIcons.profile - Layout.preferredHeight: 34 * DefaultStyle.dp - Layout.preferredWidth: 34 * DefaultStyle.dp + Layout.preferredHeight: Math.round(34 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(34 * DefaultStyle.dp) colorizationColor: DefaultStyle.main2_600 } Text { Layout.preferredWidth: width text: qsTr("Inscription") font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } wrapMode: Text.NoWrap scaleLettersFactor: 1.1 @@ -64,15 +64,15 @@ LoginLayout { Layout.fillWidth: true }, RowLayout { - spacing: 20 * DefaultStyle.dp - Layout.rightMargin: 51 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) + Layout.rightMargin: Math.round(51 * DefaultStyle.dp) Text { - Layout.rightMargin: 15 * DefaultStyle.dp + Layout.rightMargin: Math.round(15 * DefaultStyle.dp) color: DefaultStyle.main2_700 text: qsTr("Déjà un compte ?") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } BigButton { @@ -89,10 +89,10 @@ LoginLayout { centerContent: [ ColumnLayout { anchors.fill: parent - anchors.topMargin: 51 * DefaultStyle.dp - anchors.leftMargin: 127 * DefaultStyle.dp - anchors.rightMargin: 127 * DefaultStyle.dp - spacing: 50 * DefaultStyle.dp + anchors.topMargin: Math.round(51 * DefaultStyle.dp) + anchors.leftMargin: Math.round(127 * DefaultStyle.dp) + anchors.rightMargin: Math.round(127 * DefaultStyle.dp) + spacing: Math.round(50 * DefaultStyle.dp) TabBar { Layout.fillWidth: true id: bar @@ -104,34 +104,34 @@ LoginLayout { ColumnLayout { anchors.left: parent.left anchors.right: parent.right - spacing: 22 * DefaultStyle.dp + spacing: Math.round(22 * DefaultStyle.dp) ColumnLayout { - spacing: 24 * DefaultStyle.dp + spacing: Math.round(24 * DefaultStyle.dp) RowLayout { Layout.preferredHeight: usernameItem.height - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) FormItemLayout { id: usernameItem label: qsTr("Username") mandatory: true enableErrorText: true - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) contentItem: TextField { id: usernameInput backgroundBorderColor: usernameItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 } } RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) ComboBox { - Layout.preferredWidth: 210 * DefaultStyle.dp - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredWidth: Math.round(210 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) enabled: false model: [{text:"@sip.linphone.org"}] } EffectImage { - Layout.preferredWidth: 16 * DefaultStyle.dp - Layout.preferredHeight: 16 * DefaultStyle.dp + Layout.preferredWidth: Math.round(16 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(16 * DefaultStyle.dp) imageSource: AppIcons.lock colorizationColor: DefaultStyle.main2_600 } @@ -141,7 +141,7 @@ LoginLayout { currentIndex: bar.currentIndex PhoneNumberInput { id: phoneNumberInput - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) property string completePhoneNumber: countryCode + phoneNumber label: qsTr("Numéro de téléphone") enableErrorText: true @@ -152,7 +152,7 @@ LoginLayout { FormItemLayout { id: emailItem Layout.fillWidth: false - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) label: qsTr("Email") mandatory: true enableErrorText: true @@ -168,29 +168,29 @@ LoginLayout { clip: false RowLayout { id: rowlayout - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) FormItemLayout { id: passwordItem - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) label: qsTr("Mot de passe") mandatory: true enableErrorText: true contentItem: TextField { id: pwdInput hidden: true - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 } } FormItemLayout { - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) label: qsTr("Confirmation mot de passe") mandatory: true enableErrorText: true contentItem: TextField { id: confirmPwdInput hidden: true - Layout.preferredWidth: 346 * DefaultStyle.dp + Layout.preferredWidth: Math.round(346 * DefaultStyle.dp) backgroundBorderColor: passwordItem.errorMessage.length > 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 } } @@ -198,23 +198,23 @@ LoginLayout { TemporaryText { id: otherErrorText Layout.fillWidth: true - Layout.topMargin: 5 * DefaultStyle.dp + Layout.topMargin: Math.round(5 * DefaultStyle.dp) onTextChanged: console.log("set error", text) } } } // ColumnLayout { - // spacing: 18 * DefaultStyle.dp + // spacing: Math.round(18 * DefaultStyle.dp) // RowLayout { - // spacing: 10 * DefaultStyle.dp + // spacing: Math.round(10 * DefaultStyle.dp) // CheckBox { // id: subscribeToNewsletterCheckBox // } // Text { // text: qsTr("Je souhaite souscrire à la newletter Linphone.") // font { - // pixelSize: 14 * DefaultStyle.dp - // weight: 400 * DefaultStyle.dp + // pixelSize: Typography.p1.pixelSize + // weight: Typography.p1.weight // } // MouseArea { // anchors.fill: parent @@ -224,7 +224,7 @@ LoginLayout { // } RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) CheckBox { id: termsCheckBox } @@ -234,8 +234,8 @@ LoginLayout { Text { text: qsTr("J'accepte les ") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } MouseArea { anchors.fill: parent @@ -246,8 +246,8 @@ LoginLayout { activeFocusOnTab: true font { underline: true - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight bold: activeFocus } text: qsTr("conditions d’utilisation") @@ -268,16 +268,16 @@ LoginLayout { Text { text: qsTr(" et la ") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } Text { activeFocusOnTab: true font { underline: true - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight bold: activeFocus } text: qsTr("politique de confidentialité.") @@ -335,10 +335,10 @@ LoginLayout { z: -1 anchors.top: parent.top anchors.right: parent.right - anchors.topMargin: 129 * DefaultStyle.dp - anchors.rightMargin: 127 * DefaultStyle.dp - width: 395 * DefaultStyle.dp - height: 350 * DefaultStyle.dp + anchors.topMargin: Math.round(129 * DefaultStyle.dp) + anchors.rightMargin: Math.round(127 * DefaultStyle.dp) + width: Math.round(395 * DefaultStyle.dp) + height: Math.round(350 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: AppIcons.loginImage } diff --git a/Linphone/view/Page/Form/Security/SecurityModePage.qml b/Linphone/view/Page/Form/Security/SecurityModePage.qml index ec5f05c5..fcd0f64d 100644 --- a/Linphone/view/Page/Form/Security/SecurityModePage.qml +++ b/Linphone/view/Page/Form/Security/SecurityModePage.qml @@ -13,35 +13,35 @@ LoginLayout { fillMode: Image.PreserveAspectFit imageSource: AppIcons.profile colorizationColor: DefaultStyle.main2_600 - Layout.preferredHeight: 34 * DefaultStyle.dp - Layout.preferredWidth: 34 * DefaultStyle.dp + Layout.preferredHeight: Math.round(34 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(34 * DefaultStyle.dp) } ColumnLayout { Text { text: qsTr("Choisir votre mode") font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } } Text { text: qsTr("Vous pourrez changer de mode plus tard.") font.bold: true font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } } centerContent: ColumnLayout { - spacing: 80 * DefaultStyle.dp + spacing: Math.round(80 * DefaultStyle.dp) RowLayout { id: radioButtonsLayout Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - spacing: 70 * DefaultStyle.dp + spacing: Math.round(70 * DefaultStyle.dp) Repeater { model: [ {checked: true, title: qsTr("Chiffrement de bout en bout"), text: qsTr("Ce mode vous garanti la confidentialité de tous vos échanges. Notre technologie de chiffrement de bout en bout assure un niveau de sécurité maximal pour tous vos échanges."), imgUrl: AppIcons.chiffrement, color: DefaultStyle.info_500_main}, @@ -63,7 +63,7 @@ LoginLayout { id: continueButton property int selectedIndex: 0 Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) text: qsTr("Continuer") style: ButtonStyle.main onClicked: mainItem.modeSelected(selectedIndex) diff --git a/Linphone/view/Page/Form/Settings/AbstractSettingsMenu.qml b/Linphone/view/Page/Form/Settings/AbstractSettingsMenu.qml index 9d73d6f2..271ea531 100644 --- a/Linphone/view/Page/Form/Settings/AbstractSettingsMenu.qml +++ b/Linphone/view/Page/Form/Settings/AbstractSettingsMenu.qml @@ -27,17 +27,17 @@ AbstractMainPage { id: leftPanel Layout.fillWidth: true Layout.fillHeight: true - property int sideMargin: 45 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + property real sideMargin: Math.round(45 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) RowLayout { Layout.fillWidth: true Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Button { id: backButton - Layout.preferredHeight: 24 * DefaultStyle.dp - Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground focus: true @@ -60,7 +60,7 @@ AbstractMainPage { Layout.fillWidth: true Layout.fillHeight: true model: mainItem.families - Layout.topMargin: 41 * DefaultStyle.dp + Layout.topMargin: Math.round(41 * DefaultStyle.dp) Layout.leftMargin: leftPanel.sideMargin property int selectedIndex: 0 activeFocusOnTab: true diff --git a/Linphone/view/Page/Layout/Login/LoginLayout.qml b/Linphone/view/Page/Layout/Login/LoginLayout.qml index 942b130a..33feddf7 100644 --- a/Linphone/view/Page/Layout/Login/LoginLayout.qml +++ b/Linphone/view/Page/Layout/Login/LoginLayout.qml @@ -18,15 +18,15 @@ Rectangle { component AboutLine: RowLayout { id: line - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) property var imageSource property string title property string text property bool enableMouseArea: false signal contentClicked() EffectImage { - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) imageSource: parent.imageSource colorizationColor: DefaultStyle.main1_500_main } @@ -37,8 +37,8 @@ Rectangle { text: line.title color: DefaultStyle.main2_600 font { - pixelSize: 15 * DefaultStyle.dp - weight: 600 * DefaultStyle.dp + pixelSize: Typography.b2.pixelSize + weight: Typography.b2.weight } horizontalAlignment: Layout.AlignLeft } @@ -47,7 +47,7 @@ Rectangle { Layout.fillWidth: true text: line.text color: DefaultStyle.main2_500main - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) horizontalAlignment: Layout.AlignLeft Keys.onPressed: (event)=> { if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) { @@ -71,13 +71,13 @@ Rectangle { Dialog { id: aboutPopup anchors.centerIn: parent - width: 637 * DefaultStyle.dp + width: Math.round(637 * DefaultStyle.dp) title: qsTr("À propos de Linphone") - bottomPadding: 10 * DefaultStyle.dp + bottomPadding: Math.round(10 * DefaultStyle.dp) buttons: [] content: RowLayout { ColumnLayout { - spacing: 17 * DefaultStyle.dp + spacing: Math.round(17 * DefaultStyle.dp) Layout.alignment: Qt.AlignTop | Qt.AlignLeft AboutLine { imageSource: AppIcons.detective @@ -103,7 +103,7 @@ Rectangle { } Item { // Item to shift close button - Layout.preferredHeight: 10 * DefaultStyle.dp + Layout.preferredHeight: Math.round(10 * DefaultStyle.dp) } } MediumButton { @@ -121,8 +121,8 @@ Rectangle { spacing: 0 RowLayout { Layout.fillWidth: true - Layout.preferredHeight: 102 * DefaultStyle.dp - Layout.rightMargin: 42 * DefaultStyle.dp + Layout.preferredHeight: Math.round(102 * DefaultStyle.dp) + Layout.rightMargin: Math.round(42 * DefaultStyle.dp) spacing: 0 Item { Layout.fillWidth: true @@ -142,7 +142,7 @@ Rectangle { RowLayout { id: titleLayout - Layout.preferredHeight: 131 * DefaultStyle.dp + Layout.preferredHeight: Math.round(131 * DefaultStyle.dp) Layout.fillWidth: true spacing: 0 } @@ -156,7 +156,7 @@ Rectangle { source: AppIcons.belledonne fillMode: Image.Stretch Layout.fillWidth: true - Layout.preferredHeight: 108 * DefaultStyle.dp + Layout.preferredHeight: Math.round(108 * DefaultStyle.dp) } } diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index 550f3905..da7e289a 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -114,12 +114,12 @@ Item { RowLayout { anchors.fill: parent spacing: 0 - anchors.topMargin: 25 * DefaultStyle.dp + anchors.topMargin: Math.round(25 * DefaultStyle.dp) VerticalTabBar { id: tabbar Layout.fillHeight: true - Layout.preferredWidth: 82 * DefaultStyle.dp + Layout.preferredWidth: Math.round(82 * DefaultStyle.dp) defaultAccount: accountProxy.defaultAccount currentIndex: 0 Binding on currentIndex { @@ -181,10 +181,10 @@ Item { RowLayout { id: topRow - Layout.preferredHeight: 50 * DefaultStyle.dp - Layout.leftMargin: 45 * DefaultStyle.dp - Layout.rightMargin: 41 * DefaultStyle.dp - spacing: 25 * DefaultStyle.dp + Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) + Layout.leftMargin: Math.round(45 * DefaultStyle.dp) + Layout.rightMargin: Math.round(41 * DefaultStyle.dp) + spacing: Math.round(25 * DefaultStyle.dp) SearchBar { id: magicSearchBar Layout.fillWidth: true @@ -216,25 +216,24 @@ Item { Popup { id: listPopup width: magicSearchBar.width - property int maxHeight: 400 * DefaultStyle.dp + property real maxHeight: Math.round(400 * DefaultStyle.dp) property bool displayScrollbar: contactList.height > maxHeight height: Math.min( contactList.contentHeight, maxHeight) + topPadding + bottomPadding y: magicSearchBar.height // closePolicy: Popup.CloseOnEscape - topPadding: 20 * DefaultStyle.dp - bottomPadding: contactList.haveContacts ? 20 * DefaultStyle.dp : 10 - * DefaultStyle.dp - rightPadding: 8 * DefaultStyle.dp - leftPadding: 20 * DefaultStyle.dp + topPadding: Math.round(20 * DefaultStyle.dp) + bottomPadding: Math.round((contactList.haveContacts ? 20 : 10) * DefaultStyle.dp) + rightPadding: Math.round(8 * DefaultStyle.dp) + leftPadding: Math.round(20 * DefaultStyle.dp) visible: magicSearchBar.text.length != 0 background: Item { anchors.fill: parent Rectangle { id: popupBg - radius: 16 * DefaultStyle.dp + radius: Math.round(16 * DefaultStyle.dp) color: DefaultStyle.grey_0 anchors.fill: parent border.color: DefaultStyle.main1_500_main @@ -254,7 +253,7 @@ Item { id: contactList width: listPopup.width - listPopup.leftPadding - listPopup.rightPadding - itemsRightMargin: 5 * DefaultStyle.dp //(Actions have already 10 of margin) + itemsRightMargin: Math.round(5 * DefaultStyle.dp) //(Actions have already 10 of margin) showInitials: false showContactMenu: false showActions: true @@ -263,28 +262,28 @@ Item { showDefaultAddress: true searchOnEmpty: false - sectionsPixelSize: 13 * DefaultStyle.dp - sectionsWeight: 700 * DefaultStyle.dp - sectionsSpacing: 5 * DefaultStyle.dp + sectionsPixelSize: Typography.p2.pixelSize + sectionsWeight: Typography.p2.weight + sectionsSpacing: Math.round(5 * DefaultStyle.dp) searchBarText: magicSearchBar.text } } } RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) PopupButton { id: deactivateDndButton - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp - popup.padding: 14 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) + popup.padding: Math.round(14 * DefaultStyle.dp) visible: SettingsCpp.dnd contentItem: EffectImage { imageSource: AppIcons.bellDnd - width: 32 * DefaultStyle.dp - height: 32 * DefaultStyle.dp - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp + width: Math.round(32 * DefaultStyle.dp) + height: Math.round(32 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit colorizationColor: DefaultStyle.main1_500_main } @@ -292,8 +291,8 @@ Item { IconLabelButton { Layout.fillWidth: true focus: visible - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Désactiver ne pas déranger") icon.source: AppIcons.bellDnd onClicked: { @@ -305,8 +304,8 @@ Item { } Voicemail { id: voicemail - Layout.preferredWidth: 42 * DefaultStyle.dp - Layout.preferredHeight: 36 * DefaultStyle.dp + Layout.preferredWidth: Math.round(42 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(36 * DefaultStyle.dp) Repeater { model: accountProxy delegate: Item { @@ -359,9 +358,9 @@ Item { } PopupButton { id: avatarButton - Layout.preferredWidth: 54 * DefaultStyle.dp + Layout.preferredWidth: Math.round(54 * DefaultStyle.dp) Layout.preferredHeight: width - popup.padding: 14 * DefaultStyle.dp + popup.padding: Math.round(14 * DefaultStyle.dp) contentItem: Avatar { id: avatar height: avatarButton.height @@ -381,10 +380,10 @@ Item { } PopupButton { id: settingsMenuButton - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - popup.width: 271 * DefaultStyle.dp - popup.padding: 14 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + popup.width: Math.round(271 * DefaultStyle.dp) + popup.padding: Math.round(14 * DefaultStyle.dp) popup.contentItem: FocusScope { id: popupFocus implicitHeight: settingsButtons.implicitHeight @@ -399,15 +398,15 @@ Item { ColumnLayout { id: settingsButtons - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) anchors.fill: parent IconLabelButton { id: accountButton Layout.fillWidth: true visible: !SettingsCpp.hideAccountSettings - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Mon compte") icon.source: AppIcons.manageProfile onClicked: openAccountSettings( @@ -422,8 +421,8 @@ Item { IconLabelButton { id: dndButton Layout.fillWidth: true - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: SettingsCpp.dnd ? qsTr("Désactiver ne pas déranger") : qsTr( "Activer ne pas déranger") icon.source: AppIcons.bellDnd @@ -442,8 +441,8 @@ Item { id: settingsButton Layout.fillWidth: true visible: !SettingsCpp.hideSettings - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Paramètres") icon.source: AppIcons.settings onClicked: openContextualMenuComponent( @@ -459,8 +458,8 @@ Item { id: recordsButton Layout.fillWidth: true visible: !SettingsCpp.disableCallRecordings - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Enregistrements") icon.source: AppIcons.micro KeyNavigation.up: visibleChildren.length @@ -473,8 +472,8 @@ Item { IconLabelButton { id: helpButton Layout.fillWidth: true - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Aide") icon.source: AppIcons.question onClicked: openContextualMenuComponent( @@ -489,8 +488,8 @@ Item { IconLabelButton { id: quitButton Layout.fillWidth: true - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Quitter Linphone") icon.source: AppIcons.power onClicked: { @@ -516,7 +515,7 @@ Item { } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) visible: addAccountButton.visible color: DefaultStyle.main2_400 } @@ -525,8 +524,8 @@ Item { Layout.fillWidth: true visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Ajouter un compte") icon.source: AppIcons.plusCircle onClicked: mainItem.addAccountRequest() @@ -643,7 +642,7 @@ Item { pushExit: noTransition popEnter: noTransition popExit: noTransition - Layout.topMargin: 24 * DefaultStyle.dp + Layout.topMargin: Math.round(24 * DefaultStyle.dp) Layout.fillWidth: true Layout.fillHeight: true initialItem: mainStackLayoutComponent diff --git a/Linphone/view/Page/Layout/Settings/AbstractSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/AbstractSettingsLayout.qml index 61050fc7..b0a49ca5 100644 --- a/Linphone/view/Page/Layout/Settings/AbstractSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AbstractSettingsLayout.qml @@ -16,14 +16,14 @@ Rectangle { property var model color: DefaultStyle.grey_0 property var container - // property int contentHeight: contentListView.contentHeight - property int minimumWidthForSwitchintToRowLayout: 981 * DefaultStyle.dp + // property real contentHeight: contentListView.contentHeight + property real minimumWidthForSwitchintToRowLayout: Math.round(981 * DefaultStyle.dp) property var useVerticalLayout property bool saveButtonVisible: true signal save() signal undo() function setResponsivityFlags() { - var newValue = width < minimumWidthForSwitchintToRowLayout * DefaultStyle.dp + var newValue = width < minimumWidthForSwitchintToRowLayout if (useVerticalLayout != newValue) { useVerticalLayout = newValue } @@ -38,8 +38,8 @@ Rectangle { id: header anchors.left: parent.left anchors.right: parent.right - leftPadding: 45 * DefaultStyle.dp - rightPadding: 45 * DefaultStyle.dp + leftPadding: Math.round(45 * DefaultStyle.dp) + rightPadding: Math.round(45 * DefaultStyle.dp) z: 1 background: Rectangle { anchors.fill: parent @@ -48,17 +48,17 @@ Rectangle { contentItem: ColumnLayout { RowLayout { Layout.fillWidth: true - Layout.topMargin: 20 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp - Layout.bottomMargin: 10 * DefaultStyle.dp + Layout.topMargin: Math.round(20 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(10 * DefaultStyle.dp) Button { id: backButton - Layout.preferredHeight: 24 * DefaultStyle.dp - Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) icon.source: AppIcons.leftArrow focus: true visible: mainItem.container.depth > 1 - Layout.rightMargin: 41 * DefaultStyle.dp + Layout.rightMargin: Math.round(41 * DefaultStyle.dp) style: ButtonStyle.noBackground onClicked: { mainItem.container.pop() @@ -75,13 +75,13 @@ Rectangle { Loader { Layout.alignment: Qt.AlignRight sourceComponent: mainItem.topbarOptionalComponent - Layout.rightMargin: 34 * DefaultStyle.dp + Layout.rightMargin: Math.round(34 * DefaultStyle.dp) } MediumButton { id: saveButton style: ButtonStyle.main text: qsTr("Enregistrer") - Layout.rightMargin: 6 * DefaultStyle.dp + Layout.rightMargin: Math.round(6 * DefaultStyle.dp) visible: mainItem.saveButtonVisible onClicked: { mainItem.save() @@ -90,7 +90,7 @@ Rectangle { } Rectangle { Layout.fillWidth: true - height: 1 * DefaultStyle.dp + height: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_500main } } @@ -101,7 +101,7 @@ Rectangle { anchors.right: parent.right anchors.bottom: parent.bottom anchors.top: header.bottom - anchors.topMargin: 16 * DefaultStyle.dp + anchors.topMargin: Math.round(16 * DefaultStyle.dp) // Workaround while the CI is made with Qt6.5.3 // When updated to 6.8, remove this Item and // change the ScrollView with a Flickable @@ -115,7 +115,7 @@ Rectangle { anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 15 * DefaultStyle.dp + anchors.rightMargin: Math.round(15 * DefaultStyle.dp) } Control.ScrollBar.horizontal: ScrollBar { active: false @@ -125,19 +125,19 @@ Rectangle { model: mainItem.contentModel anchors.left: parent.left anchors.right: parent.right - anchors.leftMargin: 45 * DefaultStyle.dp - anchors.rightMargin: 45 * DefaultStyle.dp + anchors.leftMargin: Math.round(45 * DefaultStyle.dp) + anchors.rightMargin: Math.round(45 * DefaultStyle.dp) height: contentHeight - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) delegate: ColumnLayout { - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) width: contentListView.width Rectangle { visible: index !== 0 - Layout.topMargin: (modelData.hideTopSeparator ? 0 : 16) * DefaultStyle.dp - Layout.bottomMargin: 16 * DefaultStyle.dp + Layout.topMargin: Math.round((modelData.hideTopSeparator ? 0 : 16) * DefaultStyle.dp) + Layout.bottomMargin: Math.round(16 * DefaultStyle.dp) Layout.fillWidth: true - height: 1 * DefaultStyle.dp + height: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: modelData.hideTopSeparator ? 'transparent' : DefaultStyle.main2_500main } GridLayout { @@ -145,12 +145,12 @@ Rectangle { columns: mainItem.useVerticalLayout ? 1 : 2 Layout.fillWidth: true // Layout.preferredWidth: parent.width - rowSpacing: (modelData.title.length > 0 || modelData.subTitle.length > 0 ? 20 : 0) * DefaultStyle.dp - columnSpacing: 47 * DefaultStyle.dp + rowSpacing: Math.round((modelData.title.length > 0 || modelData.subTitle.length > 0 ? 20 : 0) * DefaultStyle.dp) + columnSpacing: Math.round(47 * DefaultStyle.dp) ColumnLayout { - Layout.preferredWidth: 341 * DefaultStyle.dp - Layout.maximumWidth: 341 * DefaultStyle.dp - spacing: 3 * DefaultStyle.dp + Layout.preferredWidth: Math.round(341 * DefaultStyle.dp) + Layout.maximumWidth: Math.round(341 * DefaultStyle.dp) + spacing: Math.round(3 * DefaultStyle.dp) Text { text: modelData.title visible: modelData.title.length > 0 @@ -172,10 +172,10 @@ Rectangle { } } RowLayout { - Layout.topMargin: (modelData.hideTopMargin ? 0 : (mainItem.useVerticalLayout ? 10 : 21)) * DefaultStyle.dp - Layout.bottomMargin: 21 * DefaultStyle.dp - Layout.leftMargin: (mainItem.useVerticalLayout ? 0 : 17) * DefaultStyle.dp - Layout.preferredWidth: (modelData.customWidth > 0 ? modelData.customWidth : 545) * DefaultStyle.dp + Layout.topMargin: Math.round((modelData.hideTopMargin ? 0 : (mainItem.useVerticalLayout ? 10 : 21)) * DefaultStyle.dp) + Layout.bottomMargin: Math.round(21 * DefaultStyle.dp) + Layout.leftMargin: mainItem.useVerticalLayout ? 0 : Math.round(17 * DefaultStyle.dp) + Layout.preferredWidth: Math.round((modelData.customWidth > 0 ? modelData.customWidth : 545) * DefaultStyle.dp) Layout.alignment: Qt.AlignRight Loader { id: contentLoader @@ -183,7 +183,7 @@ Rectangle { sourceComponent: modelData.contentComponent } Item { - Layout.preferredWidth: (modelData.customRightMargin > 0 ? modelData.customRightMargin : 17) * DefaultStyle.dp + Layout.preferredWidth: Math.round((modelData.customRightMargin > 0 ? modelData.customRightMargin : 17) * DefaultStyle.dp) } } } diff --git a/Linphone/view/Page/Layout/Settings/AccountSettingsGeneralLayout.qml b/Linphone/view/Page/Layout/Settings/AccountSettingsGeneralLayout.qml index 617fbd62..ed335620 100644 --- a/Linphone/view/Page/Layout/Settings/AccountSettingsGeneralLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AccountSettingsGeneralLayout.qml @@ -35,21 +35,21 @@ AbstractSettingsLayout { id: accountParametersComponent ColumnLayout { Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Avatar { id: avatar account: model displayPresence: false - Layout.preferredWidth: 100 * DefaultStyle.dp - Layout.preferredHeight: 100 * DefaultStyle.dp + Layout.preferredWidth: Math.round(100 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(100 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter } IconLabelButton { visible: model.core.pictureUri.length === 0 Layout.preferredWidth: width icon.source: AppIcons.camera - icon.width: 17 * DefaultStyle.dp - icon.height: 17 * DefaultStyle.dp + icon.width: Math.round(17 * DefaultStyle.dp) + icon.height: Math.round(17 * DefaultStyle.dp) text: qsTr("Ajouter une image") style: ButtonStyle.noBackground onClicked: fileDialog.open() @@ -58,12 +58,12 @@ AbstractSettingsLayout { RowLayout { visible: model.core.pictureUri.length > 0 Layout.alignment: Qt.AlignHCenter - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) IconLabelButton { Layout.preferredWidth: width icon.source: AppIcons.pencil - icon.width: 17 * DefaultStyle.dp - icon.height: 17 * DefaultStyle.dp + icon.width: Math.round(17 * DefaultStyle.dp) + icon.height: Math.round(17 * DefaultStyle.dp) text: qsTr("Modifier l'image") style: ButtonStyle.noBackground onClicked: fileDialog.open() @@ -71,8 +71,8 @@ AbstractSettingsLayout { IconLabelButton { Layout.preferredWidth: width icon.source: AppIcons.trashCan - icon.width: 17 * DefaultStyle.dp - icon.height: 17 * DefaultStyle.dp + icon.width: Math.round(17 * DefaultStyle.dp) + icon.height: Math.round(17 * DefaultStyle.dp) text: qsTr("Supprimer l'image") style: ButtonStyle.noBackground onClicked: model.core.pictureUri = "" @@ -91,7 +91,7 @@ AbstractSettingsLayout { } RowLayout { Layout.fillWidth: true - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Text { Layout.alignment: Qt.AlignLeft text: qsTr("Adresse SIP :") @@ -115,7 +115,7 @@ AbstractSettingsLayout { } } ColumnLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Layout.alignment: Qt.AlignLeft Text { text: qsTr("Nom d’affichage") @@ -131,7 +131,7 @@ AbstractSettingsLayout { TextField { Layout.alignment: Qt.AlignLeft Layout.fillWidth: true - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) initialText: model.core.displayName backgroundColor: DefaultStyle.grey_100 onEditingFinished: { @@ -146,7 +146,7 @@ AbstractSettingsLayout { } ComboSetting { Layout.fillWidth: true - Layout.topMargin: -15 * DefaultStyle.dp + Layout.topMargin: -Math.round(15 * DefaultStyle.dp) entries: account.core.dialPlans propertyName: "dialPlan" propertyOwnerGui: account @@ -161,9 +161,9 @@ AbstractSettingsLayout { } RowLayout { id:mainItem - spacing : 20 * DefaultStyle.dp + spacing : Math.round(20 * DefaultStyle.dp) ColumnLayout { - spacing : 5 * DefaultStyle.dp + spacing : Math.round(5 * DefaultStyle.dp) Text { text: qsTr("Supprimer mon compte") font: Typography.p2l @@ -185,7 +185,7 @@ AbstractSettingsLayout { BigButton { style: ButtonStyle.noBackgroundRed Layout.alignment: Qt.AlignRight - Layout.rightMargin: 5 * DefaultStyle.dp + Layout.rightMargin: Math.round(5 * DefaultStyle.dp) icon.source: AppIcons.trashCan onClicked: { var mainWin = UtilsCpp.getMainWindow() @@ -213,25 +213,25 @@ AbstractSettingsLayout { RoundedPane { Layout.fillWidth: true Layout.fillHeight: true - // Layout.minimumHeight: account.core.devices.length * 133 * DefaultStyle.dp + (account.core.devices.length - 1) * 15 * DefaultStyle.dp + 2 * 21 * DefaultStyle.dp - Layout.rightMargin: 30 * DefaultStyle.dp - Layout.topMargin: 20 * DefaultStyle.dp - Layout.bottomMargin: 4 * DefaultStyle.dp - Layout.leftMargin: 44 * DefaultStyle.dp - topPadding: 21 * DefaultStyle.dp - bottomPadding: 21 * DefaultStyle.dp - leftPadding: 17 * DefaultStyle.dp - rightPadding: 17 * DefaultStyle.dp + // Layout.minimumHeight: account.core.devices.length * Math.round(133 * DefaultStyle.dp) + (account.core.devices.length - 1) * Math.round(15 * DefaultStyle.dp) + 2 * Math.round(21 * DefaultStyle.dp) + Layout.rightMargin: Math.round(30 * DefaultStyle.dp) + Layout.topMargin: Math.round(20 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(4 * DefaultStyle.dp) + Layout.leftMargin: Math.round(44 * DefaultStyle.dp) + topPadding: Math.round(21 * DefaultStyle.dp) + bottomPadding: Math.round(21 * DefaultStyle.dp) + leftPadding: Math.round(17 * DefaultStyle.dp) + rightPadding: Math.round(17 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent color: DefaultStyle.grey_100 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } contentItem: ColumnLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) BusyIndicator { - Layout.preferredWidth: 60 * DefaultStyle.dp - Layout.preferredHeight: 60 * DefaultStyle.dp + Layout.preferredWidth: Math.round(60 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(60 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter visible: devices.loading } @@ -252,24 +252,24 @@ AbstractSettingsLayout { } Control.Control { Layout.fillWidth: true - height: 133 * DefaultStyle.dp - topPadding: 26 * DefaultStyle.dp - bottomPadding: 26 * DefaultStyle.dp - rightPadding: 36 * DefaultStyle.dp - leftPadding: 33 * DefaultStyle.dp + height: Math.round(133 * DefaultStyle.dp) + topPadding: Math.round(26 * DefaultStyle.dp) + bottomPadding: Math.round(26 * DefaultStyle.dp) + rightPadding: Math.round(36 * DefaultStyle.dp) + leftPadding: Math.round(33 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent color: DefaultStyle.grey_0 - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) } contentItem: ColumnLayout { width: parent.width - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) RowLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit colorizationColor: DefaultStyle.main2_600 imageSource: modelData.core.userAgent.toLowerCase().includes('ios') | modelData.core.userAgent.toLowerCase().includes('android') ? AppIcons.mobile : AppIcons.desktop @@ -286,8 +286,8 @@ AbstractSettingsLayout { Layout.alignment: Qt.AlignRight text: qsTr("Supprimer") icon.source: AppIcons.trashCan - icon.width: 16 * DefaultStyle.dp - icon.height: 16 * DefaultStyle.dp + icon.width: Math.round(16 * DefaultStyle.dp) + icon.height: Math.round(16 * DefaultStyle.dp) style: ButtonStyle.tertiary onClicked: { var mainWin = UtilsCpp.getMainWindow() @@ -303,15 +303,15 @@ AbstractSettingsLayout { } } RowLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Text { text: qsTr("Dernière connexion:") color: DefaultStyle.main2_600 font: Typography.p2 } EffectImage { - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) imageSource: AppIcons.calendar colorizationColor: DefaultStyle.main2_600 fillMode: Image.PreserveAspectFit @@ -322,8 +322,8 @@ AbstractSettingsLayout { font: Typography.p1 } EffectImage { - Layout.preferredWidth: 20 * DefaultStyle.dp - Layout.preferredHeight: 20 * DefaultStyle.dp + Layout.preferredWidth: Math.round(20 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(20 * DefaultStyle.dp) imageSource: AppIcons.clock colorizationColor: DefaultStyle.main2_600 fillMode: Image.PreserveAspectFit diff --git a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml index f47655fc..b6759a54 100644 --- a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml @@ -44,7 +44,7 @@ AbstractSettingsLayout { ColumnLayout { id: column Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) DecoratedTextField { propertyName: "mwiServerAddress" propertyOwnerGui: account @@ -71,7 +71,7 @@ AbstractSettingsLayout { id: advancedParametersComponent ColumnLayout { Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Text { text: qsTr("Transport") color: DefaultStyle.main2_600 @@ -79,7 +79,7 @@ AbstractSettingsLayout { } ComboSetting { Layout.fillWidth: true - Layout.topMargin: -15 * DefaultStyle.dp + Layout.topMargin: Math.round(-15 * DefaultStyle.dp) entries: account.core.transports propertyName: "transport" propertyOwnerGui: account diff --git a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml index 60f2d803..5ccf0236 100644 --- a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml @@ -55,7 +55,7 @@ AbstractSettingsLayout { Component { id: systemComponent ColumnLayout { - spacing: 40 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) SwitchSetting { Layout.fillWidth: true titleText: qsTr("Démarrer automatiquement Linphone") @@ -71,7 +71,7 @@ AbstractSettingsLayout { Component { id: remoteProvisioningComponent ColumnLayout { - spacing: 6 * DefaultStyle.dp + spacing: Math.round(6 * DefaultStyle.dp) DecoratedTextField { Layout.fillWidth: true id: configUri @@ -79,7 +79,7 @@ AbstractSettingsLayout { toValidate: true } SmallButton { - Layout.topMargin: -20 * DefaultStyle.dp + Layout.topMargin: -Math.round(20 * DefaultStyle.dp) Layout.alignment: Qt.AlignRight text: qsTr("Télécharger et appliquer") style: ButtonStyle.tertiary @@ -97,14 +97,14 @@ AbstractSettingsLayout { Component { id: securityComponent ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) ColumnLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Text { text: qsTr("Chiffrement du média") font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } } ComboSetting { @@ -134,13 +134,13 @@ AbstractSettingsLayout { ListView { Layout.preferredHeight: contentHeight Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) model: PayloadTypeProxy { filterType: PayloadTypeProxy.Audio | PayloadTypeProxy.NotDownloadable } delegate: SwitchSetting { width: parent.width - height: 32 * DefaultStyle.dp + height: Math.round(32 * DefaultStyle.dp) titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType) subTitleText: modelData.core.clockRate + " Hz" propertyName: "enabled" @@ -156,18 +156,18 @@ AbstractSettingsLayout { Component { id: videoCodecsComponent ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) ListView { Layout.preferredHeight: contentHeight Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) model: PayloadTypeProxy { id: videoPayloadTypeProxy filterType: PayloadTypeProxy.Video | PayloadTypeProxy.NotDownloadable } delegate: SwitchSetting { width: parent.width - height: 32 * DefaultStyle.dp + height: Math.round(32 * DefaultStyle.dp) titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType) subTitleText: modelData.core.encoderDescription propertyName: "enabled" @@ -177,14 +177,14 @@ AbstractSettingsLayout { ListView { Layout.preferredHeight: contentHeight Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) model: PayloadTypeProxy { id: downloadableVideoPayloadTypeProxy filterType: PayloadTypeProxy.Video | PayloadTypeProxy.Downloadable } delegate: SwitchSetting { width: parent.width - height: 32 * DefaultStyle.dp + height: Math.round(32 * DefaultStyle.dp) titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType) subTitleText: modelData.core.encoderDescription onCheckedChanged: Utils.openCodecOnlineInstallerDialog( @@ -211,7 +211,7 @@ AbstractSettingsLayout { Component { id: hideFpsComponent ColumnLayout { - spacing: 40 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) SwitchSetting { titleText:qsTr("Cacher les FPS") propertyName: "hideFps" diff --git a/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml index 1536600a..a03bec44 100644 --- a/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/CallSettingsLayout.qml @@ -35,7 +35,7 @@ AbstractSettingsLayout { Component { id: genericParametersComponent ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) SwitchSetting { titleText: qsTr("Annulateur d'écho") subTitleText: qsTr("Évite que de l'écho soit entendu par votre correspondant") @@ -73,7 +73,7 @@ AbstractSettingsLayout { MultimediaSettings { ringerDevicesVisible: true backgroundVisible: false - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Page/Layout/Settings/CarddavSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/CarddavSettingsLayout.qml index e437f1c1..f2135bfe 100644 --- a/Linphone/view/Page/Layout/Settings/CarddavSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/CarddavSettingsLayout.qml @@ -40,12 +40,12 @@ AbstractSettingsLayout { Component { id: topBar RowLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) BigButton { style: ButtonStyle.noBackground icon.source: AppIcons.trashCan - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) visible: !isNew onClicked: { var mainWin = UtilsCpp.getMainWindow() @@ -68,10 +68,10 @@ AbstractSettingsLayout { id: cardDavParametersComponent ColumnLayout { Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp - Layout.rightMargin: 44 * DefaultStyle.dp - Layout.topMargin: 20 * DefaultStyle.dp - Layout.leftMargin: 64 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) + Layout.rightMargin: Math.round(44 * DefaultStyle.dp) + Layout.topMargin: Math.round(20 * DefaultStyle.dp) + Layout.leftMargin: Math.round(64 * DefaultStyle.dp) DecoratedTextField { propertyName: "displayName" propertyOwnerGui: carddavGui diff --git a/Linphone/view/Page/Layout/Settings/ContactsSettingsProviderLayout.qml b/Linphone/view/Page/Layout/Settings/ContactsSettingsProviderLayout.qml index 01802051..32d361fb 100644 --- a/Linphone/view/Page/Layout/Settings/ContactsSettingsProviderLayout.qml +++ b/Linphone/view/Page/Layout/Settings/ContactsSettingsProviderLayout.qml @@ -25,18 +25,18 @@ RowLayout { signal save() signal undo() - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) Repeater { model: mainItem.proxyModel RowLayout { Layout.fillWidth: true Layout.alignment: Qt.AlignLeft|Qt.AlignHCenter - Layout.preferredHeight: 74 * DefaultStyle.dp - spacing: 20 * DefaultStyle.dp + Layout.preferredHeight: Math.round(74 * DefaultStyle.dp) + spacing: Math.round(20 * DefaultStyle.dp) Text { text: modelData.core[titleProperty] font: Typography.p2l @@ -51,8 +51,8 @@ RowLayout { Button { style: ButtonStyle.noBackground icon.source: AppIcons.pencil - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) onClicked: { mainItem.owner.container.push(mainItem.settingsLayout, { titleText: mainItem.editText, @@ -104,7 +104,7 @@ RowLayout { } RowLayout { Layout.fillWidth: true - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Item { Layout.fillWidth: true } diff --git a/Linphone/view/Page/Layout/Settings/DebugSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/DebugSettingsLayout.qml index 9330cf50..d5de356c 100644 --- a/Linphone/view/Page/Layout/Settings/DebugSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/DebugSettingsLayout.qml @@ -67,7 +67,7 @@ AbstractSettingsLayout { Component { id: logContent ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) SwitchSetting { titleText: qsTr("Activer les traces de débogage") propertyName: "logsEnabled" @@ -79,7 +79,7 @@ AbstractSettingsLayout { propertyOwner: SettingsCpp } RowLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Layout.alignment: Qt.AlignRight MediumButton { style: ButtonStyle.tertiary @@ -104,15 +104,15 @@ AbstractSettingsLayout { Component { id: versionContent ColumnLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) RowLayout { EffectImage { imageSource: AppIcons.appWindow colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignTop } ColumnLayout { @@ -137,10 +137,10 @@ AbstractSettingsLayout { EffectImage { imageSource: AppIcons.resourcePackage colorizationColor: DefaultStyle.main1_500_main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - imageWidth: 24 * DefaultStyle.dp - imageHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) + imageWidth: Math.round(24 * DefaultStyle.dp) + imageHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignTop } ColumnLayout { diff --git a/Linphone/view/Page/Layout/Settings/LdapSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/LdapSettingsLayout.qml index 7758c4a9..8184aed7 100644 --- a/Linphone/view/Page/Layout/Settings/LdapSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/LdapSettingsLayout.qml @@ -35,12 +35,12 @@ AbstractSettingsLayout { Component { id: topBar RowLayout { - spacing: 20 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) Button { style: ButtonStyle.noBackground icon.source: AppIcons.trashCan - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) visible: !isNew onClicked: { var mainWin = UtilsCpp.getMainWindow() @@ -63,10 +63,10 @@ AbstractSettingsLayout { id: ldapParametersComponent ColumnLayout { Layout.fillWidth: true - spacing: 20 * DefaultStyle.dp - Layout.rightMargin: 44 * DefaultStyle.dp - Layout.topMargin: 20 * DefaultStyle.dp - Layout.leftMargin: 64 * DefaultStyle.dp + spacing: Math.round(20 * DefaultStyle.dp) + Layout.rightMargin: Math.round(44 * DefaultStyle.dp) + Layout.topMargin: Math.round(20 * DefaultStyle.dp) + Layout.leftMargin: Math.round(64 * DefaultStyle.dp) DecoratedTextField { id: server propertyName: "serverUrl" diff --git a/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml index 7efa302b..4ca7e4ce 100644 --- a/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/MeetingsSettingsLayout.qml @@ -26,24 +26,24 @@ AbstractSettingsLayout { Component { id: confDisplayParametersComponent ColumnLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Text { text: qsTr("Mode d’affichage par défaut") font { - pixelSize: 14 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2l.pixelSize + weight: Typography.p2l.weight } } Text { text: qsTr("Le mode d’affichage des participants en réunions") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } ComboSetting { Layout.fillWidth: true - Layout.topMargin: 12 * DefaultStyle.dp + Layout.topMargin: Math.round(12 * DefaultStyle.dp) Layout.preferredWidth: parent.width entries: SettingsCpp.conferenceLayouts propertyName: "conferenceLayout" diff --git a/Linphone/view/Page/Layout/Settings/NetworkSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/NetworkSettingsLayout.qml index b61ec272..49ba4c93 100644 --- a/Linphone/view/Page/Layout/Settings/NetworkSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/NetworkSettingsLayout.qml @@ -23,7 +23,7 @@ AbstractSettingsLayout { Component { id: content ColumnLayout { - spacing: 40 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) SwitchSetting { Layout.fillWidth: true titleText: qsTr("Autoriser l'IPv6") @@ -32,4 +32,4 @@ AbstractSettingsLayout { } } } -} \ No newline at end of file +} diff --git a/Linphone/view/Page/Layout/Settings/SecuritySettingsLayout.qml b/Linphone/view/Page/Layout/Settings/SecuritySettingsLayout.qml index 4150c36c..e2127e47 100644 --- a/Linphone/view/Page/Layout/Settings/SecuritySettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/SecuritySettingsLayout.qml @@ -23,7 +23,7 @@ AbstractSettingsLayout { Component { id: content ColumnLayout { - spacing: 40 * DefaultStyle.dp + spacing: Math.round(40 * DefaultStyle.dp) SwitchSetting { titleText: qsTr("Chiffrer tous les fichiers") subTitleText: qsTr("Attention, vous ne pourrez pas revenir en arrière !") diff --git a/Linphone/view/Page/Main/AbstractMainPage.qml b/Linphone/view/Page/Main/AbstractMainPage.qml index 3ac648db..4b87df18 100644 --- a/Linphone/view/Page/Main/AbstractMainPage.qml +++ b/Linphone/view/Page/Main/AbstractMainPage.qml @@ -25,16 +25,16 @@ FocusScope { // Control.SplitView { // id: splitView // anchors.fill: parent - // anchors.topMargin: 10 * DefaultStyle.dp + // anchors.topMargin: Math.round(10 * DefaultStyle.dp) // handle: Rectangle { - // implicitWidth: 8 * DefaultStyle.dp + // implicitWidth: Math.round(8 * DefaultStyle.dp) // color: Control.SplitHandle.hovered ? DefaultStyle.grey_200 : DefaultStyle.grey_100 // } // ColumnLayout { // id: leftPanel - // Control.SplitView.preferredWidth: 350 * DefaultStyle.dp - // Control.SplitView.minimumWidth: 350 * DefaultStyle.dp + // Control.SplitView.preferredWidth: Math.round(350 * DefaultStyle.dp) + // Control.SplitView.minimumWidth: Math.round(350 * DefaultStyle.dp) // } // Rectangle { // id: rightPanel @@ -56,23 +56,23 @@ FocusScope { // Layout.fillWidth: true // } // ColumnLayout { - // spacing: 30 * DefaultStyle.dp + // spacing: Math.round(30 * DefaultStyle.dp) // Item { // Layout.fillHeight: true // } // Image { // Layout.alignment: Qt.AlignHCenter // source: AppIcons.noItemImage - // Layout.preferredWidth: 359 * DefaultStyle.dp - // Layout.preferredHeight: 314 * DefaultStyle.dp + // Layout.preferredWidth: Math.round(359 * DefaultStyle.dp) + // Layout.preferredHeight: Math.round(314 * DefaultStyle.dp) // fillMode: Image.PreserveAspectFit // } // Text { // text: mainItem.emptyListText // Layout.alignment: Qt.AlignHCenter // font { - // pixelSize: 22 * DefaultStyle.dp - // weight: 800 * DefaultStyle.dp + // pixelSize: Math.round(22 * DefaultStyle.dp) + // weight: Math.round(800 * DefaultStyle.dp) // } // } // Button { @@ -82,8 +82,8 @@ FocusScope { // EffectImage { // colorizationColor: DefaultStyle.grey_0 // source: mainItem.newItemIconSource - // width: 24 * DefaultStyle.dp - // height: 24 * DefaultStyle.dp + // width: Math.round(24 * DefaultStyle.dp) + // height: Math.round(24 * DefaultStyle.dp) // fillMode: Image.PreserveAspectFit // } // Text { @@ -91,8 +91,8 @@ FocusScope { // wrapMode: Text.WordWrap // color: DefaultStyle.grey_0 // font { - // weight: 600 * DefaultStyle.dp - // pixelSize: 18 * DefaultStyle.dp + // weight: Math.round(600 * DefaultStyle.dp) + // pixelSize: Math.round(18 * DefaultStyle.dp) // family: DefaultStyle.defaultFont // } // } @@ -123,13 +123,13 @@ FocusScope { spacing: 0 ColumnLayout { id: leftPanel - Layout.preferredWidth: 404 * DefaultStyle.dp + Layout.preferredWidth: Math.round(404 * DefaultStyle.dp) Layout.fillWidth:false spacing:0 } Rectangle { Layout.fillHeight: true - Layout.preferredWidth: 1 * DefaultStyle.dp + Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_200 } Rectangle { @@ -151,23 +151,23 @@ FocusScope { Layout.fillWidth: true } ColumnLayout { - spacing: 30 * DefaultStyle.dp + spacing: Math.round(30 * DefaultStyle.dp) Item { Layout.fillHeight: true } Image { Layout.alignment: Qt.AlignHCenter source: AppIcons.noItemImage - Layout.preferredWidth: 359 * DefaultStyle.dp - Layout.preferredHeight: 314 * DefaultStyle.dp + Layout.preferredWidth: Math.round(359 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(314 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit } Text { text: mainItem.emptyListText Layout.alignment: Qt.AlignHCenter font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } } BigButton { @@ -175,7 +175,7 @@ FocusScope { icon.source: mainItem.newItemIconSource style: ButtonStyle.main text: mainItem.noItemButtonText - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) onPressed: mainItem.noItemButtonPressed() } Item { diff --git a/Linphone/view/Page/Main/Account/AccountListView.qml b/Linphone/view/Page/Main/Account/AccountListView.qml index a553571b..1bb225e4 100644 --- a/Linphone/view/Page/Main/Account/AccountListView.qml +++ b/Linphone/view/Page/Main/Account/AccountListView.qml @@ -10,18 +10,18 @@ import SettingsCpp Item { id: mainItem - width: 517 * DefaultStyle.dp - readonly property int topPadding: 23 * DefaultStyle.dp - readonly property int bottomPadding: 13 * DefaultStyle.dp - readonly property int leftPadding: 24 * DefaultStyle.dp - readonly property int rightPadding: 24 * DefaultStyle.dp - readonly property int spacing: 16 * DefaultStyle.dp + width: Math.round(517 * DefaultStyle.dp) + readonly property real topPadding: Math.round(23 * DefaultStyle.dp) + readonly property real bottomPadding: Math.round(13 * DefaultStyle.dp) + readonly property real leftPadding: Math.round(24 * DefaultStyle.dp) + readonly property real rightPadding: Math.round(24 * DefaultStyle.dp) + readonly property real spacing: Math.round(16 * DefaultStyle.dp) property AccountProxy accountProxy signal addAccountRequest() signal editAccount(AccountGui account) - implicitHeight: list.contentHeight + topPadding + bottomPadding + 32 * DefaultStyle.dp + 1 + addAccountButton.height + implicitHeight: list.contentHeight + topPadding + bottomPadding + Math.round(32 * DefaultStyle.dp) + 1 + addAccountButton.height ColumnLayout{ id: childLayout anchors.top: parent.top @@ -75,7 +75,7 @@ Item { Layout.topMargin: mainItem.spacing Layout.bottomMargin: mainItem.spacing visible: addAccountButton.visible - height: 1 * DefaultStyle.dp + height: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_300 } IconLabelButton{ @@ -84,8 +84,8 @@ Item { visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count onClicked: mainItem.addAccountRequest() icon.source: AppIcons.plusCircle - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: 'Ajouter un compte' } } diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index b0a951ee..06f228c5 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -58,7 +58,7 @@ AbstractMainPage { Control.StackView.Immediate) } rightPanelStackView.initialItem: emptySelection - rightPanelStackView.width: 360 * DefaultStyle.dp + rightPanelStackView.width: Math.round(360 * DefaultStyle.dp) onNoItemButtonPressed: goToNewCall() @@ -79,12 +79,12 @@ AbstractMainPage { Dialog { id: deleteHistoryPopup - width: 278 * DefaultStyle.dp + width: Math.round(278 * DefaultStyle.dp) text: qsTr("L'historique d'appel sera supprimé. Souhaitez-vous continuer ?") } Dialog { id: deleteForUserPopup - width: 278 * DefaultStyle.dp + width: Math.round(278 * DefaultStyle.dp) text: qsTr( "L'historique d'appel de l'utilisateur sera supprimé. Souhaitez-vous continuer ?") } @@ -97,7 +97,7 @@ AbstractMainPage { Control.StackView { id: listStackView anchors.fill: parent - anchors.leftMargin: 45 * DefaultStyle.dp + anchors.leftMargin: Math.round(45 * DefaultStyle.dp) clip: true initialItem: historyListItem focus: true @@ -110,7 +110,7 @@ AbstractMainPage { anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - height: 402 * DefaultStyle.dp + height: Math.round(402 * DefaultStyle.dp) NumericPadPopup { id: numericPadPopupItem width: parent.width @@ -134,20 +134,20 @@ AbstractMainPage { spacing: 0 RowLayout { id: titleCallLayout - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) Text { text: qsTr("Appels") color: DefaultStyle.main2_700 - font.pixelSize: 29 * DefaultStyle.dp - font.weight: 800 * DefaultStyle.dp + font.pixelSize: Typography.h2.pixelSize + font.weight: Typography.h2.weight } Item { Layout.fillWidth: true } PopupButton { id: removeHistory - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp + width: Math.round(24 * DefaultStyle.dp) + height: Math.round(24 * DefaultStyle.dp) focus: true popup.x: 0 KeyNavigation.right: newCallButton @@ -177,11 +177,11 @@ AbstractMainPage { id: newCallButton style: ButtonStyle.noBackground icon.source: AppIcons.newCall - Layout.preferredWidth: 28 * DefaultStyle.dp - Layout.preferredHeight: 28 * DefaultStyle.dp - Layout.rightMargin: 39 * DefaultStyle.dp - icon.width: 28 * DefaultStyle.dp - icon.height: 28 * DefaultStyle.dp + Layout.preferredWidth: Math.round(28 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) + Layout.rightMargin: Math.round(39 * DefaultStyle.dp) + icon.width: Math.round(28 * DefaultStyle.dp) + icon.height: Math.round(28 * DefaultStyle.dp) KeyNavigation.left: removeHistory KeyNavigation.down: listStackView onClicked: { @@ -193,8 +193,8 @@ AbstractMainPage { SearchBar { id: searchBar Layout.fillWidth: true - Layout.topMargin: 18 * DefaultStyle.dp - Layout.rightMargin: 39 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) + Layout.rightMargin: Math.round(39 * DefaultStyle.dp) placeholderText: qsTr("Rechercher un appel") visible: historyListView.count !== 0 || text.length !== 0 focus: true @@ -213,26 +213,26 @@ AbstractMainPage { Control.Control { id: listLayout anchors.fill: parent - anchors.rightMargin: 39 * DefaultStyle.dp + anchors.rightMargin: Math.round(39 * DefaultStyle.dp) padding: 0 background: Item {} contentItem: ColumnLayout { Text { visible: historyListView.count === 0 Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 137 * DefaultStyle.dp + Layout.topMargin: Math.round(137 * DefaultStyle.dp) text: qsTr("Aucun appel%1").arg( searchBar.text.length != 0 ? " correspondant" : "") font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } CallHistoryListView { id: historyListView Layout.fillWidth: true Layout.fillHeight: true - Layout.topMargin: 38 * DefaultStyle.dp + Layout.topMargin: Math.round(38 * DefaultStyle.dp) searchBar: searchBar Control.ScrollBar.vertical: scrollbar @@ -260,7 +260,7 @@ AbstractMainPage { anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 8 * DefaultStyle.dp + anchors.rightMargin: Math.round(8 * DefaultStyle.dp) policy: Control.ScrollBar.AsNeeded } } @@ -281,10 +281,10 @@ AbstractMainPage { anchors.fill: parent spacing: 0 RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Button { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackground icon.source: AppIcons.leftArrow focus: true @@ -299,8 +299,8 @@ AbstractMainPage { Text { text: qsTr("Nouvel appel") color: DefaultStyle.main2_700 - font.pixelSize: 29 * DefaultStyle.dp - font.weight: 800 * DefaultStyle.dp + font.pixelSize: Typography.h2.pixelSize + font.weight: Typography.h2.weight } Item { Layout.fillWidth: true @@ -308,7 +308,7 @@ AbstractMainPage { } NewCallForm { id: callContactsList - Layout.topMargin: 18 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) Layout.fillWidth: true Layout.fillHeight: true focus: true @@ -345,14 +345,14 @@ AbstractMainPage { spacing: 0 anchors.fill: parent RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) visible: !SettingsCpp.disableMeetingsFeature Button { id: backGroupCallButton style: ButtonStyle.noBackgroundOrange icon.source: AppIcons.leftArrow - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) KeyNavigation.down: listStackView KeyNavigation.right: groupCallButton KeyNavigation.left: groupCallButton @@ -362,14 +362,14 @@ AbstractMainPage { } } ColumnLayout { - spacing: 3 * DefaultStyle.dp + spacing: Math.round(3 * DefaultStyle.dp) Text { text: qsTr("Appel de groupe") color: DefaultStyle.main1_500_main maximumLineCount: 1 font { - pixelSize: 18 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(18 * DefaultStyle.dp) + weight: Typography.h4.weight } Layout.fillWidth: true } @@ -380,8 +380,8 @@ AbstractMainPage { color: DefaultStyle.main2_500main maximumLineCount: 1 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } Layout.fillWidth: true } @@ -389,7 +389,7 @@ AbstractMainPage { SmallButton { id: groupCallButton enabled: mainItem.selectedParticipantsCount.length != 0 - Layout.rightMargin: 21 * DefaultStyle.dp + Layout.rightMargin: Math.round(21 * DefaultStyle.dp) text: qsTr("Lancer") style: ButtonStyle.main KeyNavigation.down: listStackView @@ -402,27 +402,27 @@ AbstractMainPage { } RowLayout { spacing: 0 - Layout.topMargin: 18 * DefaultStyle.dp - Layout.rightMargin: 38 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) + Layout.rightMargin: Math.round(38 * DefaultStyle.dp) Text { - font.pixelSize: 13 * DefaultStyle.dp - font.weight: 700 * DefaultStyle.dp + font.pixelSize: Typography.p2.pixelSize + font.weight: Typography.p2.weight text: qsTr("Nom du groupe") } Item { Layout.fillWidth: true } Text { - font.pixelSize: 12 * DefaultStyle.dp - font.weight: 300 * DefaultStyle.dp + font.pixelSize: Math.round(12 * DefaultStyle.dp) + font.weight: Math.round(300 * DefaultStyle.dp) text: qsTr("Requis") } } TextField { id: groupCallName Layout.fillWidth: true - Layout.rightMargin: 38 * DefaultStyle.dp - Layout.preferredHeight: 49 * DefaultStyle.dp + Layout.rightMargin: Math.round(38 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(49 * DefaultStyle.dp) focus: true KeyNavigation.down: addParticipantsLayout //participantList.count > 0 ? participantList : searchbar } @@ -430,7 +430,7 @@ AbstractMainPage { id: addParticipantsLayout Layout.fillWidth: true Layout.fillHeight: true - Layout.topMargin: 15 * DefaultStyle.dp + Layout.topMargin: Math.round(15 * DefaultStyle.dp) onSelectedParticipantsCountChanged: mainItem.selectedParticipantsCount = selectedParticipantsCount focus: true @@ -479,8 +479,8 @@ ConferenceInfoGui{ CallHistoryLayout { id: contactDetail anchors.fill: parent - anchors.topMargin: 45 * DefaultStyle.dp - anchors.bottomMargin: 45 * DefaultStyle.dp + anchors.topMargin: Math.round(45 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(45 * DefaultStyle.dp) visible: mainItem.selectedRowHistoryGui != undefined callHistoryGui: selectedRowHistoryGui @@ -518,8 +518,8 @@ ConferenceInfoGui{ text: contactDetail.contact ? qsTr("Voir le contact") : qsTr( "Ajouter aux contacts") icon.source: AppIcons.plusCircle - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) visible: !isLdap && !isCardDAV onClicked: { detailOptions.close() @@ -536,8 +536,8 @@ ConferenceInfoGui{ Layout.fillWidth: true text: qsTr("Copier l'adresse SIP") icon.source: AppIcons.copy - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onClicked: { detailOptions.close() var success = UtilsCpp.copyToClipboard( @@ -566,7 +566,7 @@ ConferenceInfoGui{ // } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 2 * DefaultStyle.dp + Layout.preferredHeight: Math.round(2 * DefaultStyle.dp) color: DefaultStyle.main2_400 } @@ -574,8 +574,8 @@ ConferenceInfoGui{ Layout.fillWidth: true text: qsTr("Supprimer l'historique") icon.source: AppIcons.trashCan - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) style: ButtonStyle.hoveredBackgroundRed Connections { target: deleteForUserPopup @@ -594,7 +594,7 @@ ConferenceInfoGui{ } } detailContent: Item { - Layout.preferredWidth: 360 * DefaultStyle.dp + Layout.preferredWidth: Math.round(360 * DefaultStyle.dp) Layout.fillHeight: true RoundedPane { id: detailControl @@ -606,25 +606,25 @@ ConferenceInfoGui{ id: detailListBackground anchors.fill: parent color: DefaultStyle.grey_0 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } contentItem: CallHistoryListView { id: detailListView Layout.fillWidth: true Layout.fillHeight: true - spacing: 14 * DefaultStyle.dp + spacing: Math.round(14 * DefaultStyle.dp) clip: true searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : "" - busyIndicatorSize: 40 * DefaultStyle.dp + busyIndicatorSize: Math.round(40 * DefaultStyle.dp) delegate: Item { width: detailListView.width - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) RowLayout { anchors.fill: parent - anchors.leftMargin: 20 * DefaultStyle.dp - anchors.rightMargin: 20 * DefaultStyle.dp + anchors.leftMargin: Math.round(20 * DefaultStyle.dp) + anchors.rightMargin: Math.round(20 * DefaultStyle.dp) anchors.verticalCenter: parent.verticalCenter ColumnLayout { Layout.alignment: Qt.AlignVCenter @@ -635,8 +635,8 @@ ConferenceInfoGui{ === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted ? AppIcons.arrowElbow : modelData.core.isOutgoing ? AppIcons.arrowUpRight : AppIcons.arrowDownLeft colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted || modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : modelData.core.isOutgoing ? DefaultStyle.info_500_main : DefaultStyle.success_500main - Layout.preferredWidth: 16 * DefaultStyle.dp - Layout.preferredHeight: 16 * DefaultStyle.dp + Layout.preferredWidth: Math.round(16 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(16 * DefaultStyle.dp) transform: Rotation { angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined || modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere || modelData.core.status === LinphoneEnums.CallStatus.Aborted || modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0 @@ -649,8 +649,8 @@ ConferenceInfoGui{ Text { text: modelData.core.status === LinphoneEnums.CallStatus.Missed ? qsTr("Appel manqué") : modelData.core.isOutgoing ? qsTr("Appel sortant") : qsTr("Appel entrant") font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } @@ -659,8 +659,8 @@ ConferenceInfoGui{ modelData.core.date) color: modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : DefaultStyle.main2_500main font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -673,8 +673,8 @@ ConferenceInfoGui{ modelData.core.duration, false) font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } @@ -696,8 +696,8 @@ ConferenceInfoGui{ property color colorizationColor: DefaultStyle.main2_500main EffectImage { imageSource: iconLabel.iconSource - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit colorizationColor: iconLabel.colorizationColor } @@ -705,8 +705,8 @@ ConferenceInfoGui{ text: iconLabel.text color: iconLabel.colorizationColor font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } diff --git a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml index 70ce394f..004ba50d 100644 --- a/Linphone/view/Page/Main/Call/CallSettingsPanel.qml +++ b/Linphone/view/Page/Main/Call/CallSettingsPanel.qml @@ -18,29 +18,29 @@ Control.Page { signal returnRequested() signal validateRequested() - topPadding: 20 * DefaultStyle.dp - leftPadding: 17 * DefaultStyle.dp - rightPadding: 17 * DefaultStyle.dp + topPadding: Math.round(20 * DefaultStyle.dp) + leftPadding: Math.round(17 * DefaultStyle.dp) + rightPadding: Math.round(17 * DefaultStyle.dp) background: Rectangle { width: mainItem.width height: mainItem.height color: DefaultStyle.grey_100 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } header: Control.Control { id: pageHeader width: mainItem.width - height: 56 * DefaultStyle.dp - leftPadding: 10 * DefaultStyle.dp - rightPadding: 10 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) + leftPadding: Math.round(10 * DefaultStyle.dp) + rightPadding: Math.round(10 * DefaultStyle.dp) background: Rectangle { id: headerBackground width: pageHeader.width height: pageHeader.height color: DefaultStyle.grey_0 - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) Rectangle { y: pageHeader.height/2 height: pageHeader.height/2 @@ -51,7 +51,7 @@ Control.Page { id: headerStack RowLayout { Layout.alignment: Qt.AlignVCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Text { text: mainItem.headerTitleText Layout.fillWidth: true @@ -62,8 +62,8 @@ Control.Page { verticalAlignment: Text.AlignVCenter color: DefaultStyle.main1_500_main font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } RowLayout { @@ -79,12 +79,12 @@ Control.Page { } RowLayout { Layout.alignment: Qt.AlignVCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Button { style: ButtonStyle.noBackgroundOrange icon.source: AppIcons.leftArrow - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) onClicked: mainItem.returnRequested() } ColumnLayout { @@ -95,8 +95,8 @@ Control.Page { text: mainItem.headerTitleText color: DefaultStyle.main1_500_main font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } Text { @@ -106,8 +106,8 @@ Control.Page { text: mainItem.headerSubtitleText color: DefaultStyle.main2_500main font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Page/Main/Call/WaitingRoom.qml b/Linphone/view/Page/Main/Call/WaitingRoom.qml index a305b87e..adbd266f 100644 --- a/Linphone/view/Page/Main/Call/WaitingRoom.qml +++ b/Linphone/view/Page/Main/Call/WaitingRoom.qml @@ -18,15 +18,15 @@ RowLayout { RowLayout { Layout.fillWidth: false Layout.fillHeight: false - spacing: 100 * DefaultStyle.dp + spacing: Math.round(100 * DefaultStyle.dp) Layout.alignment: Qt.AlignCenter ColumnLayout { - spacing: 31 * DefaultStyle.dp + spacing: Math.round(31 * DefaultStyle.dp) Sticker { id: preview previewEnabled: true - Layout.preferredHeight: 330 * DefaultStyle.dp - Layout.preferredWidth: 558 * DefaultStyle.dp + Layout.preferredHeight: Math.round(330 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(558 * DefaultStyle.dp) qmlName: "WP" displayAll: false displayPresence: false @@ -39,47 +39,47 @@ RowLayout { } RowLayout { Layout.alignment: Qt.AlignHCenter - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) CheckableButton { id: videoButton visible: SettingsCpp.videoEnabled iconUrl: AppIcons.videoCamera checkedIconUrl: AppIcons.videoCameraSlash checked: !mainItem.localVideoEnabled - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onClicked: mainItem.localVideoEnabled = !mainItem.localVideoEnabled } CheckableButton { id: microButton iconUrl: AppIcons.microphone checkedIconUrl: AppIcons.microphoneSlash - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onCheckedChanged: mainItem.microEnabled = !mainItem.microEnabled } CheckableButton { id: settingsButton visible: stackLayout.currentIndex === 0 icon.source: AppIcons.verticalDots - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) } CheckableButton { id: speakerButton visible: stackLayout.currentIndex === 1 iconUrl: AppIcons.speaker checkedIconUrl: AppIcons.speakerSlash - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) } } } @@ -87,17 +87,17 @@ RowLayout { id: stackLayout currentIndex: 0 ColumnLayout { - spacing: 93 * DefaultStyle.dp + spacing: Math.round(93 * DefaultStyle.dp) ColumnLayout { - Layout.topMargin: 54 * DefaultStyle.dp + Layout.topMargin: Math.round(54 * DefaultStyle.dp) spacing: 0 Text { Layout.fillWidth: true text: qsTr("Participer à :") color: DefaultStyle.grey_0 font { - pixelSize: 30 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(30 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } Text { @@ -105,15 +105,15 @@ RowLayout { text: mainItem.conferenceInfo && mainItem.conferenceInfo.core.subject color: DefaultStyle.grey_0 font { - pixelSize: 30 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(30 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } ColumnLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) BigButton { - Layout.preferredWidth: 292 * DefaultStyle.dp + Layout.preferredWidth: Math.round(292 * DefaultStyle.dp) text: qsTr("Rejoindre") style: ButtonStyle.main onClicked: { @@ -123,7 +123,7 @@ RowLayout { } } BigButton { - Layout.preferredWidth: 292 * DefaultStyle.dp + Layout.preferredWidth: Math.round(292 * DefaultStyle.dp) style: ButtonStyle.secondary text: qsTr("Annuler") onClicked: { @@ -133,16 +133,16 @@ RowLayout { } } ColumnLayout { - spacing: 37 * DefaultStyle.dp + spacing: Math.round(37 * DefaultStyle.dp) ColumnLayout { - spacing: 13 * DefaultStyle.dp + spacing: Math.round(13 * DefaultStyle.dp) Text { Layout.fillWidth: true text: qsTr("Connexion à la réunion") color: DefaultStyle.grey_0 font { - pixelSize: 30 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(30 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } Text { @@ -150,19 +150,19 @@ RowLayout { text: qsTr("Vous allez rejoindre la réunion dans quelques instants...") color: DefaultStyle.grey_0 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } BusyIndicator { indicatorColor: DefaultStyle.main1_500_main Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 48 * DefaultStyle.dp - Layout.preferredHeight: 48 * DefaultStyle.dp + Layout.preferredWidth: Math.round(48 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(48 * DefaultStyle.dp) } BigButton { - Layout.preferredWidth: 292 * DefaultStyle.dp + Layout.preferredWidth: Math.round(292 * DefaultStyle.dp) Layout.alignment: Qt.AlignHCenter style: ButtonStyle.main text: qsTr("Annuler") diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index a675130e..baf52c59 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -109,8 +109,8 @@ FriendGui{ id: verifyDevicePopup property string deviceName property string deviceAddress - padding: 30 * DefaultStyle.dp - width: 637 * DefaultStyle.dp + padding: Math.round(30 * DefaultStyle.dp) + width: Math.round(637 * DefaultStyle.dp) anchors.centerIn: parent closePolicy: Control.Popup.CloseOnEscape modal: true @@ -120,13 +120,13 @@ FriendGui{ verifyDevicePopup.deviceName) buttons: RowLayout { RowLayout { - spacing: 7 * DefaultStyle.dp + spacing: Math.round(7 * DefaultStyle.dp) CheckBox { id: neverDisplayAgainCheckbox } Text { text: qsTr("Ne plus afficher") - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) MouseArea { anchors.fill: parent onClicked: neverDisplayAgainCheckbox.toggle() @@ -137,7 +137,7 @@ FriendGui{ Layout.fillWidth: true } RowLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) BigButton { style: ButtonStyle.secondary text: qsTr("Annuler") @@ -160,42 +160,42 @@ FriendGui{ } Dialog { id: trustInfoDialog - width: 637 * DefaultStyle.dp + width: Math.round(637 * DefaultStyle.dp) title: qsTr("Niveau de confiance") text: qsTr("Vérifiez les appareils de votre contact pour confirmer que vos communications seront sécurisées et sans compromission.
Quand tous seront vérifiés, vous atteindrez le niveau de confiance maximal.") content: RowLayout { - spacing: 50 * DefaultStyle.dp + spacing: Math.round(50 * DefaultStyle.dp) Avatar { _address: "sip:a.c@sip.linphone.org" - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) } EffectImage { imageSource: AppIcons.arrowRight colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) } Avatar { _address: "sip:a.c@sip.linphone.org" secured: true - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) } } buttons: Button { text: qsTr("Ok") style: ButtonStyle.main - leftPadding: 30 * DefaultStyle.dp - rightPadding: 30 * DefaultStyle.dp + leftPadding: Math.round(30 * DefaultStyle.dp) + rightPadding: Math.round(30 * DefaultStyle.dp) onClicked: trustInfoDialog.close() } } leftPanelContent: FocusScope { id: leftPanel - property int leftMargin: 45 * DefaultStyle.dp - property int rightMargin: 39 * DefaultStyle.dp + property real leftMargin: Math.round(45 * DefaultStyle.dp) + property real rightMargin: Math.round(39 * DefaultStyle.dp) Layout.fillHeight: true Layout.fillWidth: true @@ -211,8 +211,8 @@ FriendGui{ Text { text: qsTr("Contacts") color: DefaultStyle.main2_700 - font.pixelSize: 29 * DefaultStyle.dp - font.weight: 800 * DefaultStyle.dp + font.pixelSize: Typography.h2.pixelSize + font.weight: Typography.h2.weight } Item { Layout.fillWidth: true @@ -223,10 +223,10 @@ FriendGui{ || rightPanelStackView.currentItem.objectName !== "contactEdition" style: ButtonStyle.noBackground icon.source: AppIcons.plusCircle - Layout.preferredWidth: 28 * DefaultStyle.dp - Layout.preferredHeight: 28 * DefaultStyle.dp - icon.width: 28 * DefaultStyle.dp - icon.height: 28 * DefaultStyle.dp + Layout.preferredWidth: Math.round(28 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) + icon.width: Math.round(28 * DefaultStyle.dp) + icon.height: Math.round(28 * DefaultStyle.dp) onClicked: { mainItem.createContact("", "") } @@ -241,12 +241,12 @@ FriendGui{ anchors.leftMargin: leftPanel.leftMargin anchors.bottom: leftPanel.bottom enabled: mainItem.leftPanelEnabled - spacing: 38 * DefaultStyle.dp + spacing: Math.round(38 * DefaultStyle.dp) SearchBar { id: searchBar visible: contactList.haveContacts || text.length !== 0 Layout.rightMargin: leftPanel.rightMargin - Layout.topMargin: 18 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) Layout.fillWidth: true placeholderText: qsTr("Rechercher un contact") KeyNavigation.up: createContactButton @@ -254,23 +254,23 @@ FriendGui{ } ColumnLayout { id: content - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) Text { visible: !contactList.loading && !contactList.haveContacts Layout.alignment: Qt.AlignHCenter - Layout.topMargin: 137 * DefaultStyle.dp + Layout.topMargin: Math.round(137 * DefaultStyle.dp) text: qsTr("Aucun contact%1").arg( searchBar.text.length !== 0 ? " correspondant" : "") font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } AllContactListView { id: contactList Layout.fillWidth: true Layout.fillHeight: true - Layout.rightMargin: 8 * DefaultStyle.dp + Layout.rightMargin: Math.round(8 * DefaultStyle.dp) searchBarText: searchBar.text hideSuggestions: true showDefaultAddress: false @@ -304,19 +304,19 @@ FriendGui{ property string objectName: "contactDetail" component ContactDetailLayout: ColumnLayout { id: contactDetailLayout - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) property string label property var icon property alias content: contentControl.contentItem signal titleIconClicked RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Text { text: contactDetailLayout.label color: DefaultStyle.main1_500_main font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } RoundButton { @@ -341,10 +341,10 @@ FriendGui{ id: contentControl visible: expandButton.checked Layout.fillWidth: true - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 17 * DefaultStyle.dp - bottomPadding: 17 * DefaultStyle.dp + leftPadding: Math.round(20 * DefaultStyle.dp) + rightPadding: Math.round(20 * DefaultStyle.dp) + topPadding: Math.round(17 * DefaultStyle.dp) + bottomPadding: Math.round(17 * DefaultStyle.dp) } } ContactLayout { @@ -367,32 +367,32 @@ FriendGui{ // property alias image: buttonImg property alias button: button property string label - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) RoundButton { id: button Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 56 * DefaultStyle.dp - Layout.preferredHeight: 56 * DefaultStyle.dp + Layout.preferredWidth: Math.round(56 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(56 * DefaultStyle.dp) style: ButtonStyle.grey } Text { Layout.alignment: Qt.AlignHCenter text: labelButton.label font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } component ActionsButtons: RowLayout { - spacing: 58 * DefaultStyle.dp + spacing: Math.round(58 * DefaultStyle.dp) LabelButton { button.icon.source: AppIcons.phone label: qsTr("Appel") - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.onClicked: mainWindow.startCallWithContact( contactDetail.contact, false, mainItem) @@ -401,10 +401,10 @@ FriendGui{ button.icon.source: AppIcons.chatTeardropText visible: !SettingsCpp.disableChatFeature label: qsTr("Message") - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.onClicked: console.debug( "[ContactLayout.qml] TODO : open conversation") } @@ -412,10 +412,10 @@ FriendGui{ visible: SettingsCpp.videoEnabled button.icon.source: AppIcons.videoCamera label: qsTr("Appel vidéo") - width: 56 * DefaultStyle.dp - height: 56 * DefaultStyle.dp - button.icon.width: 24 * DefaultStyle.dp - button.icon.height: 24 * DefaultStyle.dp + width: Math.round(56 * DefaultStyle.dp) + height: Math.round(56 * DefaultStyle.dp) + button.icon.width: Math.round(24 * DefaultStyle.dp) + button.icon.height: Math.round(24 * DefaultStyle.dp) button.onClicked: mainWindow.startCallWithContact( contactDetail.contact, true, mainItem) @@ -429,8 +429,8 @@ FriendGui{ Layout.fillWidth: true maximumLineCount: 1 font { - pixelSize: 29 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h2.pixelSize + weight: Typography.h2.weight capitalization: Font.Capitalize } } @@ -441,7 +441,7 @@ FriendGui{ Layout.fillWidth: true text: mode === LinphoneEnums.ConsolidatedPresence.Online ? qsTr("En ligne") : mode === LinphoneEnums.ConsolidatedPresence.Busy ? qsTr("Occupé") : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb ? qsTr("Ne pas déranger") : qsTr("Hors ligne") color: mode === LinphoneEnums.ConsolidatedPresence.Online ? DefaultStyle.success_500main : mode === LinphoneEnums.ConsolidatedPresence.Busy ? DefaultStyle.warning_600 : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb ? DefaultStyle.danger_500main : DefaultStyle.main2_500main - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } }, ActionsButtons { @@ -452,11 +452,11 @@ FriendGui{ content: Flickable { contentWidth: parent.width ColumnLayout { - spacing: 32 * DefaultStyle.dp + spacing: Math.round(32 * DefaultStyle.dp) anchors.left: parent.left anchors.right: parent.right ColumnLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) Layout.fillWidth: true ContactDetailLayout { id: infoLayout @@ -468,32 +468,32 @@ FriendGui{ implicitHeight: contentHeight width: parent.width clip: true - spacing: 9 * DefaultStyle.dp + spacing: Math.round(9 * DefaultStyle.dp) model: VariantList { model: (mainItem.selectedContact ? UtilsCpp.append(mainItem.selectedContact.core.addresses, mainItem.selectedContact.core.phoneNumbers) : []) } delegate: Item { property var listViewModelData: modelData width: addrList.width - height: 46 * DefaultStyle.dp + height: Math.round(46 * DefaultStyle.dp) ColumnLayout { anchors.fill: parent - // anchors.topMargin: 5 * DefaultStyle.dp + // anchors.topMargin: Math.round(5 * DefaultStyle.dp) RowLayout { Layout.fillWidth: true // Layout.fillHeight: true // Layout.alignment: Qt.AlignVCenter - // Layout.topMargin: 10 * DefaultStyle.dp - // Layout.bottomMargin: 10 * DefaultStyle.dp + // Layout.topMargin: Math.round(10 * DefaultStyle.dp) + // Layout.bottomMargin: Math.round(10 * DefaultStyle.dp) ColumnLayout { Layout.fillWidth: true Text { Layout.fillWidth: true text: listViewModelData.label font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } Text { @@ -501,8 +501,8 @@ FriendGui{ property string _text: listViewModelData.address text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_text) : _text font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } @@ -522,9 +522,9 @@ FriendGui{ Rectangle { visible: index != addrList.model.count - 1 Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp - Layout.rightMargin: 3 * DefaultStyle.dp - Layout.leftMargin: 3 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) + Layout.rightMargin: Math.round(3 * DefaultStyle.dp) + Layout.leftMargin: Math.round(3 * DefaultStyle.dp) color: DefaultStyle.main2_200 clip: true } @@ -537,20 +537,20 @@ FriendGui{ && companyText.text.length != 0 || jobText.text.length != 0 Layout.fillWidth: true - topPadding: 17 * DefaultStyle.dp - bottomPadding: 17 * DefaultStyle.dp - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp + topPadding: Math.round(17 * DefaultStyle.dp) + bottomPadding: Math.round(17 * DefaultStyle.dp) + leftPadding: Math.round(20 * DefaultStyle.dp) + rightPadding: Math.round(20 * DefaultStyle.dp) contentItem: ColumnLayout { RowLayout { - height: 50 * DefaultStyle.dp + height: Math.round(50 * DefaultStyle.dp) visible: companyText.text.length != 0 Text { text: qsTr("Société :") font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } Text { @@ -558,19 +558,19 @@ FriendGui{ text: mainItem.selectedContact && mainItem.selectedContact.core.organization font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } RowLayout { - height: 50 * DefaultStyle.dp + height: Math.round(50 * DefaultStyle.dp) visible: jobText.text.length != 0 Text { text: qsTr("Poste :") font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } Text { @@ -578,8 +578,8 @@ FriendGui{ text: mainItem.selectedContact && mainItem.selectedContact.core.job font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } @@ -594,8 +594,8 @@ FriendGui{ style: ButtonStyle.noBackground contentItem: RowLayout { EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) source: AppIcons.shareNetwork colorizationColor: DefaultStyle.main2_600 } @@ -610,8 +610,8 @@ FriendGui{ Layout.fillWidth: true } EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.rightArrow colorizationColor: DefaultStyle.main2_600 } @@ -626,12 +626,12 @@ FriendGui{ icon: AppIcons.question onTitleIconClicked: trustInfoDialog.open() content: ColumnLayout { - spacing: 13 * DefaultStyle.dp + spacing: Math.round(13 * DefaultStyle.dp) Text { text: qsTr("Niveau de confiance - Appareils vérifiés") font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } Text { @@ -641,29 +641,29 @@ FriendGui{ ProgressBar { visible: deviceList.count > 0 Layout.fillWidth: true - Layout.preferredHeight: 28 * DefaultStyle.dp + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) value: mainItem.selectedContact ? mainItem.selectedContact.core.verifiedDeviceCount / deviceList.count : 0 } ListView { id: deviceList Layout.fillWidth: true Layout.preferredHeight: Math.min( - 200 * DefaultStyle.dp, + Math.round(200 * DefaultStyle.dp), contentHeight) clip: true model: mainItem.selectedContact ? mainItem.selectedContact.core.devices : [] - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) delegate: RowLayout { id: deviceDelegate width: deviceList.width - height: 30 * DefaultStyle.dp + height: Math.round(30 * DefaultStyle.dp) property var listViewModelData: modelData property var callObj property CallGui deviceCall: callObj ? callObj.value : null property string deviceName: listViewModelData.name.length != 0 ? listViewModelData.name : qsTr("Appareil sans nom") Text { text: deviceDelegate.deviceName - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) } Item { Layout.fillWidth: true @@ -671,12 +671,12 @@ FriendGui{ EffectImage { visible: listViewModelData.securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified imageSource: AppIcons.trusted - Layout.preferredWidth: 22 * DefaultStyle.dp - Layout.preferredHeight: 22 * DefaultStyle.dp + Layout.preferredWidth: Math.round(22 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(22 * DefaultStyle.dp) } SmallButton { - // Layout.preferredHeight: 30 * DefaultStyle.dp + // Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) visible: listViewModelData.securityLevel != LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified icon.source: AppIcons.warningCircle style: ButtonStyle.tertiary @@ -710,7 +710,7 @@ FriendGui{ width: parent.width IconLabelButton { Layout.fillWidth: true - Layout.preferredHeight: 50 * DefaultStyle.dp + Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) icon.source: AppIcons.pencil text: qsTr("Éditer") onClicked: mainItem.editContact( @@ -720,12 +720,12 @@ FriendGui{ } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.preferredHeight: 50 * DefaultStyle.dp + Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) icon.source: mainItem.selectedContact && mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart text: mainItem.selectedContact @@ -737,12 +737,12 @@ FriendGui{ } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_200 } IconLabelButton { Layout.fillWidth: true - Layout.preferredHeight: 50 * DefaultStyle.dp + Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) icon.source: AppIcons.shareNetwork text: qsTr("Partager") style: ButtonStyle.noBackground @@ -772,36 +772,36 @@ FriendGui{ } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_200 } // IconLabelButton { // Layout.fillWidth: true - // Layout.preferredHeight: 50 * DefaultStyle.dp + // Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) // icon.source: AppIcons.bellSlash // text: qsTr("Mettre en sourdine") // onClicked: console.log("TODO : mute contact") // } // Rectangle { // Layout.fillWidth: true - // Layout.preferredHeight: 1 * DefaultStyle.dp + // Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) // color: DefaultStyle.main2_200 // } // IconLabelButton { // Layout.fillWidth: true - // Layout.preferredHeight: 50 * DefaultStyle.dp + // Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) // icon.source: AppIcons.empty // text: qsTr("Bloquer") // onClicked: console.log("TODO : block contact") // } // Rectangle { // Layout.fillWidth: true - // Layout.preferredHeight: 1 * DefaultStyle.dp + // Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) // color: DefaultStyle.main2_200 // } IconLabelButton { Layout.fillWidth: true - Layout.preferredHeight: 50 * DefaultStyle.dp + Layout.preferredHeight: Math.round(50 * DefaultStyle.dp) icon.source: AppIcons.trashCan text: qsTr("Supprimer ce contact") visible: !mainItem.selectedContact?.core.readOnly diff --git a/Linphone/view/Page/Main/Help/HelpPage.qml b/Linphone/view/Page/Main/Help/HelpPage.qml index 590397c1..dee916c5 100644 --- a/Linphone/view/Page/Main/Help/HelpPage.qml +++ b/Linphone/view/Page/Main/Help/HelpPage.qml @@ -18,18 +18,18 @@ AbstractMainPage { id: leftPanel Layout.fillWidth: true Layout.fillHeight: true - property int sideMargin: 45 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + property real sideMargin: Math.round(45 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) RowLayout { Layout.fillWidth: true Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) Button { icon.source: AppIcons.leftArrow style: ButtonStyle.noBackground - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) onClicked: { mainItem.goBack() } @@ -46,7 +46,7 @@ AbstractMainPage { Text { Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - Layout.topMargin: 41 * DefaultStyle.dp + Layout.topMargin: Math.round(41 * DefaultStyle.dp) Layout.fillWidth: true text: qsTr("À propos de Linphone") color: DefaultStyle.main2_600 @@ -56,8 +56,8 @@ AbstractMainPage { Layout.fillWidth: true Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - Layout.topMargin: 24 * DefaultStyle.dp - spacing: 32 * DefaultStyle.dp + Layout.topMargin: Math.round(24 * DefaultStyle.dp) + spacing: Math.round(32 * DefaultStyle.dp) HelpIconLabelButton { Layout.fillWidth: true iconSource: AppIcons.detective @@ -98,7 +98,7 @@ AbstractMainPage { Text { Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - Layout.topMargin: 32 * DefaultStyle.dp + Layout.topMargin: Math.round(32 * DefaultStyle.dp) Layout.fillWidth: true text: qsTr("À propos de Linphone") color: DefaultStyle.main2_600 @@ -109,7 +109,7 @@ AbstractMainPage { Layout.fillWidth: true Layout.leftMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin - Layout.topMargin: 24 * DefaultStyle.dp + Layout.topMargin: Math.round(24 * DefaultStyle.dp) iconSource: AppIcons.debug title: qsTr("Dépannage") onClicked: { diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index 06dbba31..92f499c7 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -63,7 +63,7 @@ AbstractMainPage { id: leftPanelStackView Layout.fillWidth: true Layout.fillHeight: true - Layout.leftMargin: 45 * DefaultStyle.dp + Layout.leftMargin: Math.round(45 * DefaultStyle.dp) initialItem: listLayout clip: true } @@ -72,7 +72,7 @@ AbstractMainPage { id: cancelAndDeleteConfDialog property bool cancel: false signal cancelRequested() - // width: 278 * DefaultStyle.dp + // width: Math.round(278 * DefaultStyle.dp) text: cancel ? qsTr("Souhaitez-vous annuler et supprimer cette réunion ?") : qsTr("Souhaitez-vous supprimer cette réunion ?") buttons: [ BigButton { @@ -108,7 +108,7 @@ AbstractMainPage { id: overridenRightPanel Control.StackView { id: overridenRightPanelStackView - width: 393 * DefaultStyle.dp + width: Math.round(393 * DefaultStyle.dp) height: parent.height anchors.top: parent.top anchors.centerIn: parent @@ -132,23 +132,23 @@ AbstractMainPage { anchors.fill: parent spacing: 0 RowLayout { - Layout.rightMargin: 38 * DefaultStyle.dp + Layout.rightMargin: Math.round(38 * DefaultStyle.dp) spacing: 0 Text { Layout.fillWidth: true text: qsTr("Réunions") color: DefaultStyle.main2_700 - font.pixelSize: 29 * DefaultStyle.dp - font.weight: 800 * DefaultStyle.dp + font.pixelSize: Typography.h2.pixelSize + font.weight: Typography.h2.weight } Item{Layout.fillWidth: true} Button { style: ButtonStyle.noBackground icon.source: AppIcons.plusCircle - Layout.preferredWidth: 28 * DefaultStyle.dp - Layout.preferredHeight: 28 * DefaultStyle.dp - icon.width: 28 * DefaultStyle.dp - icon.height: 28 * DefaultStyle.dp + Layout.preferredWidth: Math.round(28 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(28 * DefaultStyle.dp) + icon.width: Math.round(28 * DefaultStyle.dp) + icon.height: Math.round(28 * DefaultStyle.dp) onClicked: { mainItem.editConference() } @@ -157,8 +157,8 @@ AbstractMainPage { SearchBar { id: searchBar Layout.fillWidth: true - Layout.topMargin: 18 * DefaultStyle.dp - Layout.rightMargin: 38 * DefaultStyle.dp + Layout.topMargin: Math.round(18 * DefaultStyle.dp) + Layout.rightMargin: Math.round(38 * DefaultStyle.dp) placeholderText: qsTr("Rechercher une réunion") KeyNavigation.up: conferenceList KeyNavigation.down: conferenceList @@ -172,19 +172,19 @@ AbstractMainPage { } Text { visible: conferenceList.count === 0 - Layout.topMargin: 137 * DefaultStyle.dp + Layout.topMargin: Math.round(137 * DefaultStyle.dp) Layout.fillHeight: true Layout.alignment: Qt.AlignHCenter text: qsTr("Aucune réunion%1").arg(searchBar.text.length !== 0 ? " correspondante" : "") font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } MeetingListView { id: conferenceList // Remove 24 from first section padding because we cannot know that it is the first section. 24 is the margins between sections. - Layout.topMargin: 38 * DefaultStyle.dp - 24 * DefaultStyle.dp + Layout.topMargin: Math.round(38 * DefaultStyle.dp) - Math.round(24 * DefaultStyle.dp) Layout.fillWidth: true Layout.fillHeight: true @@ -217,18 +217,18 @@ AbstractMainPage { property ConferenceInfoGui conferenceInfoGui property bool isCreation ColumnLayout { - spacing: 33 * DefaultStyle.dp + spacing: Math.round(33 * DefaultStyle.dp) anchors.fill: parent RowLayout { - Layout.rightMargin: 35 * DefaultStyle.dp - spacing: 5 * DefaultStyle.dp + Layout.rightMargin: Math.round(35 * DefaultStyle.dp) + spacing: Math.round(5 * DefaultStyle.dp) Button { id: backButton style: ButtonStyle.noBackground icon.source: AppIcons.leftArrow focus: true - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) KeyNavigation.right: createButton KeyNavigation.down: meetingSetup onClicked: { @@ -240,8 +240,8 @@ AbstractMainPage { text: qsTr("Nouvelle réunion") color: DefaultStyle.main2_700 font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } Layout.fillWidth: true } @@ -275,7 +275,7 @@ AbstractMainPage { isCreation: createConfLayout.isCreation Layout.fillHeight: true Layout.fillWidth: true - Layout.rightMargin: 35 * DefaultStyle.dp + Layout.rightMargin: Math.round(35 * DefaultStyle.dp) Connections { target: meetingSetup.conferenceInfoGui ? meetingSetup.conferenceInfoGui.core : null function onConferenceSchedulerStateChanged() { @@ -332,18 +332,18 @@ AbstractMainPage { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: 58 * DefaultStyle.dp + anchors.topMargin: Math.round(58 * DefaultStyle.dp) spacing: 0 Section { - Layout.preferredWidth: 393 * DefaultStyle.dp + Layout.preferredWidth: Math.round(393 * DefaultStyle.dp) content: RowLayout { - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) Layout.preferredWidth: overridenRightPanelStackView.width Button { id: backButton icon.source: AppIcons.leftArrow - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) style: ButtonStyle.noBackground KeyNavigation.left: saveButton KeyNavigation.right: titleText @@ -355,12 +355,12 @@ AbstractMainPage { } } RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage{ imageSource: AppIcons.usersThree colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } TextInput { id: titleText @@ -368,8 +368,8 @@ AbstractMainPage { color: DefaultStyle.main2_600 clip: true font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Typography.h4.weight } KeyNavigation.left: backButton KeyNavigation.right: saveButton @@ -455,22 +455,22 @@ AbstractMainPage { ColumnLayout { property Control.StackView container property ConferenceInfoGui conferenceInfoGui - spacing: 18 * DefaultStyle.dp + spacing: Math.round(18 * DefaultStyle.dp) FocusScope{ Layout.fillWidth: true Layout.preferredHeight: childrenRect.height ColumnLayout { - spacing: 4 * DefaultStyle.dp + spacing: Math.round(4 * DefaultStyle.dp) Layout.fillWidth: true RowLayout { id: addParticipantsButtons - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Button { id: addParticipantsBackButton style: ButtonStyle.noBackgroundOrange icon.source: AppIcons.leftArrow - icon.width: 24 * DefaultStyle.dp - icon.height: 24 * DefaultStyle.dp + icon.width: Math.round(24 * DefaultStyle.dp) + icon.height: Math.round(24 * DefaultStyle.dp) KeyNavigation.right: addButton KeyNavigation.down: addParticipantLayout onClicked: container.pop() @@ -480,15 +480,15 @@ AbstractMainPage { color: DefaultStyle.main1_500_main maximumLineCount: 1 font { - pixelSize: 18 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(18 * DefaultStyle.dp) + weight: Typography.h4.weight } Layout.fillWidth: true } SmallButton { id: addButton enabled: addParticipantLayout.selectedParticipantsCount.length != 0 - Layout.leftMargin: 11 * DefaultStyle.dp + Layout.leftMargin: Math.round(11 * DefaultStyle.dp) focus: enabled style: ButtonStyle.main text: qsTr("Ajouter") @@ -505,8 +505,8 @@ AbstractMainPage { Layout.leftMargin: addParticipantsBackButton.width + addParticipantsButtons.spacing maximumLineCount: 1 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } Layout.fillWidth: true } @@ -531,27 +531,27 @@ AbstractMainPage { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: 58 * DefaultStyle.dp + anchors.topMargin: Math.round(58 * DefaultStyle.dp) visible: mainItem.selectedConference - spacing: 25 * DefaultStyle.dp + spacing: Math.round(25 * DefaultStyle.dp) Section { visible: mainItem.selectedConference Layout.fillWidth: true content: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.usersThree colorizationColor: DefaultStyle.main2_600 - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } Text { Layout.fillWidth: true text: mainItem.selectedConference && mainItem.selectedConference.core? mainItem.selectedConference.core.subject : "" maximumLineCount: 1 font { - pixelSize: 20 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(20 * DefaultStyle.dp) + weight: Typography.h4.weight } } Item { @@ -571,8 +571,8 @@ AbstractMainPage { } PopupButton { id: deletePopup - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) contentImageColor: DefaultStyle.main1_500_main KeyNavigation.left: editButton.visible ? editButton : leftPanelStackView.currentItem KeyNavigation.right: leftPanelStackView.currentItem @@ -609,14 +609,14 @@ AbstractMainPage { } Section { content: ColumnLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) width: parent.width RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) Layout.fillWidth: true EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) colorizationColor: DefaultStyle.main2_600 imageSource: AppIcons.videoCamera } @@ -658,10 +658,10 @@ AbstractMainPage { } } RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.clock colorizationColor: DefaultStyle.main2_600 } @@ -673,23 +673,23 @@ AbstractMainPage { + UtilsCpp.toDateHourString(mainItem.selectedConference.core.endDateTime) : '' font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) capitalization: Font.Capitalize } } } RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.globe colorizationColor: DefaultStyle.main2_600 } Text { text: qsTr("Time zone: ") + (mainItem.selectedConference && mainItem.selectedConference.core ? (mainItem.selectedConference.core.timeZoneModel.displayName + ", " + mainItem.selectedConference.core.timeZoneModel.countryName) : "") font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -699,10 +699,10 @@ AbstractMainPage { Section { visible: mainItem.selectedConference && mainItem.selectedConference.core?.description.length != 0 content: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.note colorizationColor: DefaultStyle.main2_600 } @@ -710,7 +710,7 @@ AbstractMainPage { text: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.description : "" Layout.fillWidth: true font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -718,22 +718,22 @@ AbstractMainPage { } Section { content: RowLayout { - spacing: 8 * DefaultStyle.dp + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) imageSource: AppIcons.userRectangle colorizationColor: DefaultStyle.main2_600 } Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerAddress : "" } Text { text: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.organizerName : "" font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -743,28 +743,28 @@ AbstractMainPage { visible: participantList.count > 0 content: RowLayout { Layout.preferredHeight: participantList.height - width: 393 * DefaultStyle.dp - spacing: 8 * DefaultStyle.dp + width: Math.round(393 * DefaultStyle.dp) + spacing: Math.round(8 * DefaultStyle.dp) EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.topMargin: 20 * DefaultStyle.dp + Layout.topMargin: Math.round(20 * DefaultStyle.dp) imageSource: AppIcons.usersTwo colorizationColor: DefaultStyle.main2_600 } ListView { id: participantList - Layout.preferredHeight: Math.min(184 * DefaultStyle.dp, contentHeight) + Layout.preferredHeight: Math.min(Math.round(184 * DefaultStyle.dp), contentHeight) Layout.fillWidth: true model: mainItem.selectedConference && mainItem.selectedConference.core ? mainItem.selectedConference.core.participants : [] clip: true delegate: RowLayout { - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) width: participantList.width Avatar { - Layout.preferredWidth: 45 * DefaultStyle.dp - Layout.preferredHeight: 45 * DefaultStyle.dp + Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) _address: modelData.address shadowEnabled: false } @@ -774,7 +774,7 @@ AbstractMainPage { maximumLineCount: 1 Layout.fillWidth: true font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) capitalization: Font.Capitalize } } @@ -783,8 +783,8 @@ AbstractMainPage { visible: mainItem.selectedConference && mainItem.selectedConference.core?.organizerAddress === modelData.address color: DefaultStyle.main2_400 font { - pixelSize: 12 * DefaultStyle.dp - weight: 300 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(300 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Page/Main/Start/WelcomePage.qml b/Linphone/view/Page/Main/Start/WelcomePage.qml index 8b4d1f10..e4ebdfa6 100644 --- a/Linphone/view/Page/Main/Start/WelcomePage.qml +++ b/Linphone/view/Page/Main/Start/WelcomePage.qml @@ -14,23 +14,23 @@ LoginLayout { id: welcome text: qsTr("Bienvenue") Layout.alignment: Qt.AlignVCenter - Layout.leftMargin: 132 * DefaultStyle.dp + Layout.leftMargin: Math.round(132 * DefaultStyle.dp) color: DefaultStyle.main2_800 font { - pixelSize: 96 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp - } + pixelSize: Math.round(96 * DefaultStyle.dp) + weight: Typography.h4.weight + } scaleLettersFactor: 1.1 }, Text { Layout.alignment: Qt.AlignBottom - Layout.leftMargin: 29 * DefaultStyle.dp - Layout.bottomMargin: 19 * DefaultStyle.dp + Layout.leftMargin: Math.round(29 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(19 * DefaultStyle.dp) color: DefaultStyle.main2_800 text: qsTr("sur Linphone") font { - pixelSize: 36 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h1.pixelSize + weight: Typography.h1.weight } scaleLettersFactor: 1.1 }, @@ -40,7 +40,7 @@ LoginLayout { SmallButton { visible: carousel.currentIndex < (carousel.itemsCount - 1) flat: true - Layout.rightMargin: 50 * DefaultStyle.dp + Layout.rightMargin: Math.round(50 * DefaultStyle.dp) Layout.alignment: Qt.AlignVCenter | Layout.AlignRight style: ButtonStyle.noBackground text: qsTr("Passer") @@ -52,26 +52,26 @@ LoginLayout { } ] centerContent: ColumnLayout { - spacing: 76 * DefaultStyle.dp + spacing: Math.round(76 * DefaultStyle.dp) anchors.left: parent.left anchors.top: parent.top - anchors.leftMargin: 308 * DefaultStyle.dp - anchors.topMargin: 166 * DefaultStyle.dp + anchors.leftMargin: Math.round(308 * DefaultStyle.dp) + anchors.topMargin: Math.round(166 * DefaultStyle.dp) RowLayout { id: carouselLayout - spacing: 76 * DefaultStyle.dp + spacing: Math.round(76 * DefaultStyle.dp) Image { id: carouselImg - // Layout.rightMargin: 40 * DefaultStyle.dp - Layout.preferredWidth: 153.22 * DefaultStyle.dp - Layout.preferredHeight: 155.9 * DefaultStyle.dp + // Layout.rightMargin: Math.round(40 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(153.22 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(155.9 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit source: carousel.currentIndex == 0 ? AppIcons.welcomeLinphoneLogo : carousel.currentIndex == 1 ? AppIcons.welcomeLock : AppIcons.welcomeOpenSource } Carousel { id: carousel - Layout.leftMargin: 75.78 * DefaultStyle.dp + Layout.leftMargin: Math.round(75.78 * DefaultStyle.dp) itemsCount: slideRepeater.count itemsList: Repeater { id: slideRepeater @@ -81,21 +81,23 @@ LoginLayout { {title: qsTr("Open Source"), text: qsTr("Une application open source et un service gratuit
depuis 2001")} ] ColumnLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Text { id: title text: modelData.title font { - pixelSize: 29 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h2.pixelSize + weight: Typography.h2.weight } } Text { id: txt - Layout.maximumWidth: 361 * DefaultStyle.dp - wrapMode: Text.WordWrap - font.pixelSize: 14 * DefaultStyle.dp - font.weight: 400 * DefaultStyle.dp + Layout.maximumWidth: Math.round(361 * DefaultStyle.dp) + wrapMode: Text.WordWrap + font { + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight + } text: modelData.text } } @@ -104,7 +106,7 @@ LoginLayout { } BigButton { - Layout.leftMargin: 509 * DefaultStyle.dp + Layout.leftMargin: Math.round(509 * DefaultStyle.dp) style: ButtonStyle.main text: carousel.currentIndex < (carousel.itemsCount - 1) ? qsTr("Suivant") : qsTr("Commencer") onClicked: { diff --git a/Linphone/view/Page/Window/AbstractWindow.qml b/Linphone/view/Page/Window/AbstractWindow.qml index f9ebef09..3bdccf63 100644 --- a/Linphone/view/Page/Window/AbstractWindow.qml +++ b/Linphone/view/Page/Window/AbstractWindow.qml @@ -12,8 +12,8 @@ ApplicationWindow { id: mainWindow x: 0 y: 0 - width: Math.min(1512 * DefaultStyle.dp, Screen.desktopAvailableWidth) - height: Math.min(982 * DefaultStyle.dp, Screen.desktopAvailableHeight) + width: Math.min(Math.round(1512 * DefaultStyle.dp), Screen.desktopAvailableWidth) + height: Math.min(Math.round(982 * DefaultStyle.dp), Screen.desktopAvailableHeight) onActiveChanged: UtilsCpp.setLastActiveWindow(this) @@ -47,7 +47,7 @@ ApplicationWindow { // For C++, requestDialog need to be call directly onAccepted: requestDialog ? requestDialog.result(1) : callback(1) onRejected: requestDialog ? requestDialog.result(0) : callback(0) - width: title.length === 0 ? 278 * DefaultStyle.dp : 637 * DefaultStyle.dp + width: title.length === 0 ? Math.round(278 * DefaultStyle.dp) : Math.round(637 * DefaultStyle.dp) } } @@ -62,31 +62,31 @@ ApplicationWindow { } underlineColor: DefaultStyle.main1_500_main anchors.centerIn: parent - width: 370 * DefaultStyle.dp + width: Math.round(370 * DefaultStyle.dp) modal: true - leftPadding: 15 * DefaultStyle.dp - rightPadding: 15 * DefaultStyle.dp - topPadding: 20 * DefaultStyle.dp - bottomPadding: 25 * DefaultStyle.dp + leftPadding: Math.round(15 * DefaultStyle.dp) + rightPadding: Math.round(15 * DefaultStyle.dp) + topPadding: Math.round(20 * DefaultStyle.dp) + bottomPadding: Math.round(25 * DefaultStyle.dp) contentItem: ColumnLayout { - spacing: 16 * DefaultStyle.dp + spacing: Math.round(16 * DefaultStyle.dp) RowLayout { - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) width: startCallPopup.width Text { text: qsTr("Quelle adresse souhaitez-vous appeler ?") wrapMode: Text.Wrap Layout.fillWidth: true font { - pixelSize: 16 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h4.pixelSize + weight: Typography.h4.weight } } RoundButton { Layout.alignment: Qt.AlignVCenter style: ButtonStyle.noBackground - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) icon.source:AppIcons.closeX onClicked: startCallPopup.close() } @@ -98,37 +98,37 @@ ApplicationWindow { } Layout.fillWidth: true Layout.preferredHeight: contentHeight - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) delegate: Item { width: popuplist.width - height: 56 * DefaultStyle.dp + height: Math.round(56 * DefaultStyle.dp) ColumnLayout { width: popuplist.width anchors.verticalCenter: parent.verticalCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) ColumnLayout { - spacing: 7 * DefaultStyle.dp + spacing: Math.round(7 * DefaultStyle.dp) Text { - Layout.leftMargin: 5 * DefaultStyle.dp + Layout.leftMargin: Math.round(5 * DefaultStyle.dp) text: modelData.label + " :" font { - pixelSize: 13 * DefaultStyle.dp - weight: 700 * DefaultStyle.dp + pixelSize: Typography.p2.pixelSize + weight: Typography.p2.weight } } Text { - Layout.leftMargin: 5 * DefaultStyle.dp + Layout.leftMargin: Math.round(5 * DefaultStyle.dp) text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(modelData.address) : modelData.address font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight } } } Rectangle { visible: index != popuplist.model.count - 1 Layout.fillWidth: true - Layout.preferredHeight: 1 * DefaultStyle.dp + Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1) color: DefaultStyle.main2_200 } } @@ -234,10 +234,10 @@ ApplicationWindow { id: popupLayout anchors.fill: parent Layout.alignment: Qt.AlignBottom - property int nextY: mainWindow.height + property real nextY: mainWindow.height property list popupList property int popupCount: popupList.length - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) onPopupCountChanged: { nextY = mainWindow.height for(var i = 0; i < popupCount; ++i) { @@ -256,9 +256,9 @@ ApplicationWindow { modal: true closePolicy: Popup.NoAutoClose anchors.centerIn: parent - padding: 20 * DefaultStyle.dp + padding: Math.round(20 * DefaultStyle.dp) underlineColor: DefaultStyle.main1_500_main - radius: 15 * DefaultStyle.dp + radius: Math.round(15 * DefaultStyle.dp) } FPSCounter{ anchors.top: parent.top @@ -271,7 +271,7 @@ ApplicationWindow { id: fpsText font.bold: true font.italic: true - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) text: parent.fps + " FPS" color: parent.fps < 30 ? DefaultStyle.danger_500main : DefaultStyle.main2_900 } diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index d0c8057e..45e2ad12 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -187,7 +187,7 @@ AbstractWindow { mainWindow.callTerminatedByUser = true call.core.lTerminateAllCalls() } - width: 278 * DefaultStyle.dp + width: Math.round(278 * DefaultStyle.dp) text: qsTr("La fenêtre est sur le point d'être fermée. Cela terminera tous les appels en cours. Souhaitez vous continuer ?") } @@ -219,12 +219,12 @@ AbstractWindow { background: Rectangle { anchors.fill: parent color: bottomButton.enabled ? disabledIcon ? DefaultStyle.grey_500 : bottomButton.pressed || bottomButton.checked ? DefaultStyle.main2_400 : DefaultStyle.grey_500 : DefaultStyle.grey_600 - radius: 71 * DefaultStyle.dp + radius: Math.round(71 * DefaultStyle.dp) } icon.source: disabledIcon && bottomButton.checked ? disabledIcon : enabledIcon - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) contentImageColor: DefaultStyle.grey_0 } ZrtpAuthenticationDialog { @@ -242,13 +242,13 @@ AbstractWindow { } Control.Control { id: zrtpValidationToast - // width: 269 * DefaultStyle.dp + // width: Math.round(269 * DefaultStyle.dp) y: -height * 2 z: 1 - topPadding: 8 * DefaultStyle.dp - bottomPadding: 8 * DefaultStyle.dp - leftPadding: 50 * DefaultStyle.dp - rightPadding: 50 * DefaultStyle.dp + topPadding: Math.round(8 * DefaultStyle.dp) + bottomPadding: Math.round(8 * DefaultStyle.dp) + leftPadding: Math.round(50 * DefaultStyle.dp) + rightPadding: Math.round(50 * DefaultStyle.dp) anchors.horizontalCenter: parent.horizontalCenter clip: true function open() { @@ -266,15 +266,15 @@ AbstractWindow { anchors.fill: parent color: DefaultStyle.grey_0 border.color: DefaultStyle.info_500_main - border.width: 1 * DefaultStyle.dp - radius: 50 * DefaultStyle.dp + border.width: Math.max(Math.round(1 * DefaultStyle.dp), 1) + radius: Math.round(50 * DefaultStyle.dp) } contentItem: RowLayout { // anchors.centerIn: parent Image { source: AppIcons.trusted - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) fillMode: Image.PreserveAspectFit Layout.fillWidth: true } @@ -283,7 +283,7 @@ AbstractWindow { text: qsTr("Appareil vérifié") Layout.fillWidth: true font { - pixelSize: 14 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp) } } } @@ -300,26 +300,26 @@ AbstractWindow { ColumnLayout { anchors.fill: parent - spacing: 10 * DefaultStyle.dp - anchors.bottomMargin: 10 * DefaultStyle.dp - anchors.topMargin: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(10 * DefaultStyle.dp) + anchors.topMargin: Math.round(10 * DefaultStyle.dp) Item { id: headerItem - Layout.margins: 10 * DefaultStyle.dp - Layout.leftMargin: 20 * DefaultStyle.dp + Layout.margins: Math.round(10 * DefaultStyle.dp) + Layout.leftMargin: Math.round(20 * DefaultStyle.dp) Layout.fillWidth: true - Layout.minimumHeight: 25 * DefaultStyle.dp + Layout.minimumHeight: Math.round(25 * DefaultStyle.dp) RowLayout { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) EffectImage { id: callStatusIcon - Layout.preferredWidth: 30 * DefaultStyle.dp - Layout.preferredHeight: 30 * DefaultStyle.dp + Layout.preferredWidth: Math.round(30 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(30 * DefaultStyle.dp) // TODO : change with broadcast or meeting icon when available imageSource: !mainWindow.call ? AppIcons.meeting : (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released) ? AppIcons.endCall : (mainWindow.callState === LinphoneEnums.CallState.Paused || mainWindow.callState === LinphoneEnums.CallState.PausedByRemote) ? AppIcons.pause : mainWindow.conference ? AppIcons.usersThree : mainWindow.call.core.dir === LinphoneEnums.CallDir.Outgoing ? AppIcons.arrowUpRight : AppIcons.arrowDownLeft colorizationColor: !mainWindow.call @@ -339,17 +339,17 @@ AbstractWindow { } } ColumnLayout { - spacing: 6 * DefaultStyle.dp + spacing: Math.round(6 * DefaultStyle.dp) RowLayout { - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) Text { id: callStatusText property string remoteName: mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning ? mainWindow.call.core.remoteName : qsTr("Appel %1").arg(mainWindow.call ? EnumsToStringCpp.dirToString(mainWindow.call.core.dir) : "") text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released) ? qsTr("Fin d'appel") : mainWindow.call && (mainWindow.call.core.paused || (mainWindow.callState === LinphoneEnums.CallState.Paused || mainWindow.callState === LinphoneEnums.CallState.PausedByRemote)) ? (mainWindow.conference ? qsTr('Réunion mise ') : qsTr('Appel mis')) + qsTr(" en pause") : mainWindow.conference ? mainWindow.conference.core.subject : remoteName color: DefaultStyle.grey_0 font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } } Rectangle { @@ -359,9 +359,9 @@ AbstractWindow { || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) Layout.fillHeight: true - Layout.topMargin: 10 * DefaultStyle.dp - Layout.bottomMargin: 2 * DefaultStyle.dp - Layout.preferredWidth: 2 * DefaultStyle.dp + Layout.topMargin: Math.round(10 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(2 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(2 * DefaultStyle.dp) color: DefaultStyle.grey_0 } Text { @@ -369,8 +369,8 @@ AbstractWindow { mainWindow.call.core.duration) : "" color: DefaultStyle.grey_0 font { - pixelSize: 22 * DefaultStyle.dp - weight: 800 * DefaultStyle.dp + pixelSize: Typography.h3.pixelSize + weight: Typography.h3.weight } visible: mainWindow.callState === LinphoneEnums.CallState.Connected @@ -378,21 +378,21 @@ AbstractWindow { === LinphoneEnums.CallState.StreamsRunning } Text { - Layout.leftMargin: 14 * DefaultStyle.dp + Layout.leftMargin: Math.round(14 * DefaultStyle.dp) id: conferenceDate text: mainWindow.conferenceInfo ? mainWindow.conferenceInfo.core.getStartEndDateString( ) : "" color: DefaultStyle.grey_0 font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Typography.p1.pixelSize + weight: Typography.p1.weight capitalization: Font.Capitalize } } } RowLayout { id: securityStateLayout - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) visible: false Connections { target: mainWindow @@ -413,13 +413,13 @@ AbstractWindow { != LinphoneEnums.CallState.Connected && mainWindow.callState != LinphoneEnums.CallState.StreamsRunning - Layout.preferredWidth: 15 * DefaultStyle.dp - Layout.preferredHeight: 15 * DefaultStyle.dp + Layout.preferredWidth: Math.round(15 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(15 * DefaultStyle.dp) indicatorColor: DefaultStyle.grey_0 } EffectImage { - Layout.preferredWidth: 15 * DefaultStyle.dp - Layout.preferredHeight: 15 * DefaultStyle.dp + Layout.preferredWidth: Math.round(15 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(15 * DefaultStyle.dp) colorizationColor: mainWindow.call ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp ? DefaultStyle.info_500_main : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified ? DefaultStyle.warning_600 : DefaultStyle.info_500_main : DefaultStyle.grey_0 : "transparent" visible: mainWindow.call && mainWindow.callState @@ -438,8 +438,8 @@ AbstractWindow { === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp ? DefaultStyle.info_500_main : mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified ? DefaultStyle.warning_600 : DefaultStyle.info_500_main : DefaultStyle.grey_0 : DefaultStyle.grey_0 font { - pixelSize: 12 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp + pixelSize: Math.round(12 * DefaultStyle.dp) + weight: Math.round(400 * DefaultStyle.dp) } MouseArea { anchors.fill: parent @@ -461,9 +461,9 @@ AbstractWindow { Layout.fillWidth: true } EffectImage { - Layout.preferredWidth: 32 * DefaultStyle.dp - Layout.preferredHeight: 32 * DefaultStyle.dp - Layout.rightMargin: 30 * DefaultStyle.dp + Layout.preferredWidth: Math.round(32 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(32 * DefaultStyle.dp) + Layout.rightMargin: Math.round(30 * DefaultStyle.dp) property int quality: mainWindow.call ? mainWindow.call.core.quality : 0 imageSource: quality >= 4 ? AppIcons.cellSignalFull : quality >= 3 ? AppIcons.cellSignalMedium : quality >= 2 ? AppIcons.cellSignalLow : AppIcons.cellSignalNone colorizationColor: DefaultStyle.grey_0 @@ -488,28 +488,28 @@ AbstractWindow { Control.Control { visible: mainWindow.call ? !!mainWindow.conference ? mainWindow.conference.core.isRecording : (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording) : false anchors.centerIn: parent - leftPadding: 14 * DefaultStyle.dp - rightPadding: 14 * DefaultStyle.dp - topPadding: 6 * DefaultStyle.dp - bottomPadding: 6 * DefaultStyle.dp + leftPadding: Math.round(14 * DefaultStyle.dp) + rightPadding: Math.round(14 * DefaultStyle.dp) + topPadding: Math.round(6 * DefaultStyle.dp) + bottomPadding: Math.round(6 * DefaultStyle.dp) background: Rectangle { anchors.fill: parent color: DefaultStyle.grey_500 - radius: 10 * DefaultStyle.dp + radius: Math.round(10 * DefaultStyle.dp) } contentItem: RowLayout { - spacing: 85 * DefaultStyle.dp + spacing: Math.round(85 * DefaultStyle.dp) RowLayout { - spacing: 15 * DefaultStyle.dp + spacing: Math.round(15 * DefaultStyle.dp) EffectImage { imageSource: AppIcons.recordFill colorizationColor: DefaultStyle.danger_500main - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: Math.round(24 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(24 * DefaultStyle.dp) } Text { color: DefaultStyle.danger_500main - font.pixelSize: 14 * DefaultStyle.dp + font.pixelSize: Math.round(14 * DefaultStyle.dp) text: mainWindow.call ? mainWindow.call.core.recording ? mainWindow.conference ? qsTr("Vous enregistrez la réunion") : qsTr("Vous enregistrez l'appel") : mainWindow.conference ? qsTr("Un participant enregistre la réunion") : qsTr("Votre correspondant enregistre l'appel") : "" } } @@ -527,7 +527,7 @@ AbstractWindow { RowLayout { Layout.fillWidth: true Layout.fillHeight: true - spacing: 23 * DefaultStyle.dp + spacing: Math.round(23 * DefaultStyle.dp) Control.StackView { id: middleItemStackView initialItem: inCallItem @@ -537,9 +537,9 @@ AbstractWindow { CallSettingsPanel { id: rightPanel Layout.fillHeight: true - Layout.rightMargin: 20 * DefaultStyle.dp - Layout.preferredWidth: 393 * DefaultStyle.dp - Layout.topMargin: 10 * DefaultStyle.dp + Layout.rightMargin: Math.round(20 * DefaultStyle.dp) + Layout.preferredWidth: Math.round(393 * DefaultStyle.dp) + Layout.topMargin: Math.round(10 * DefaultStyle.dp) property int currentIndex: 0 visible: false function replace(id) { @@ -618,10 +618,10 @@ AbstractWindow { roundedBottom: true lastRowVisible: false visible: false - leftPadding: 40 * DefaultStyle.dp - rightPadding: 40 * DefaultStyle.dp - topPadding: 41 * DefaultStyle.dp - bottomPadding: 18 * DefaultStyle.dp + leftPadding: Math.round(40 * DefaultStyle.dp) + rightPadding: Math.round(40 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) Component.onCompleted: parent.height = height } } @@ -655,10 +655,10 @@ AbstractWindow { parent: numericPadContainer roundedBottom: true visible: newCallForm.searchBar.numericPadButton.checked - leftPadding: 40 * DefaultStyle.dp - rightPadding: 40 * DefaultStyle.dp - topPadding: 41 * DefaultStyle.dp - bottomPadding: 18 * DefaultStyle.dp + leftPadding: Math.round(40 * DefaultStyle.dp) + rightPadding: Math.round(40 * DefaultStyle.dp) + topPadding: Math.round(41 * DefaultStyle.dp) + bottomPadding: Math.round(18 * DefaultStyle.dp) onLaunchCall: { rightPanel.visible = false UtilsCpp.createCall(newCallForm.searchBar.text) @@ -680,10 +680,10 @@ AbstractWindow { event.accepted = true } SearchBar { - anchors.leftMargin: 10 * DefaultStyle.dp - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(10 * DefaultStyle.dp) + anchors.rightMargin: Math.round(10 * DefaultStyle.dp) anchors.bottom: numPad.top - anchors.bottomMargin: 41 * DefaultStyle.dp + anchors.bottomMargin: Math.round(41 * DefaultStyle.dp) magnifierVisible: false color: DefaultStyle.grey_0 borderColor: DefaultStyle.grey_200 @@ -698,7 +698,7 @@ AbstractWindow { anchors.bottom: parent.bottom currentCall: callsModel.currentCall lastRowVisible: false - anchors.bottomMargin: 18 * DefaultStyle.dp + anchors.bottomMargin: Math.round(18 * DefaultStyle.dp) onLaunchCall: { UtilsCpp.createCall(dialerTextInput.text) } @@ -741,10 +741,10 @@ AbstractWindow { id: popupbutton popup.contentItem: IconLabelButton { icon.source: AppIcons.arrowsMerge - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Merger tous les appels") - textSize: 14 * DefaultStyle.dp + textSize: Math.round(14 * DefaultStyle.dp) onClicked: { callsModel.lMergeAll() popupbutton.close() @@ -756,15 +756,15 @@ AbstractWindow { Layout.fillWidth: true Layout.maximumHeight: rightPanel.height visible: callList.contentHeight > 0 - leftPadding: 16 * DefaultStyle.dp - rightPadding: 6 * DefaultStyle.dp - topPadding: 15 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp + leftPadding: Math.round(16 * DefaultStyle.dp) + rightPadding: Math.round(6 * DefaultStyle.dp) + topPadding: Math.round(15 * DefaultStyle.dp) + bottomPadding: Math.round(16 * DefaultStyle.dp) - Layout.topMargin: 15 * DefaultStyle.dp - Layout.bottomMargin: 16 * DefaultStyle.dp - Layout.leftMargin: 16 * DefaultStyle.dp - Layout.rightMargin: 16 * DefaultStyle.dp + Layout.topMargin: Math.round(15 * DefaultStyle.dp) + Layout.bottomMargin: Math.round(16 * DefaultStyle.dp) + Layout.leftMargin: Math.round(16 * DefaultStyle.dp) + Layout.rightMargin: Math.round(16 * DefaultStyle.dp) contentItem: CallListView { id: callList @@ -789,10 +789,10 @@ AbstractWindow { id: inSettingsPanel call: mainWindow.call anchors.fill: parent - anchors.topMargin: 16 * DefaultStyle.dp - anchors.bottomMargin: 16 * DefaultStyle.dp - anchors.leftMargin: 17 * DefaultStyle.dp - anchors.rightMargin: 17 * DefaultStyle.dp + anchors.topMargin: Math.round(16 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) + anchors.leftMargin: Math.round(17 * DefaultStyle.dp) + anchors.rightMargin: Math.round(17 * DefaultStyle.dp) } } } @@ -807,10 +807,10 @@ AbstractWindow { } ScreencastSettings { anchors.fill: parent - anchors.topMargin: 16 * DefaultStyle.dp - anchors.bottomMargin: 16 * DefaultStyle.dp - anchors.leftMargin: 17 * DefaultStyle.dp - anchors.rightMargin: 17 * DefaultStyle.dp + anchors.topMargin: Math.round(16 * DefaultStyle.dp) + anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) + anchors.leftMargin: Math.round(17 * DefaultStyle.dp) + anchors.rightMargin: Math.round(17 * DefaultStyle.dp) call: mainWindow.call } } @@ -826,9 +826,9 @@ AbstractWindow { Control.StackView { id: participantsStack anchors.fill: parent - anchors.bottomMargin: 16 * DefaultStyle.dp - anchors.leftMargin: 17 * DefaultStyle.dp - anchors.rightMargin: 17 * DefaultStyle.dp + anchors.bottomMargin: Math.round(16 * DefaultStyle.dp) + anchors.leftMargin: Math.round(17 * DefaultStyle.dp) + anchors.rightMargin: Math.round(17 * DefaultStyle.dp) initialItem: participantListComp onCurrentItemChanged: rightPanel.headerStack.currentIndex = currentItem.Control.StackView.index @@ -1006,9 +1006,9 @@ AbstractWindow { sourceComponent: Item { CallLayout { anchors.fill: parent - anchors.leftMargin: 20 * DefaultStyle.dp - anchors.rightMargin: (rightPanel.visible ? 0 : 10) * DefaultStyle.dp // Grid and AS have 10 in right margin (so apply -10 here) - anchors.topMargin: 10 * DefaultStyle.dp + anchors.leftMargin: Math.round(20 * DefaultStyle.dp) + anchors.rightMargin: rightPanel.visible ? 0 : Math.round(10 * DefaultStyle.dp) // Grid and AS have 10 in right margin (so apply -10 here) + anchors.topMargin: Math.round(10 * DefaultStyle.dp) call: mainWindow.call callTerminatedByUser: mainWindow.callTerminatedByUser } @@ -1019,7 +1019,7 @@ AbstractWindow { RowLayout { id: bottomButtonsLayout Layout.alignment: Qt.AlignHCenter - spacing: 58 * DefaultStyle.dp + spacing: Math.round(58 * DefaultStyle.dp) visible: middleItemStackView.currentItem.objectName == "inCallItem" function refreshLayout() { @@ -1053,12 +1053,12 @@ AbstractWindow { } BigButton { Layout.row: 0 - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) ToolTip.text: qsTr("Terminer l'appel") - Layout.preferredWidth: 75 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - radius: 71 * DefaultStyle.dp + Layout.preferredWidth: Math.round(75 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + radius: Math.round(71 * DefaultStyle.dp) style: ButtonStyle.phoneRed Layout.column: mainWindow.callState == LinphoneEnums.CallState.OutgoingInit || mainWindow.callState @@ -1078,19 +1078,19 @@ AbstractWindow { visible: false Layout.row: 0 Layout.column: 1 - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) CheckableButton { id: pauseButton - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) ToolTip.text: checked ? qsTr( "Reprendre l'appel") : qsTr( "Mettre l'appel en pause") background: Rectangle { anchors.fill: parent - radius: 71 * DefaultStyle.dp + radius: Math.round(71 * DefaultStyle.dp) color: parent.enabled ? parent.checked ? DefaultStyle.success_500main : parent.pressed ? DefaultStyle.main2_400 : DefaultStyle.grey_500 : DefaultStyle.grey_600 } enabled: mainWindow.conference @@ -1112,10 +1112,10 @@ AbstractWindow { id: transferCallButton visible: !mainWindow.conference icon.source: AppIcons.transferCall - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) contentImageColor: DefaultStyle.grey_0 ToolTip.text: qsTr("Transférer l'appel") onCheckedChanged: { @@ -1139,10 +1139,10 @@ AbstractWindow { id: newCallButton checkable: true icon.source: AppIcons.newCall - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) ToolTip.text: qsTr("Initier un nouvel appel") onCheckedChanged: { console.log("checked newcall changed", checked) @@ -1163,12 +1163,12 @@ AbstractWindow { } CheckableButton { id: callListButton - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) checkable: true icon.source: AppIcons.callList - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) ToolTip.text: qsTr("Afficher la liste d'appels") onCheckedChanged: { if (checked) { @@ -1197,7 +1197,7 @@ AbstractWindow { || mainWindow.callState == LinphoneEnums.CallState.OutgoingEarlyMedia || mainWindow.callState == LinphoneEnums.CallState.IncomingReceived ? bottomButtonsLayout.columns - 1 : 0 - spacing: 10 * DefaultStyle.dp + spacing: Math.round(10 * DefaultStyle.dp) CheckableButton { id: videoCameraButton visible: SettingsCpp.videoEnabled @@ -1210,10 +1210,10 @@ AbstractWindow { ToolTip.text: mainWindow.localVideoEnabled ? qsTr("Désactiver la vidéo") : qsTr( "Activer la vidéo") checked: !mainWindow.localVideoEnabled - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onClicked: mainWindow.call.core.lSetLocalVideoEnabled( !mainWindow.call.core.localVideoEnabled) } @@ -1224,10 +1224,10 @@ AbstractWindow { checkedIconUrl: AppIcons.microphoneSlash checked: mainWindow.call && mainWindow.call.core.microphoneMuted - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onClicked: mainWindow.call.core.lSetMicrophoneMuted( !mainWindow.call.core.microphoneMuted) } @@ -1235,10 +1235,10 @@ AbstractWindow { iconUrl: AppIcons.screencast visible: !!mainWindow.conference ToolTip.text: qsTr("Partager l'écran...") - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onCheckedChanged: { if (checked) { rightPanel.visible = true @@ -1253,29 +1253,29 @@ AbstractWindow { checkable: false iconUrl: AppIcons.handWaving ToolTip.text: qsTr("Lever la main") - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) } CheckableButton { visible: false iconUrl: AppIcons.smiley ToolTip.text: qsTr("Envoyer une réaction") - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) } CheckableButton { id: participantListButton ToolTip.text: qsTr("Gérer les participants") visible: mainWindow.conference iconUrl: AppIcons.usersTwo - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) onCheckedChanged: { if (checked) { rightPanel.visible = true @@ -1293,15 +1293,15 @@ AbstractWindow { PopupButton { id: moreOptionsButton ToolTip.text: qsTr("Plus d'options...") - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - popup.topPadding: 20 * DefaultStyle.dp - popup.bottomPadding: 20 * DefaultStyle.dp - popup.leftPadding: 10 * DefaultStyle.dp - popup.rightPadding: 10 * DefaultStyle.dp + Layout.preferredWidth: Math.round(55 * DefaultStyle.dp) + Layout.preferredHeight: Math.round(55 * DefaultStyle.dp) + popup.topPadding: Math.round(20 * DefaultStyle.dp) + popup.bottomPadding: Math.round(20 * DefaultStyle.dp) + popup.leftPadding: Math.round(10 * DefaultStyle.dp) + popup.rightPadding: Math.round(10 * DefaultStyle.dp) style: ButtonStyle.checkable - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) Connections { target: moreOptionsButton.popup @@ -1312,14 +1312,14 @@ AbstractWindow { } popup.contentItem: ColumnLayout { id: optionsList - spacing: 5 * DefaultStyle.dp + spacing: Math.round(5 * DefaultStyle.dp) IconLabelButton { Layout.fillWidth: true visible: mainWindow.conference icon.source: AppIcons.squaresFour - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Modifier la disposition") style: ButtonStyle.noBackground onClicked: { @@ -1332,8 +1332,8 @@ AbstractWindow { Layout.fillWidth: true icon.source: AppIcons.fullscreen text: qsTr("Mode Plein écran") - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) checkable: true style: ButtonStyle.noBackground Binding on checked { @@ -1352,8 +1352,8 @@ AbstractWindow { Layout.fillWidth: true icon.source: AppIcons.dialer text: qsTr("Dialer") - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) style: ButtonStyle.noBackground onClicked: { rightPanel.visible = true @@ -1365,8 +1365,8 @@ AbstractWindow { Layout.fillWidth: true checkable: true style: ButtonStyle.noBackground - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) visible: mainWindow.call && !mainWindow.conference && !SettingsCpp.disableCallRecordings @@ -1396,8 +1396,8 @@ AbstractWindow { Layout.fillWidth: true checkable: true style: ButtonStyle.noBackground - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) icon.source: !mainWindow.call || mainWindow.call.core.speakerMuted ? AppIcons.speakerSlash : AppIcons.speaker contentImageColor: mainWindow.call @@ -1417,8 +1417,8 @@ AbstractWindow { IconLabelButton { Layout.fillWidth: true icon.source: AppIcons.settings - icon.width: 32 * DefaultStyle.dp - icon.height: 32 * DefaultStyle.dp + icon.width: Math.round(32 * DefaultStyle.dp) + icon.height: Math.round(32 * DefaultStyle.dp) text: qsTr("Paramètres") style: ButtonStyle.noBackground onClicked: { diff --git a/Linphone/view/Page/Window/Main/MainWindow.qml b/Linphone/view/Page/Window/Main/MainWindow.qml index 79059ad1..e72e339f 100644 --- a/Linphone/view/Page/Window/Main/MainWindow.qml +++ b/Linphone/view/Page/Window/Main/MainWindow.qml @@ -9,14 +9,14 @@ import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils AbstractWindow { id: mainWindow - // height: 982 * DefaultStyle.dp + // height: Math.round(982 * DefaultStyle.dp) title: qsTr("Linphone") // TODO : handle this bool when security mode is implemented property bool firstConnection: true color: DefaultStyle.grey_0 - minimumWidth: 1020 - minimumHeight: 700 + // minimumWidth: 1020 + // minimumHeight: 700 signal callCreated() property var accountProxy @@ -25,7 +25,7 @@ AbstractWindow { // flags: Qt.Window | Qt.FramelessWindowHint | Qt.WindowTitleHint // menuBar: Rectangle { // width: parent.width - // height: 40 * DefaultStyle.dp + // height: Math.round(40 * DefaultStyle.dp) // color: DefaultStyle.grey_100 // } @@ -131,10 +131,10 @@ AbstractWindow { Image { anchors.centerIn: parent source: AppIcons.splashscreenLogo - sourceSize.width: 395 * DefaultStyle.dp - sourceSize.height: 395 * DefaultStyle.dp - width: 395 * DefaultStyle.dp - height: 395 * DefaultStyle.dp + sourceSize.width: Math.round(395 * DefaultStyle.dp) + sourceSize.height: Math.round(395 * DefaultStyle.dp) + width: Math.round(395 * DefaultStyle.dp) + height: Math.round(395 * DefaultStyle.dp) } } } diff --git a/Linphone/view/Style/DefaultStyle.qml b/Linphone/view/Style/DefaultStyle.qml index f9adc31e..d21c269b 100644 --- a/Linphone/view/Style/DefaultStyle.qml +++ b/Linphone/view/Style/DefaultStyle.qml @@ -2,59 +2,64 @@ pragma Singleton import QtQuick QtObject { - property color main1_100: "#FFEACB" - property color main1_200: "#FFD098" - property color main1_300: "#FFB266" - property color main1_500_main: "#FE5E00" - property color main1_600: "#DA4400" - property color main1_700: "#B72D00" + property color main1_100: "#FFEACB" + property color main1_200: "#FFD098" + property color main1_300: "#FFB266" + property color main1_500_main: "#FE5E00" + property color main1_600: "#DA4400" + property color main1_700: "#B72D00" - property color main2_0: "#FAFEFF" - property color main2_100: "#EEF6F8" - property color main2_200: "#DFECF2" - property color main2_300: "#C0D1D9" - property color main2_400: "#9AABB5" - property color main2_500main: "#6C7A87" - property color main2_600: "#4E6074" - property color main2_700: "#364860" - property color main2_800: "#22334D" - property color main2_900: "#2D3648" + property color main2_0: "#FAFEFF" + property color main2_100: "#EEF6F8" + property color main2_200: "#DFECF2" + property color main2_300: "#C0D1D9" + property color main2_400: "#9AABB5" + property color main2_500main: "#6C7A87" + property color main2_600: "#4E6074" + property color main2_700: "#364860" + property color main2_800: "#22334D" + property color main2_900: "#2D3648" - property color grey_0: "#FFFFFF" - property color grey_100: "#F9F9F9" - property color grey_200: "#EDEDED" - property color grey_300: "#C9C9C9" - property color grey_400: "#949494" - property color grey_500: "#4E4E4E" - property color grey_600: "#2E3030" - property color grey_850: "#D9D9D9" - property color grey_900: "#070707" - property color grey_1000: "#000000" + property color grey_0: "#FFFFFF" + property color grey_100: "#F9F9F9" + property color grey_200: "#EDEDED" + property color grey_300: "#C9C9C9" + property color grey_400: "#949494" + property color grey_500: "#4E4E4E" + property color grey_600: "#2E3030" + property color grey_850: "#D9D9D9" + property color grey_900: "#070707" + property color grey_1000: "#000000" - property color warning_600: "#DBB820" - property color danger_500main: "#DD5F5F" - property color danger_700: "#9E3548" - property color danger_900: "#723333" - property color success_500main: "#4FAE80" - property color success_700: "#377d71" - property color success_900: "#1E4C53" - property color info_500_main: "#4AA8FF" + property color warning_600: "#DBB820" + property color danger_500main: "#DD5F5F" + property color danger_700: "#9E3548" + property color danger_900: "#723333" + property color success_500main: "#4FAE80" + property color success_700: "#377d71" + property color success_900: "#1E4C53" + property color info_500_main: "#4AA8FF" - property color vue_meter_light_green: "#6FF88D" - property color vue_meter_dark_green: "#00D916" + property color vue_meter_light_green: "#6FF88D" + property color vue_meter_dark_green: "#00D916" - - property double dp: 1 - - // Warning: Qt 6.8.1 (current version) and previous versions, Qt only support COLRv0 fonts. Don't try to use v1. - property string emojiFont: "OpenMoji Color" - property string flagFont: "OpenMoji Color" - property string defaultFont: "Noto Sans" + property real defaultHeight: 1080.0 + property real defaultWidth: 1920.0 + property double dp: (Screen.width/Screen.height)/(defaultWidth/defaultHeight) - property color numericPadPressedButtonColor: "#EEF7F8" + onDpChanged: { + console.log("Screen ratio changed", dp) + } - property color groupCallButtonColor: "#EEF7F8" + // Warning: Qt 6.8.1 (current version) and previous versions, Qt only support COLRv0 fonts. Don't try to use v1. + property string emojiFont: "OpenMoji Color" + property string flagFont: "OpenMoji Color" + property string defaultFont: "Noto Sans" - property color placeholders: '#CACACA' // No name in design + property color numericPadPressedButtonColor: "#EEF7F8" + + property color groupCallButtonColor: "#EEF7F8" + + property color placeholders: '#CACACA' // No name in design } diff --git a/Linphone/view/Style/Typography.qml b/Linphone/view/Style/Typography.qml index 00688de1..bd837573 100644 --- a/Linphone/view/Style/Typography.qml +++ b/Linphone/view/Style/Typography.qml @@ -6,78 +6,78 @@ QtObject { // Title/H4 - Bloc title property font h4: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 16 * DefaultStyle.dp, - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(16 * DefaultStyle.dp), + weight: Math.min(Math.round(800 * DefaultStyle.dp), 1000) }) // Title/H3 - Bloc title property font h3: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 22 * DefaultStyle.dp, - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(22 * DefaultStyle.dp), + weight: Math.min(Math.round(800 * DefaultStyle.dp), 1000) }) // Title/H2 - Large bloc title property font h2: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 29 * DefaultStyle.dp, - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(29 * DefaultStyle.dp), + weight: Math.min(Math.round(800 * DefaultStyle.dp), 1000) }) // Title/H1 - Large bloc title property font h1: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 36 * DefaultStyle.dp, - weight: 800 * DefaultStyle.dp + pixelSize: Math.round(36 * DefaultStyle.dp), + weight: Math.min(Math.round(800 * DefaultStyle.dp), 1000) }) // Text/P2 - Bold, reduced paragraph text property font p2: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 13 * DefaultStyle.dp, - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(13 * DefaultStyle.dp), + weight: Math.min(Math.round(700 * DefaultStyle.dp), 1000) }) // Text/P2 - Large Bold, reduced paragraph text property font p2l: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 14 * DefaultStyle.dp, - weight: 700 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp), + weight: Math.min(Math.round(700 * DefaultStyle.dp), 1000) }) // Text/P1 - Paragraph text property font p1: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 14 * DefaultStyle.dp, - weight: 400 * DefaultStyle.dp + pixelSize: Math.round(14 * DefaultStyle.dp), + weight: Math.min(Math.round(400 * DefaultStyle.dp), 1000) }) // Text/P1 - Paragraph text property font p1s: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 13 * DefaultStyle.dp, - weight: 400 * DefaultStyle.dp + pixelSize: Math.round(13 * DefaultStyle.dp), + weight: Math.min(Math.round(400 * DefaultStyle.dp), 1000) }) // Button/B1 - Big Button property font b1: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 18 * DefaultStyle.dp, - weight: 600 * DefaultStyle.dp + pixelSize: Math.round(18 * DefaultStyle.dp), + weight: Math.min(Math.round(600 * DefaultStyle.dp), 1000) }) // Button/B2 - Medium Button property font b2: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 15 * DefaultStyle.dp, - weight: 600 * DefaultStyle.dp + pixelSize: Math.round(15 * DefaultStyle.dp), + weight: Math.min(Math.round(600 * DefaultStyle.dp), 1000) }) // Button/B3 - Small Button property font b3: Qt.font( { family: DefaultStyle.defaultFont, - pixelSize: 13 * DefaultStyle.dp, - weight: 600 * DefaultStyle.dp + pixelSize: Math.round(13 * DefaultStyle.dp), + weight: Math.min(Math.round(600 * DefaultStyle.dp), 1000) }) }