screen ratio in function

This commit is contained in:
Gaelle Braud 2025-10-21 16:40:27 +02:00
parent 11c586792d
commit 55a54dc10e
137 changed files with 2064 additions and 1968 deletions

View file

@ -3,15 +3,16 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
textSize: Typography.b1.pixelSize
textWeight: Typography.b1.weight
leftPadding: Math.round(20 * DefaultStyle.dp)
rightPadding: Math.round(20 * DefaultStyle.dp)
topPadding: Math.round(11 * DefaultStyle.dp)
bottomPadding: Math.round(11 * DefaultStyle.dp)
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(20)
rightPadding: Utils.getSizeWithScreenRatio(20)
topPadding: Utils.getSizeWithScreenRatio(11)
bottomPadding: Utils.getSizeWithScreenRatio(11)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
}

View file

@ -4,6 +4,7 @@ import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ComboBox {
id: mainItem
@ -15,24 +16,24 @@ ComboBox {
id: contentText
text: UtilsCpp.formatDate(calendar.selectedDate, false, true, "ddd d, MMMM")
anchors.fill: parent
anchors.leftMargin: Math.round(15 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(15)
anchors.verticalCenter: parent.verticalCenter
verticalAlignment: Text.AlignVCenter
font {
pixelSize: Math.round(14 * DefaultStyle.dp)
weight: Math.min(Math.round(700 * DefaultStyle.dp), 1000)
pixelSize: Utils.getSizeWithScreenRatio(14)
weight: Math.min(Utils.getSizeWithScreenRatio(700), 1000)
}
}
popup: Control.Popup {
id: popupItem
y: mainItem.height
width: Math.round(321 * DefaultStyle.dp)
height: Math.round(270 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(321)
height: Utils.getSizeWithScreenRatio(270)
closePolicy: Popup.NoAutoClose
topPadding: Math.round(25 * DefaultStyle.dp)
bottomPadding: Math.round(24 * DefaultStyle.dp)
leftPadding: Math.round(21 * DefaultStyle.dp)
rightPadding: Math.round(19 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(25)
bottomPadding: Utils.getSizeWithScreenRatio(24)
leftPadding: Utils.getSizeWithScreenRatio(21)
rightPadding: Utils.getSizeWithScreenRatio(19)
onOpened: calendar.forceActiveFocus()
background: Item {
anchors.fill: parent
@ -40,7 +41,7 @@ ComboBox {
id: calendarBg
anchors.fill: parent
color: DefaultStyle.grey_0
radius: Math.round(16 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(16)
border.color: DefaultStyle.main1_500_main
border.width: calendar.activeFocus? 1 : 0
}

View file

@ -2,21 +2,22 @@ import QtQuick
import QtQuick.Controls.Basic as Control
import Linphone
import QtQuick.Effects
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.CheckBox {
id: mainItem
hoverEnabled: enabled
indicator: Item{
implicitWidth: Math.round(20 * DefaultStyle.dp)
implicitHeight: Math.round(20 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(20)
implicitHeight: Utils.getSizeWithScreenRatio(20)
x: (parent.width - width) / 2
y: (parent.height - height) / 2
Rectangle {
id: backgroundArea
anchors.fill: parent
radius: Math.round(3 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(3)
border.color: mainItem.hovered || mainItem.activeFocus ? DefaultStyle.main1_600 : DefaultStyle.main1_500_main
border.width: Math.round(2 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(2)
color: mainItem.checked ? DefaultStyle.main1_500_main : "transparent"
EffectImage {
visible: mainItem.checked

View file

@ -149,7 +149,7 @@ Control.ComboBox {
y: mainItem.height - 1
width: mainItem.width
implicitHeight: Math.min(contentItem.implicitHeight, mainWindow.height)
padding: Math.max(Math.round(1 * DefaultStyle.dp), 1)
padding: Utils.getSizeWithScreenRatio(1)
onOpened: {
listView.positionViewAtIndex(listView.currentIndex, ListView.Center);
@ -168,7 +168,7 @@ Control.ComboBox {
highlight: Rectangle {
width: listView.width
color: DefaultStyle.main2_200
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
y: listView.currentItem ? listView.currentItem.y : 0
}
@ -190,10 +190,10 @@ Control.ComboBox {
anchors.fill: parent
EffectImage {
id: delegateImg
Layout.preferredWidth: visible ? Math.round(20 * DefaultStyle.dp) : 0
Layout.leftMargin: Math.round(10 * DefaultStyle.dp)
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(20) : 0
Layout.leftMargin: Utils.getSizeWithScreenRatio(10)
visible: imageSource != ""
imageWidth: Math.round(20 * DefaultStyle.dp)
imageWidth: Utils.getSizeWithScreenRatio(20)
imageSource: typeof (modelData) != "undefined" && modelData.img ? modelData.img : ""
fillMode: Image.PreserveAspectFit
}
@ -201,7 +201,7 @@ Control.ComboBox {
Text {
id: flagItem
Layout.preferredWidth: implicitWidth
Layout.leftMargin: delegateImg.visible ? 0 : Math.round(5 * DefaultStyle.dp)
Layout.leftMargin: delegateImg.visible ? 0 : Utils.getSizeWithScreenRatio(5)
Layout.alignment: Qt.AlignCenter
visible: mainItem.flagRole
font {
@ -213,8 +213,8 @@ Control.ComboBox {
}
Text {
Layout.fillWidth: true
Layout.leftMargin: delegateImg.visible ? 0 : flagItem.visble ? Utils.getSizeWithScreenRatio(5) : Utils.getSizeWithScreenRatio(25)
Layout.rightMargin: Math.round(20 * DefaultStyle.dp)
Layout.leftMargin: delegateImg.visible ? 0 : Utils.getSizeWithScreenRatio(flagItem.visble ? 5 : 25)
Layout.rightMargin: Utils.getSizeWithScreenRatio(20)
Layout.alignment: Qt.AlignCenter
text: typeof (modelData) != "undefined" ? mainItem.textRole ? modelData[mainItem.textRole] : modelData.text ? modelData.text : modelData : $modelData ? mainItem.textRole ? $modelData[mainItem.textRole] : $modelData : ""
elide: Text.ElideRight

View file

@ -3,7 +3,8 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.ComboBox {
id: mainItem
property string defaultCallingCode: ""
@ -16,7 +17,7 @@ Control.ComboBox {
}
background: Rectangle {
anchors.fill: parent
radius: Math.round(63 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(63)
color: mainItem.enableBackgroundColor ? DefaultStyle.grey_100 : "transparent"
border.color: mainItem.enableBackgroundColors
? (mainItem.errorMessage.length > 0
@ -28,11 +29,11 @@ Control.ComboBox {
}
contentItem: RowLayout {
readonly property var currentItem: combobox.model.getAt(combobox.currentIndex)
spacing: 0// Math.round(5 * DefaultStyle.dp)
spacing: 0
Text {
id: selectedItemFlag
visible: text.length > 0
font.pixelSize: Math.round(21 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(21)
text: parent.currentItem ? parent.currentItem.flag : ""
font.family: DefaultStyle.flagFont
}
@ -41,7 +42,7 @@ Control.ComboBox {
// visible: false
// layer.enabled: true
// anchors.centerIn: selectedItemFlag
// radius: Math.round(600 * DefaultStyle.dp)
// radius: Utils.getSizeWithScreenRatio(600)
// width: selectedItemFlag.width/2
// height: selectedItemFlag.height/2
// }
@ -68,11 +69,11 @@ Control.ComboBox {
id: indicImage
z: 1
anchors.right: parent.right
anchors.rightMargin: Math.round(15 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(15)
anchors.verticalCenter: parent.verticalCenter
imageSource: AppIcons.downArrow
width: Math.round(15 * DefaultStyle.dp)
height: Math.round(15 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(15)
height: Utils.getSizeWithScreenRatio(15)
fillMode: Image.PreserveAspectFit
colorizationColor: mainItem.indicatorColor
}
@ -80,8 +81,8 @@ Control.ComboBox {
popup: Control.Popup {
id: listPopup
y: combobox.height - 1
width: Math.round(311 * DefaultStyle.dp)
height: Math.round(250 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(311)
height: Utils.getSizeWithScreenRatio(250)
contentItem: ListView {
id: listView
@ -92,14 +93,14 @@ Control.ComboBox {
keyNavigationEnabled: true
keyNavigationWraps: true
maximumFlickVelocity: 1500
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
highlight: Rectangle {
anchors.left: parent.left
anchors.right: parent.right
width: listView.width
height: listView.height
color: DefaultStyle.main2_300
// radius: Math.round(15 * DefaultStyle.dp)
// radius: Utils.getSizeWithScreenRatio(15)
}
delegate: Item {
@ -108,15 +109,15 @@ Control.ComboBox {
RowLayout {
id: contentLayout
anchors.fill: parent
anchors.leftMargin: Math.round(20 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(20)
spacing: Utils.getSizeWithScreenRatio(5)
Text {
id: delegateImg
visible: text.length > 0
text: $modelData.flag
font {
pixelSize: Math.round(28 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(28)
family: DefaultStyle.flagFont
}
}
@ -134,7 +135,7 @@ Control.ComboBox {
Rectangle {
id: separator
width: Math.max(Math.round(1 * DefaultStyle.dp), 1)
width: Utils.getSizeWithScreenRatio(1)
height: combobox.height / 2
color: DefaultStyle.main2_500_main
}
@ -158,7 +159,7 @@ Control.ComboBox {
Rectangle {
anchors.fill: parent
opacity: 0.1
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
color: DefaultStyle.main2_500_main
visible: parent.containsMouse
}
@ -180,7 +181,7 @@ Control.ComboBox {
Rectangle {
id: popupBg
anchors.fill: parent
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
color: DefaultStyle.grey_100
}
MultiEffect {

View file

@ -2,13 +2,14 @@ import QtQuick
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
MouseArea {
id: mainItem
property string iconSource
property string title
property string subTitle
property real iconSize: (32 * DefaultStyle.dp)
property real iconSize: Utils.getSizeWithScreenRatio(32)
property bool shadowEnabled: containsMouse || activeFocus
hoverEnabled: true
width: content.implicitWidth
@ -36,7 +37,7 @@ MouseArea {
ColumnLayout {
width: implicitWidth
height: implicitHeight
Layout.leftMargin: (16 * DefaultStyle.dp)
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
Text {
Layout.fillWidth: true
text: mainItem.title

View file

@ -3,14 +3,15 @@ import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
textSize: Typography.p1.pixelSize
textWeight: Typography.p1.weight
radius: Math.round(5 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(5)
shadowEnabled: mainItem.activeFocus || hovered
style: ButtonStyle.hoveredBackground

View file

@ -3,20 +3,21 @@ import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
textSize: Typography.p1.pixelSize
textWeight: Typography.p1.weight
radius: Math.round(5 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(5)
shadowEnabled: mainItem.activeFocus || hovered
style: ButtonStyle.hoveredBackground
property bool inverseLayout: false
contentItem: RowLayout {
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
layoutDirection: mainItem.inverseLayout ? Qt.RightToLeft: Qt.LeftToRight
EffectImage {
imageSource: mainItem.icon.source

View file

@ -4,6 +4,7 @@ import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: labelButton
@ -11,18 +12,18 @@ ColumnLayout {
property alias button: button
property alias text: text
property string label
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
Button {
id: button
Layout.alignment: Qt.AlignHCenter
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(56)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(56)
topPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
contentImageColor: DefaultStyle.main2_600
radius: Math.round(40 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(40)
style: ButtonStyle.grey
Accessible.name: labelButton.label
}

View file

@ -3,15 +3,16 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
textSize: Typography.b2.pixelSize
textWeight: Typography.b2.weight
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)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
topPadding: Utils.getSizeWithScreenRatio(10)
bottomPadding: Utils.getSizeWithScreenRatio(10)
icon.width: Utils.getSizeWithScreenRatio(16)
icon.height: Utils.getSizeWithScreenRatio(16)
}

View file

@ -3,7 +3,8 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.RadioButton {
id: mainItem
property string title
@ -11,7 +12,7 @@ Control.RadioButton {
property string imgUrl
property bool checkOnClick: true
property color color
property real indicatorSize: Math.round(16 * DefaultStyle.dp)
property real indicatorSize: Utils.getSizeWithScreenRatio(16)
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
//onClicked: if (checkOnClick && !mainItem.checked) mainItem.toggle()
@ -23,7 +24,7 @@ Control.RadioButton {
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
}
indicator: Item{
indicator: Item {
implicitWidth: mainItem.indicatorSize
implicitHeight: mainItem.indicatorSize
anchors.verticalCenter: mainItem.verticalCenter
@ -33,7 +34,7 @@ Control.RadioButton {
radius: mainItem.indicatorSize/2
color: "transparent"
border.color: mainItem.color
border.width: Math.round(2 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(2)
Rectangle {
width: parent.width/2
height: parent.height/2

View file

@ -3,15 +3,16 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
textSize: Typography.p1s.pixelSize
textWeight: Typography.p1s.weight
padding: Math.round(16 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(16)
// icon.width: width
// icon.height: width
radius: width * 2
// width: Math.round(24 * DefaultStyle.dp)
// width: Utils.getSizeWithScreenRatio(24)
height: width
}

View file

@ -2,7 +2,8 @@ import QtQuick
import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.RadioButton {
id: mainItem
property string title
@ -21,18 +22,18 @@ Control.RadioButton {
background: Rectangle {
color: DefaultStyle.grey_100
border.color: mainItem.checked ? mainItem.color : "transparent"
radius: Math.round(20 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(20)
}
indicator: RowLayout {
anchors.left: parent.left
anchors.leftMargin: Math.round(13 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(13)
anchors.top: parent.top
anchors.topMargin: Math.round(8 * DefaultStyle.dp)
spacing: Math.round(4 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(8)
spacing: Utils.getSizeWithScreenRatio(4)
Rectangle {
implicitWidth: Math.round(16 * DefaultStyle.dp)
implicitHeight: Math.round(16 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(16)
implicitHeight: Utils.getSizeWithScreenRatio(16)
radius: implicitWidth/2
border.color: mainItem.color
@ -51,7 +52,7 @@ Control.RadioButton {
text: mainItem.title
font.bold: true
color: DefaultStyle.grey_900
font.pixelSize: Math.round(16 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(16)
}
Button {
padding: 0
@ -59,12 +60,12 @@ Control.RadioButton {
visible: false
}
icon.source: AppIcons.info
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(2)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(2)
width: Utils.getSizeWithScreenRatio(2)
height: Utils.getSizeWithScreenRatio(2)
icon.width: Utils.getSizeWithScreenRatio(2)
icon.height: Utils.getSizeWithScreenRatio(2)
}
}
@ -73,27 +74,27 @@ Control.RadioButton {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: Math.round(13 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(13)
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.bottomMargin: Math.round(10 * DefaultStyle.dp)
Layout.rightMargin: Math.round(10 * DefaultStyle.dp)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(10)
Layout.rightMargin: Utils.getSizeWithScreenRatio(10)
Layout.alignment: Qt.AlignVCenter
Text {
id: innerText
verticalAlignment: Text.AlignVCenter
Layout.preferredWidth: Math.round(220 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(100 * DefaultStyle.dp)
font.pixelSize: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(220)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(100)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
text: mainItem.contentText
Layout.fillHeight: true
}
Image {
id: image
Layout.fillHeight: true
Layout.preferredWidth: Math.round(100 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(100 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(100)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(100)
fillMode: Image.PreserveAspectFit
source: mainItem.imgUrl
}

View file

@ -12,7 +12,7 @@ RowLayout {
property var propertyOwner
property var propertyOwnerGui
property bool enabled: true
spacing : Math.round(20 * DefaultStyle.dp)
spacing : Utils.getSizeWithScreenRatio(20)
signal checkedChanged(bool checked)
function setChecked(value) {
@ -20,8 +20,8 @@ RowLayout {
}
ColumnLayout {
Layout.minimumHeight: Math.round(32 * DefaultStyle.dp)
spacing: Math.round(4 * DefaultStyle.dp)
Layout.minimumHeight: Utils.getSizeWithScreenRatio(32)
spacing: Utils.getSizeWithScreenRatio(4)
Text {
text: titleText
font: Typography.p2l

View file

@ -3,15 +3,16 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Button {
id: mainItem
textSize: Typography.b3.pixelSize
textWeight: Typography.b3.weight
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)
leftPadding: Utils.getSizeWithScreenRatio(12)
rightPadding: Utils.getSizeWithScreenRatio(12)
topPadding: Utils.getSizeWithScreenRatio(6)
bottomPadding: Utils.getSizeWithScreenRatio(6)
icon.height: Utils.getSizeWithScreenRatio(14)
icon.width: Utils.getSizeWithScreenRatio(14)
}

View file

@ -7,6 +7,8 @@ import Linphone
import EnumsToStringCpp
import UtilsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
Item {
@ -33,8 +35,8 @@ Item {
RowLayout{
anchors.fill: parent
anchors.rightMargin: Math.round(10 * DefaultStyle.dp)
spacing: Math.round(16 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(10)
spacing: Utils.getSizeWithScreenRatio(16)
Sticker {
id: activeSpeakerSticker
Layout.fillWidth: true
@ -58,23 +60,23 @@ Item {
ListView{
id: sideStickers
Layout.fillHeight: true
Layout.preferredWidth: Math.round(300 * DefaultStyle.dp)
Layout.rightMargin: Math.round(10 * DefaultStyle.dp)
Layout.bottomMargin: Math.round(10 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(300)
Layout.rightMargin: Utils.getSizeWithScreenRatio(10)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(10)
visible: allDevices.count > 2 || !!mainItem.conference?.core.isScreenSharingEnabled
//spacing: Math.round(15 * DefaultStyle.dp) // bugged? First item has twice margins
//spacing: Utils.getSizeWithScreenRatio(15) // 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 ? Math.round((180 + 15) * DefaultStyle.dp) : 0
width: Math.round(300 * DefaultStyle.dp)
height: visible ? Utils.getSizeWithScreenRatio(180 + 15) : 0
width: Utils.getSizeWithScreenRatio(300)
Sticker {
previewEnabled: index == 0 // before anchors for priority initialization
anchors.fill: parent
anchors.bottomMargin: Math.round(15 * DefaultStyle.dp)// Spacing
anchors.bottomMargin: Utils.getSizeWithScreenRatio(15)// Spacing
qmlName: 'S_'+index
visible: parent.visible
participantDevice: $modelData

View file

@ -4,6 +4,7 @@ import QtQml.Models
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
@ -32,8 +33,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 - Math.round(10 * DefaultStyle.dp)
width: grid.cellWidth - Math.round(10 * DefaultStyle.dp)
height: grid.cellHeight - Utils.getSizeWithScreenRatio(10)
width: grid.cellWidth - Utils.getSizeWithScreenRatio(10)
Sticker {
id: cameraView
previewEnabled: index == 0

View file

@ -6,10 +6,11 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
spacing: Math.round(30 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(30)
property var callHistoryGui
@ -33,16 +34,16 @@ ColumnLayout {
property alias detailContent: detailControl.data
ColumnLayout {
spacing: Math.round(13 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(13)
Item {
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
Layout.preferredHeight: detailAvatar.height
Layout.alignment: Qt.AlignHCenter
Avatar {
id: detailAvatar
anchors.horizontalCenter: parent.horizontalCenter
width: Math.round(100 * DefaultStyle.dp)
height: Math.round(100 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(100)
height: Utils.getSizeWithScreenRatio(100)
contact: mainItem.contact || null
isConference: !!mainItem.conferenceInfo
displayNameVal: mainItem.contactName
@ -52,18 +53,18 @@ ColumnLayout {
id: rightButton
anchors.right: parent.right
anchors.verticalCenter: detailAvatar.verticalCenter
anchors.rightMargin: Math.round(20 * DefaultStyle.dp)
width: Math.round(30 * DefaultStyle.dp)
height: Math.round(30 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(20)
width: Utils.getSizeWithScreenRatio(30)
height: Utils.getSizeWithScreenRatio(30)
}
}
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
spacing: Utils.getSizeWithScreenRatio(5)
ColumnLayout {
spacing: Math.round(2 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(2)
Text {
Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignHCenter
@ -85,8 +86,8 @@ ColumnLayout {
elide: Text.ElideMiddle
maximumLineCount: 1
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}
@ -98,8 +99,8 @@ ColumnLayout {
text: contact ? contact.core.presenceStatus : ""
color: contact ? contact.core.presenceColor : 'transparent'
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}
@ -120,15 +121,15 @@ ColumnLayout {
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
spacing: Math.round(72 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(72)
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
visible: !mainItem.isConference
LabelButton {
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)
width: Utils.getSizeWithScreenRatio(56)
height: Utils.getSizeWithScreenRatio(56)
button.icon.width: Utils.getSizeWithScreenRatio(24)
button.icon.height: Utils.getSizeWithScreenRatio(24)
button.icon.source: AppIcons.phone
//: "Appel"
label: qsTr("contact_call_action")
@ -139,10 +140,10 @@ ColumnLayout {
}
LabelButton {
visible: !SettingsCpp.disableChatFeature
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)
width: Utils.getSizeWithScreenRatio(56)
height: Utils.getSizeWithScreenRatio(56)
button.icon.width: Utils.getSizeWithScreenRatio(24)
button.icon.height: Utils.getSizeWithScreenRatio(24)
button.icon.source: AppIcons.chatTeardropText
//: "Message"
label: qsTr("contact_message_action")
@ -159,10 +160,10 @@ ColumnLayout {
}
LabelButton {
visible: SettingsCpp.videoEnabled
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)
width: Utils.getSizeWithScreenRatio(56)
height: Utils.getSizeWithScreenRatio(56)
button.icon.width: Utils.getSizeWithScreenRatio(24)
button.icon.height: Utils.getSizeWithScreenRatio(24)
button.icon.source: AppIcons.videoCamera
//: "Appel Video"
label: qsTr("contact_video_call_action")
@ -178,6 +179,6 @@ ColumnLayout {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: Math.round(30 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(30)
}
}

View file

@ -7,6 +7,8 @@ import Linphone
import EnumsToStringCpp 1.0
import UtilsCpp 1.0
import SettingsCpp 1.0
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
Item {
@ -67,7 +69,7 @@ Item {
id: callTerminatedText
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Math.round(25 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(25)
z: 1
visible: mainItem.callState === LinphoneEnums.CallState.End || mainItem.callState === LinphoneEnums.CallState.Error || mainItem.callState === LinphoneEnums.CallState.Released
text: mainItem.conference
@ -82,8 +84,8 @@ Item {
: call && call.core.lastErrorMessage || ""
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(22 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(22)
weight: Utils.getSizeWithScreenRatio(300)
}
}
@ -105,12 +107,12 @@ Item {
&& mainItem.callState !== LinphoneEnums.CallState.OutgoingInit
&& !mainItem.conference?.core.isScreenSharingEnabled
&& mainItem.participantDeviceCount <= 2
height: Math.round(180 * DefaultStyle.dp)
width: Math.round(300 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(180)
width: Utils.getSizeWithScreenRatio(300)
anchors.right: mainItem.right
anchors.bottom: mainItem.bottom
anchors.rightMargin: Math.round(20 * DefaultStyle.dp)
anchors.bottomMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(20)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(10)
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled
onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call)
property var accountObj: UtilsCpp.findLocalAccountByAddress(mainItem.localAddress)
@ -123,7 +125,7 @@ Item {
id: previewMouseArea
anchors.fill: parent
movableArea: mainItem
margin: Math.round(10 * DefaultStyle.dp)
margin: Utils.getSizeWithScreenRatio(10)
function resetPosition(){
preview.anchors.right = mainItem.right
preview.anchors.bottom = mainItem.bottom
@ -146,22 +148,22 @@ Item {
id: waitingForOthersComponent
Rectangle {
color: DefaultStyle.grey_600
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
ColumnLayout {
anchors.centerIn: parent
spacing: Math.round(22 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(22)
width: waitText.implicitWidth
Text {
id: waitText
//: "En attente d'autres participants"
text: qsTr("conference_call_empty")
Layout.preferredHeight: Math.round(67 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(67)
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(30 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(30)
weight: Utils.getSizeWithScreenRatio(300)
}
}
Item {

View file

@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Layouts
import QtQml.Models
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
ColumnLayout {
@ -56,7 +57,7 @@ ColumnLayout {
GridView{
id: grid
property real margin: Math.round(10 * DefaultStyle.dp)
property real margin: Utils.getSizeWithScreenRatio(10)
property int itemCount: model.count ? model.count :( model.length ? model.length : 0)
property int columns: 1
property int rows: 1

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls.Basic as Control
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
@ -12,7 +13,7 @@ ColumnLayout {
required property int itemsCount
property int currentIndex: carouselStackLayout.currentIndex
property var currentItem: carouselButton.itemAt(currentIndex)
spacing: Math.round(61 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(61)
function goToSlide(index) {
carouselStackLayout.goToSlideAtIndex(index)
@ -67,9 +68,9 @@ ColumnLayout {
Item {
Rectangle {
id: currentIndicator
width: Math.round(13 * DefaultStyle.dp)
height: Math.round(8 * DefaultStyle.dp)
radius: Math.round(30 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(13)
height: Utils.getSizeWithScreenRatio(8)
radius: Utils.getSizeWithScreenRatio(30)
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 +78,21 @@ ColumnLayout {
}
RowLayout {
id: carouselButtonsLayout
spacing: Math.round(7.5 * DefaultStyle.dp)
anchors.leftMargin: Math.round(2.5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(7.5)
anchors.leftMargin: Utils.getSizeWithScreenRatio(2.5)
Repeater {
id: carouselButton
model: mainItem.itemsCount
delegate: Button {
Layout.preferredWidth: Math.round(8 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(8 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(8)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(8)
topPadding: 0
bottomPadding: 0
leftPadding: 0
rightPadding: 0
background: Rectangle {
color: DefaultStyle.main2_200
radius: Math.round(30 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(30)
anchors.fill: parent
}
onClicked: {

View file

@ -5,6 +5,7 @@ import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
GridLayout {
@ -12,10 +13,10 @@ GridLayout {
property ChatMessageContentProxy proxyModel
property bool isHoveringFile: false
property int itemCount: delModel.count
property int itemWidth: Math.round(95 * DefaultStyle.dp)
property int itemWidth: Utils.getSizeWithScreenRatio(95)
// cellWidth:
// cellHeight: Math.round(105 * DefaultStyle.dp)
property real maxWidth: 3 * 105 * DefaultStyle.dp
// cellHeight: Utils.getSizeWithScreenRatio(105)
property real maxWidth: Utils.getSizeWithScreenRatio(3 * 105)
columns: optimalColumns

View file

@ -6,10 +6,11 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
spacing: Math.round(30 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(30)
property FriendGui contact
@ -17,34 +18,34 @@ ColumnLayout {
property alias content: detailLayout.data
property alias bannerContent: bannerLayout.data
property alias secondLineContent: verticalLayoutSecondLine.data
property real minimumWidthForSwitchintToRowLayout: Math.round(756 * DefaultStyle.dp)
property real minimumWidthForSwitchintToRowLayout: Utils.getSizeWithScreenRatio(756)
property var useVerticalLayout: width < minimumWidthForSwitchintToRowLayout
GridLayout {
Layout.leftMargin: Math.round(64 * DefaultStyle.dp)
Layout.rightMargin: Math.round(64 * DefaultStyle.dp)
Layout.topMargin: Math.round(56 * DefaultStyle.dp)
Layout.leftMargin: Utils.getSizeWithScreenRatio(64)
Layout.rightMargin: Utils.getSizeWithScreenRatio(64)
Layout.topMargin: Utils.getSizeWithScreenRatio(56)
Layout.fillWidth: true
columns: mainItem.useVerticalLayout ? 1 : children.length
rows: 1
columnSpacing: Math.round(49 * DefaultStyle.dp)
rowSpacing: Math.round(27 * DefaultStyle.dp)
columnSpacing: Utils.getSizeWithScreenRatio(49)
rowSpacing: Utils.getSizeWithScreenRatio(27)
ColumnLayout {
spacing: Math.round(16 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(341 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(341)
RowLayout {
Layout.preferredWidth: Math.round(341 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(341)
Control.Control {
// Layout.preferredWidth: Math.round(734 * DefaultStyle.dp)
// Layout.preferredWidth: Utils.getSizeWithScreenRatio(734)
Layout.fillWidth: true
width: Math.round(734 * DefaultStyle.dp)
height: Math.round(100 * DefaultStyle.dp)
rightPadding: Math.round(21 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(734)
height: Utils.getSizeWithScreenRatio(100)
rightPadding: Utils.getSizeWithScreenRatio(21)
background: GradientRectangle {
anchors.fill: parent
anchors.leftMargin: avatar.width / 2
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
borderGradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: DefaultStyle.grey_100 }
@ -58,12 +59,12 @@ ColumnLayout {
}
contentItem: RowLayout {
id: bannerLayout
spacing: Math.round(32 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(32)
Avatar {
id: avatar
contact: mainItem.contact
Layout.preferredWidth: Math.round(100 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(100 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(100)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(100)
}
}
}
@ -71,8 +72,8 @@ ColumnLayout {
PresenceNoteLayout {
visible: contact?.core.presenceNote.length > 0 && mainItem.useVerticalLayout
friendCore: contact?.core || null
Layout.preferredWidth: 412 * DefaultStyle.dp
Layout.preferredHeight: 85 * DefaultStyle.dp
Layout.preferredWidth: Utils.getSizeWithScreenRatio(412)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(85)
}
}
Item {
@ -90,23 +91,23 @@ ColumnLayout {
}
Rectangle {
Layout.fillWidth:true
Layout.preferredHeight: 79 * DefaultStyle.dp
Layout.preferredHeight: Utils.getSizeWithScreenRatio(79)
color: 'transparent'
visible: contact && contact.core.presenceNote.length > 0 && !mainItem.useVerticalLayout
PresenceNoteLayout {
anchors.centerIn: parent
friendCore: contact?.core || null
width: 412 * DefaultStyle.dp
height: 85 * DefaultStyle.dp
width: Utils.getSizeWithScreenRatio(412)
height: Utils.getSizeWithScreenRatio(85)
}
}
StackLayout {
id: detailLayout
Layout.alignment: Qt.AlignCenter
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.topMargin: mainItem.useVerticalLayout ? 0 : Utils.getSizeWithScreenRatio(30)
Layout.leftMargin: Utils.getSizeWithScreenRatio(64)
Layout.rightMargin: Utils.getSizeWithScreenRatio(64)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(53)
Layout.fillWidth: true
Layout.fillHeight: true
}

View file

@ -6,32 +6,33 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Rectangle {
id: mainItem
property var friendCore
color: DefaultStyle.grey_0
radius: 20 * DefaultStyle.dp
radius: Utils.getSizeWithScreenRatio(20)
border.color: DefaultStyle.main2_200
border.width: 2 * DefaultStyle.dp
border.width: Utils.getSizeWithScreenRatio(2)
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 16 * DefaultStyle.dp
anchors.rightMargin: 16 * DefaultStyle.dp
spacing: 8 * DefaultStyle.dp
anchors.leftMargin: Utils.getSizeWithScreenRatio(16)
anchors.rightMargin: Utils.getSizeWithScreenRatio(16)
spacing: Utils.getSizeWithScreenRatio(8)
RowLayout {
spacing: 6 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(6)
EffectImage {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.presenceNote
colorizationColor: DefaultStyle.main2_600
Layout.preferredHeight: Math.round(17 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(17 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(17)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(17)
}
Text {

View file

@ -72,17 +72,17 @@ FocusScope {
}
Accessible.name: mainItem.startGroupButtonText
contentItem: RowLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: Math.round(44 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(44)
height: width
radius: width / 2
color: DefaultStyle.main1_500_main
EffectImage {
imageSource: AppIcons.usersThreeFilled
anchors.centerIn: parent
width: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: width
fillMode: Image.PreserveAspectFit
colorizationColor: DefaultStyle.grey_0

View file

@ -6,16 +6,17 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
property string label
property var icon
property alias content: contentControl.contentItem
signal titleIconClicked
RowLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Text {
text: mainItem.label
color: DefaultStyle.main1_500_main
@ -46,9 +47,9 @@ ColumnLayout {
id: contentControl
visible: expandButton.checked
Layout.fillWidth: true
leftPadding: Math.round(20 * DefaultStyle.dp)
rightPadding: Math.round(20 * DefaultStyle.dp)
topPadding: Math.round(17 * DefaultStyle.dp)
bottomPadding: Math.round(17 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(20)
rightPadding: Utils.getSizeWithScreenRatio(20)
topPadding: Utils.getSizeWithScreenRatio(17)
bottomPadding: Utils.getSizeWithScreenRatio(17)
}
}

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope{
id: mainItem
@ -40,11 +41,11 @@ FocusScope{
ColumnLayout {
id: layout
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
anchors.left: parent.left
anchors.right: parent.right
RowLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
Text {
visible: label.length > 0
verticalAlignment: Text.AlignVCenter
@ -63,8 +64,8 @@ FocusScope{
Item{Layout.fillWidth: true}
PopupButton {
visible: mainItem.tooltip !== ""
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
style: ButtonStyle.noBackground
icon.source: AppIcons.info
popUpTitle: mainItem.label

View file

@ -3,7 +3,8 @@ import QtQuick.Effects
import QtQuick.Layouts
import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp 1.0
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
@ -17,10 +18,10 @@ ColumnLayout {
id: rightPanelHeader
Layout.fillWidth: true
z: rightPanelContent.z + 1
topPadding: Math.round(30 * DefaultStyle.dp)
bottomPadding: Math.round(24 * DefaultStyle.dp)
leftPadding: Math.round(32 * DefaultStyle.dp)
rightPadding: Math.round(32 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(30)
bottomPadding: Utils.getSizeWithScreenRatio(24)
leftPadding: Utils.getSizeWithScreenRatio(32)
rightPadding: Utils.getSizeWithScreenRatio(32)
background: Item {
anchors.fill: parent
@ -36,7 +37,7 @@ ColumnLayout {
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: 0.05
shadowVerticalOffset: Math.round(10 * DefaultStyle.dp)
shadowVerticalOffset: Utils.getSizeWithScreenRatio(10)
}
}
}

View file

@ -3,14 +3,15 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.ScrollBar {
id: mainItem
padding: 0
property color color: DefaultStyle.grey_850
contentItem: Rectangle {
implicitWidth: Math.round(6 * DefaultStyle.dp)
radius: Math.round(32 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(6)
radius: Utils.getSizeWithScreenRatio(32)
color: mainItem.color
}
}

View file

@ -2,28 +2,30 @@ import QtQuick
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
/*
Layout with line separator used in several views
*/
ColumnLayout {
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
property alias content: contentLayout.data
property alias contentLayout: contentLayout
implicitHeight: contentLayout.implicitHeight + Math.max(Math.round(1 * DefaultStyle.dp), 1) + spacing
implicitHeight: contentLayout.implicitHeight + Utils.getSizeWithScreenRatio(1) + spacing
ColumnLayout {
id: contentLayout
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
// width: parent.width
// Layout.fillWidth: true
// Layout.preferredHeight: childrenRect.height
// Layout.preferredWidth: parent.width
// Layout.leftMargin: Math.round(8 * DefaultStyle.dp)
// Layout.leftMargin: Utils.getSizeWithScreenRatio(8)
}
Rectangle {
color: DefaultStyle.main2_200
Layout.fillWidth: true
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
width: parent.width
}
}

View file

@ -50,7 +50,7 @@ Control.TabBar {
horizontalAlignment: Text.AlignHCenter
color: DefaultStyle.grey_0
fontSizeMode: Text.Fit
font.pixelSize: Math.round(15 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(15)
text: parent.unread > 100 ? '99+' : parent.unread
}
}
@ -136,7 +136,7 @@ Control.TabBar {
contentItem: ColumnLayout {
EffectImage {
id: buttonIcon
property real buttonSize: mainItem.currentIndex !== index && tabButton.hovered ? Utils.getSizeWithScreenRatio(26) : Utils.getSizeWithScreenRatio(24)
property real buttonSize: Utils.getSizeWithScreenRatio(mainItem.currentIndex !== index && tabButton.hovered ? 26 : 24)
imageSource: mainItem.currentIndex === index ? modelData.selectedIcon : modelData.icon
Layout.preferredWidth: buttonSize
Layout.preferredHeight: buttonSize

View file

@ -3,6 +3,7 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Item {
id: mainItem
@ -13,7 +14,7 @@ Item {
height: busyIndicator.height
Control.BusyIndicator {
id: busyIndicator
width: Math.round(60 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(60)
height: width
running: mainItem.visible
anchors.centerIn: mainItem

View file

@ -32,9 +32,7 @@ ListView {
onListAboutToBeReset: loading = true
filterText: mainItem.searchText
onFilterTextChanged: maxDisplayItems = initialDisplayItems
initialDisplayItems: Math.max(
20,
2 * mainItem.height / (Utils.getSizeWithScreenRatio(56)))
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(56)))
displayItemsStep: 3 * initialDisplayItems / 2
onModelReset: {
mainItem.resultsReceived()

View file

@ -7,6 +7,7 @@ import QtQml
import SettingsCpp
import UtilsCpp 1.0
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
@ -15,7 +16,7 @@ ListView {
sourceModel: AppCpp.calls
}
implicitHeight: contentHeight
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
clip: true
onCountChanged: forceLayout()
@ -26,9 +27,9 @@ ListView {
delegate: RowLayout {
id: callInformationItem
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
width: mainItem.width
height: Math.round(45 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(45)
property var remoteNameObj: UtilsCpp.getDisplayName(modelData.core.remoteAddress)
property var callName : (modelData && !SettingsCpp.disableMeetingsFeature && modelData.core.isConference)
? modelData.core.conference.core.subject
@ -37,8 +38,8 @@ ListView {
: ""
Avatar {
id: delegateAvatar
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
_address: modelData.core.remoteAddress
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
isConference: modelData.core.isConference
@ -49,7 +50,7 @@ ListView {
Text {
id: delegateName
text: callInformationItem.callName
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
Layout.fillWidth: true
maximumLineCount: 1
}
@ -59,7 +60,7 @@ ListView {
property string type: modelData.core.isConference ? qsTr("meeting")
//: "Appel"
: qsTr("call")
Layout.rightMargin: Math.round(2 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(2)
text: modelData.core.state === LinphoneEnums.CallState.Paused
|| modelData.core.state === LinphoneEnums.CallState.PausedByRemote
//: "%1 en pause"
@ -67,16 +68,16 @@ ListView {
//: "%1 en cours"
: qsTr("ongoing_call_or_meeting").arg(type)
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}
Item{Layout.fillWidth: true}
Button {
id: transferButton
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
Layout.alignment: Qt.AlignVCenter
visible: mainItem.isTransferList && (mainItem.currentRemoteAddress !== modelData.core.remoteAddress)
icon.source: AppIcons.transferCall
@ -90,21 +91,21 @@ ListView {
Button {
id: pausingButton
enabled: !(modelData.core.state === LinphoneEnums.CallState.PausedByRemote)
Layout.preferredWidth: Math.round(28 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(28 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(28)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(28)
Layout.alignment: Qt.AlignVCenter
leftPadding: Math.round(5 * DefaultStyle.dp)
rightPadding: Math.round(5 * DefaultStyle.dp)
topPadding: Math.round(5 * DefaultStyle.dp)
bottomPadding: Math.round(5 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(5)
rightPadding: Utils.getSizeWithScreenRatio(5)
topPadding: Utils.getSizeWithScreenRatio(5)
bottomPadding: Utils.getSizeWithScreenRatio(5)
property bool pausedByUser: modelData.core.state === LinphoneEnums.CallState.Paused
color: pausedByUser ? DefaultStyle.success_500_main : DefaultStyle.grey_500
contentImageColor: DefaultStyle.grey_0
KeyNavigation.right: endCallButton
KeyNavigation.left: endCallButton
icon.source: pausedByUser ? AppIcons.play : AppIcons.pause
icon.width: Math.round(18 * DefaultStyle.dp)
icon.height: Math.round(18 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(18)
icon.height: Utils.getSizeWithScreenRatio(18)
onClicked: modelData.core.lSetPaused(!modelData.core.paused)
TextMetrics {
id: pauseMeter
@ -120,14 +121,14 @@ ListView {
}
SmallButton {
id: endCallButton
Layout.preferredWidth: Math.round(38 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(28 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(38)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(28)
style: ButtonStyle.phoneRed
KeyNavigation.left: pausingButton
KeyNavigation.right: pausingButton
contentImageColor: DefaultStyle.grey_0
icon.width: Math.round(18 * DefaultStyle.dp)
icon.height: Math.round(18 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(18)
icon.height: Utils.getSizeWithScreenRatio(18)
onClicked: {
mainWindow.callTerminatedByUser = true
mainWindow.endCall(modelData)

View file

@ -3,69 +3,70 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import SettingsCpp 1.0
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
property var call
property string objectName: "statsPanel"
spacing: Math.round(20 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(20)
RoundedPane {
Layout.fillWidth: true
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Math.round(13 * DefaultStyle.dp)
bottomPadding: Math.round(13 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
topPadding: Utils.getSizeWithScreenRatio(13)
bottomPadding: Utils.getSizeWithScreenRatio(13)
Layout.topMargin: Math.round(13 * DefaultStyle.dp)
Layout.leftMargin: Math.round(16 * DefaultStyle.dp)
Layout.rightMargin: Math.round(16 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(13)
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
Layout.rightMargin: Utils.getSizeWithScreenRatio(16)
contentItem: ColumnLayout {
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
Layout.alignment: Qt.AlignHCenter
Text {
//: "Audio"
text: qsTr("call_stats_audio_title")
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Typography.p2.weight
}
}
ColumnLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
Layout.alignment: Qt.AlignHCenter
Text {
text: mainItem.call ? mainItem.call.core.audioStats.codec : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.audioStats.bandwidth : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.audioStats.lossRate : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.audioStats.jitterBufferSize : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
@ -73,69 +74,69 @@ ColumnLayout {
}
RoundedPane {
Layout.fillWidth: true
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Math.round(13 * DefaultStyle.dp)
bottomPadding: Math.round(13 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
topPadding: Utils.getSizeWithScreenRatio(13)
bottomPadding: Utils.getSizeWithScreenRatio(13)
Layout.leftMargin: Math.round(16 * DefaultStyle.dp)
Layout.rightMargin: Math.round(16 * DefaultStyle.dp)
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
Layout.rightMargin: Utils.getSizeWithScreenRatio(16)
visible: mainItem.call && (mainItem.call.core.localVideoEnabled || mainItem.call.core.remoteVideoEnabled)
contentItem: ColumnLayout {
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
Layout.alignment: Qt.AlignHCenter
Text {
//: "Vidéo"
text: qsTr("call_stats_video_title")
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Typography.p2.weight
}
}
ColumnLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
Layout.alignment: Qt.AlignHCenter
Text {
text: mainItem.call ? mainItem.call.core.videoStats.codec : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.videoStats.bandwidth : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.videoStats.lossRate : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.videoStats.resolution : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
text: mainItem.call ? mainItem.call.core.videoStats.fps : ""
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}

View file

@ -15,7 +15,7 @@ ListView {
property SearchBar searchBar
property bool loading: false
property string searchText: searchBar?.text
property real busyIndicatorSize: Math.round(60 * DefaultStyle.dp)
property real busyIndicatorSize: Utils.getSizeWithScreenRatio(60)
property ChatGui currentChatGui: model.getAt(currentIndex) || null
property ChatGui chatToSelect: null
@ -41,7 +41,7 @@ ListView {
loading = true
}
filterText: mainItem.searchText
initialDisplayItems: Math.max(20, 2 * mainItem.height / (Math.round(56 * DefaultStyle.dp)))
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(56)))
displayItemsStep: 3 * initialDisplayItems / 2
onModelReset: {
loading = false
@ -62,7 +62,7 @@ ListView {
}
}
// flickDeceleration: 10000
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
function selectChat(chatGui) {
var index = chatProxy.findChatIndex(chatGui)
@ -134,8 +134,8 @@ ListView {
component UnreadNotification: Item {
id: unreadNotif
property int unread: 0
width: Math.round(14 * DefaultStyle.dp)
height: Math.round(14 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(14)
height: Utils.getSizeWithScreenRatio(14)
visible: unread > 0
Rectangle {
id: background
@ -148,7 +148,7 @@ ListView {
horizontalAlignment: Text.AlignHCenter
color: DefaultStyle.grey_0
fontSizeMode: Text.Fit
font.pixelSize: Math.round(10 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(10)
text: parent.unreadNotif > 100 ? '99+' : unreadNotif.unread
}
}
@ -168,7 +168,7 @@ ListView {
delegate: FocusScope {
visible: !mainItem.loading
width: mainItem.width
height: Math.round(63 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(63)
Connections {
target: mainItem
function onMarkAllAsRead() {modelData.core.lMarkAsRead()}
@ -176,18 +176,18 @@ ListView {
RowLayout {
z: 1
anchors.fill: parent
anchors.leftMargin: Math.round(11 * DefaultStyle.dp)
anchors.rightMargin: Math.round(11 * DefaultStyle.dp)
anchors.topMargin: Math.round(9 * DefaultStyle.dp)
anchors.bottomMargin: Math.round(9 * DefaultStyle.dp)
spacing: Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(11)
anchors.rightMargin: Utils.getSizeWithScreenRatio(11)
anchors.topMargin: Utils.getSizeWithScreenRatio(9)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(9)
spacing: Utils.getSizeWithScreenRatio(10)
Avatar {
property var contactObj: modelData ? UtilsCpp.findFriendByAddress(modelData.core.peerAddress) : null
contact: contactObj?.value || null
displayNameVal: modelData && modelData.core.avatarUri || ""
secured: modelData?.core.isSecured || false
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
// isConference: modelData.core.isConference
shadowEnabled: false
asynchronous: false
@ -195,7 +195,7 @@ ListView {
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
Text {
id: friendAddress
Layout.fillWidth: true
@ -209,7 +209,7 @@ ListView {
}
RowLayout {
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
Layout.fillWidth: true
EffectImage {
@ -217,8 +217,8 @@ ListView {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.reply
colorizationColor: DefaultStyle.main2_500
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
}
EffectImage {
@ -226,8 +226,8 @@ ListView {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.forward
colorizationColor: DefaultStyle.main2_500
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
}
EffectImage {
@ -235,8 +235,8 @@ ListView {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.paperclip
colorizationColor: DefaultStyle.main2_500
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
}
EffectImage {
@ -244,8 +244,8 @@ ListView {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.waveform
colorizationColor: DefaultStyle.main2_500
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
}
EffectImage {
@ -253,8 +253,8 @@ ListView {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.calendarBlank
colorizationColor: DefaultStyle.main2_500
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
}
Text {
@ -306,26 +306,26 @@ ListView {
}
RowLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Item {Layout.fillWidth: true}
EffectImage {
visible: modelData?.core.ephemeralEnabled || false
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
Layout.preferredHeight: 14 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(14) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.main2_400
imageSource: AppIcons.clockCountDown
}
EffectImage {
visible: modelData != undefined && modelData?.core.isBasic
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
Layout.preferredHeight: 14 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(14) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.warning_700
imageSource: AppIcons.lockSimpleOpen
}
EffectImage {
visible: modelData != undefined && modelData?.core.muted
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
Layout.preferredHeight: 14 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(14) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.main2_400
imageSource: AppIcons.bellSlash
}
@ -336,8 +336,8 @@ ListView {
EffectImage {
visible: modelData?.core.lastMessage && modelData?.core.lastMessageState !== LinphoneEnums.ChatMessageState.StateIdle
&& !modelData.core.lastMessage.core.isRemoteMessage || false
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
Layout.preferredHeight: 14 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(14) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.main1_500_main
imageSource: modelData
? modelData.core.lastMessageState === LinphoneEnums.ChatMessageState.StateDelivered
@ -357,7 +357,7 @@ ListView {
id: chatroomPopup
// z: 1
popup.x: 0
popup.padding: Math.round(10 * DefaultStyle.dp)
popup.padding: Utils.getSizeWithScreenRatio(10)
visible: mouseArea.containsMouse || hovered || popup.opened
enabled: visible
popup.contentItem: ColumnLayout {
@ -369,7 +369,7 @@ ListView {
: qsTr("chat_room_mute")
: ""
icon.source: modelData ? modelData.core.muted ? AppIcons.bell : AppIcons.bellSlash : ""
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Layout.fillWidth: true
onClicked: {
modelData.core.muted = !modelData.core.muted
@ -380,7 +380,7 @@ ListView {
//: "Mark as read"
text: qsTr("chat_room_mark_as_read")
icon.source: AppIcons.checks
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Layout.fillWidth: true
onClicked: {
modelData.core.lMarkAsRead()
@ -392,14 +392,14 @@ ListView {
visible: modelData && !modelData.core.isReadOnly && modelData.core.isGroupChat || false
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: Math.min(1, Math.round(1 * DefaultStyle.dp))
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
color: DefaultStyle.main2_400
}
IconLabelButton {
//: "leave"
text: qsTr("chat_room_leave")
icon.source: AppIcons.trashCan
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Layout.fillWidth: true
onClicked: {
//: leave the conversation ?
@ -420,7 +420,7 @@ ListView {
Rectangle {
visible: deleteButton.visible
Layout.fillWidth: true
Layout.preferredHeight: Math.min(1, Math.round(1 * DefaultStyle.dp))
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
color: DefaultStyle.main2_400
}
IconLabelButton {
@ -428,7 +428,7 @@ ListView {
//: "Delete"
text: qsTr("chat_room_delete")
icon.source: AppIcons.trashCan
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Layout.fillWidth: true
onClicked: {
//: Delete the conversation ?
@ -463,7 +463,7 @@ ListView {
Rectangle {
anchors.fill: parent
opacity: 0.7
radius: Math.round(8 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(8)
color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.main2_100
visible: mainItem.lastMouseContainsIndex === index || mainItem.currentIndex === index
}

View file

@ -458,7 +458,7 @@ Control.Control {
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: Math.min(1, Utils.getSizeWithScreenRatio(1))
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
color: DefaultStyle.main2_400
}
IconLabelButton {

View file

@ -6,6 +6,7 @@ import QtMultimedia
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
// Simple content display without reply and forward. These modules need to be splitted because of cyclic dependencies.
@ -30,8 +31,8 @@ ColumnLayout {
property int fileBorderWidth : 0
spacing: Math.round(5 * DefaultStyle.dp)
property int padding: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
property int padding: Utils.getSizeWithScreenRatio(10)
property ChatMessageContentProxy filescontentProxy: ChatMessageContentProxy {
filterType: ChatMessageContentProxy.FilterContentType.File
@ -49,8 +50,8 @@ ColumnLayout {
delegate: ChatAudioContent {
id: audioContent
// Layout.fillWidth: true
width: Math.round(269 * DefaultStyle.dp)
height: Math.round(48 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(269)
height: Utils.getSizeWithScreenRatio(48)
Layout.preferredHeight: height
chatMessageContentGui: modelData
onEndOfFileReached: mainItem.endOfVoiceRecordingReached()
@ -73,7 +74,7 @@ ColumnLayout {
chatMessageGui: mainItem.chatMessageGui
}
delegate: ChatMessageInvitationBubble {
Layout.preferredWidth: 490 * DefaultStyle.dp
Layout.preferredWidth: Utils.getSizeWithScreenRatio(490)
conferenceInfoGui: modelData.core.conferenceInfo
onMouseEvent: (event) => mainItem.mouseEvent(event)
}
@ -85,7 +86,7 @@ ColumnLayout {
contentGui: mainItem.filescontentProxy.count === 1
? mainItem.filescontentProxy.getChatMessageContentAtIndex(0)
: null
width: Math.round(285 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(285)
Layout.alignment: Qt.AlignHCenter
fillMode: Image.PreserveAspectFit
}
@ -95,7 +96,7 @@ ColumnLayout {
contentGui: mainItem.filescontentProxy.count === 1
? mainItem.filescontentProxy.getChatMessageContentAtIndex(0)
: null
Layout.preferredWidth: Math.round(285 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(285)
Layout.preferredHeight: paintedHeight
Layout.alignment: Qt.AlignHCenter
fillMode: Image.PreserveAspectFit
@ -106,8 +107,8 @@ ColumnLayout {
contentGui: mainItem.filescontentProxy.count === 1
? mainItem.filescontentProxy.getChatMessageContentAtIndex(0)
: null
width: Math.round(285 * DefaultStyle.dp)
height: Math.round(285 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(285)
height: Utils.getSizeWithScreenRatio(285)
Layout.preferredWidth: videoOutput.contentRect.width
Layout.preferredHeight: videoOutput.contentRect.height
Layout.alignment: Qt.AlignHCenter
@ -123,7 +124,7 @@ ColumnLayout {
&& !singleVideoFile.visible
Layout.fillWidth: visible
Layout.fillHeight: visible
maxWidth: Math.round(115*3 * DefaultStyle.dp)
maxWidth: Utils.getSizeWithScreenRatio(115*3)
// Layout.fillHeight: true
proxyModel: visible ? mainItem.filescontentProxy : null
// onIsHoveringFileChanged: mainItem.isFileHoveringChanged(isHoveringFile)

View file

@ -12,7 +12,7 @@ ColumnLayout {
spacing: 0
id: mainItem
width: 490 * DefaultStyle.dp
width: Utils.getSizeWithScreenRatio(490)
property ConferenceInfoGui conferenceInfoGui
property var conferenceInfo: conferenceInfoGui?.core
@ -43,16 +43,16 @@ ColumnLayout {
Control.Control {
id: infoControl
topPadding: Math.round(16 * DefaultStyle.dp)
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
bottomPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(16)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
Layout.fillWidth: true
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_100
radius: 10 * DefaultStyle.dp // rounded all, but only top visible
radius: Utils.getSizeWithScreenRatio(10) // rounded all, but only top visible
}
contentItem: ColumnLayout {
Text {
@ -77,21 +77,21 @@ ColumnLayout {
RowLayout {
Layout.fillWidth: true
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Control.Control {
id: dayRect
Layout.alignment: Qt.AlignTop
topPadding: Math.round(4 * DefaultStyle.dp)
bottomPadding: Math.round(6 * DefaultStyle.dp)
leftPadding: Math.round(13 * DefaultStyle.dp)
rightPadding: Math.round(13 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(4)
bottomPadding: Utils.getSizeWithScreenRatio(6)
leftPadding: Utils.getSizeWithScreenRatio(13)
rightPadding: Utils.getSizeWithScreenRatio(13)
background: Item {
Rectangle {
id: dayRectBg
anchors.fill: parent
radius: 10 * DefaultStyle.dp
radius: Utils.getSizeWithScreenRatio(10)
color: DefaultStyle.grey_0
}
MultiEffect {
@ -103,7 +103,7 @@ ColumnLayout {
}
}
contentItem: ColumnLayout {
spacing: 2 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(2)
Text {
Layout.fillWidth: true
@ -120,8 +120,8 @@ ColumnLayout {
}
Rectangle {
width: 23 * DefaultStyle.dp
height: 23 * DefaultStyle.dp
width: Utils.getSizeWithScreenRatio(23)
height: Utils.getSizeWithScreenRatio(23)
radius: width / 2
color: DefaultStyle.main1_500_main
// anchors.horizontalCenter: parent.horizontalCenter
@ -138,14 +138,14 @@ ColumnLayout {
// Info
ColumnLayout {
spacing: -2 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(-2)
RowLayout {
spacing: 8 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
imageSource: AppIcons.videoconference
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
Text {
@ -189,26 +189,26 @@ ColumnLayout {
Rectangle {
visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0
Layout.fillWidth: true
height: 10 * DefaultStyle.dp
height: Utils.getSizeWithScreenRatio(10)
color: DefaultStyle.grey_100
Layout.topMargin: -10 * DefaultStyle.dp
Layout.topMargin: Utils.getSizeWithScreenRatio(-10)
z: infoControl.z + 1
}
Rectangle {
visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0
Layout.fillWidth: true
height: 10 * DefaultStyle.dp
height: Utils.getSizeWithScreenRatio(10)
color: DefaultStyle.grey_0
Layout.bottomMargin: -10 * DefaultStyle.dp
Layout.bottomMargin: Utils.getSizeWithScreenRatio(-10)
z: infoControl.z + 1
}
Control.Control {
visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0
topPadding: Math.round(16 * DefaultStyle.dp) // only 6 because the rectangle linking the 2 controls is size 10
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
bottomPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(16) // only 6 because the rectangle linking the 2 controls is size 10
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
Layout.fillWidth: true
MouseArea {
@ -221,11 +221,11 @@ ColumnLayout {
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_0
radius: 10 * DefaultStyle.dp
radius: Utils.getSizeWithScreenRatio(10)
}
contentItem: ColumnLayout {
spacing: 10 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(10)
ColumnLayout {
spacing: 0
@ -263,13 +263,13 @@ ColumnLayout {
RowLayout {
visible: conferenceInfo.participantCount > 0
Layout.fillHeight: true
Layout.preferredHeight: 30 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
spacing: Utils.getSizeWithScreenRatio(10)
EffectImage {
imageSource: AppIcons.usersTwo
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
}
Text {
//: %n participant(s)

View file

@ -6,15 +6,16 @@ import Qt.labs.qmlmodels
import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
spacing: Math.round(4 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(4)
property ChatGui chat
property color backgroundColor
property bool lastItemVisible: false
property int lastIndexFoundWithFilter: -1
property real busyIndicatorSize: Math.round(60 * DefaultStyle.dp)
property real busyIndicatorSize: Utils.getSizeWithScreenRatio(60)
property bool loading: false
property bool isEncrypted: chat && chat.core.isEncrypted
@ -53,15 +54,15 @@ ListView {
Button {
visible: !mainItem.lastItemVisible
icon.source: AppIcons.downArrow
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Math.round(16 * DefaultStyle.dp)
bottomPadding: Math.round(16 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
topPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
anchors.bottom: parent.bottom
style: ButtonStyle.main
anchors.right: parent.right
anchors.bottomMargin: Math.round(18 * DefaultStyle.dp)
anchors.rightMargin: Math.round(18 * DefaultStyle.dp)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(18)
anchors.rightMargin: Utils.getSizeWithScreenRatio(18)
onClicked: {
var index = eventLogProxy.findFirstUnreadIndex()
mainItem.positionViewAtIndex(index, ListView.Beginning)
@ -129,32 +130,32 @@ ListView {
footer: Item {
visible: mainItem.chat && !mainItem.loading
height: visible ? headerMessage.height + headerMessage.topMargin + headerMessage.bottomMargin : Math.round(30 * DefaultStyle.dp)
height: visible ? (headerMessage.height + headerMessage.topMargin + headerMessage.bottomMargin) : Utils.getSizeWithScreenRatio(30)
width: headerMessage.width
anchors.horizontalCenter: parent.horizontalCenter
Control.Control {
id: headerMessage
property int topMargin: mainItem.contentHeight > mainItem.height ? Math.round(30 * DefaultStyle.dp) : Math.round(50 * DefaultStyle.dp)
property int bottomMargin: Math.round(30 * DefaultStyle.dp)
property int topMargin: Utils.getSizeWithScreenRatio(mainItem.contentHeight > mainItem.height ? 30 : 50)
property int bottomMargin: Utils.getSizeWithScreenRatio(30)
anchors.topMargin: topMargin
anchors.bottomMargin: bottomMargin
anchors.top: parent.top
padding: Math.round(10 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(10)
background: Rectangle {
color: "transparent"
border.color: DefaultStyle.main2_200
border.width: Math.round(2 * DefaultStyle.dp)
radius: Math.round(10 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(2)
radius: Utils.getSizeWithScreenRatio(10)
}
contentItem: RowLayout {
EffectImage {
Layout.preferredWidth: Math.round(23 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(23 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(23)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(23)
imageSource: mainItem.isEncrypted ? AppIcons.lockSimple : AppIcons.lockSimpleOpen
colorizationColor: mainItem.isEncrypted ? DefaultStyle.info_500_main : DefaultStyle.warning_700
}
ColumnLayout {
spacing: Math.round(2 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(2)
Text {
text: mainItem.isEncrypted
//: End to end encrypted chat
@ -192,8 +193,8 @@ ListView {
width: mainItem.width
// height: visible ? contentItem.implicitHeight + topPadding + bottomPadding : 0
z: mainItem.z + 2
topPadding: Math.round(5 * DefaultStyle.dp)
bottomPadding: Math.round(5 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(5)
bottomPadding: Utils.getSizeWithScreenRatio(5)
background: Rectangle {
anchors.fill: parent
color: mainItem.backgroundColor
@ -202,8 +203,8 @@ ListView {
id: composeLayout
property var composingName: mainItem.chat?.core.composingName
Avatar {
Layout.preferredWidth: Math.round(20 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(20 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
_address: mainItem.chat?.core.composingAddress
}
Text {
@ -303,11 +304,11 @@ ListView {
}
property bool showTopMargin: !header.visible && index == 0
width: mainItem.width
height: (showTopMargin ? 30 * DefaultStyle.dp : 0) + eventItem.implicitHeight
height: (showTopMargin ? Utils.getSizeWithScreenRatio(30) : 0) + eventItem.implicitHeight
Event {
id: eventItem
anchors.top: parent.top
anchors.topMargin: showTopMargin ? 30 : 0 * DefaultStyle.dp
anchors.topMargin: showTopMargin ? Utils.getSizeWithScreenRatio(30) : 0
width: parent.width
eventLogGui: modelData
}
@ -328,12 +329,12 @@ ListView {
}
property bool showTopMargin: !header.visible && index == 0
width: mainItem.width
//height: 40 * DefaultStyle.dp
height: (showTopMargin ? 30 : 0 * DefaultStyle.dp) + ephemeralEventItem.height
//height: Utils.getSizeWithScreenRatio(40)
height: (showTopMargin ? Utils.getSizeWithScreenRatio(30) : 0) + ephemeralEventItem.height
EphemeralEvent {
id: ephemeralEventItem
anchors.top: parent.top
anchors.topMargin: showTopMargin ? 30 : 0 * DefaultStyle.dp
anchors.topMargin: showTopMargin ? Utils.getSizeWithScreenRatio(30) : 0
eventLogGui: modelData
}
}

View file

@ -64,23 +64,23 @@ ColumnLayout {
}
RowLayout {
id: categoriesRow
Layout.preferredWidth: parent.width - Math.round(15 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(35 * DefaultStyle.dp)
Layout.leftMargin: Math.round(5 * DefaultStyle.dp)
Layout.preferredWidth: parent.width - Utils.getSizeWithScreenRatio(15)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(35)
Layout.leftMargin: Utils.getSizeWithScreenRatio(5)
Layout.alignment: Qt.AlignCenter
spacing: searchField.widthSize > 0 ? Math.round(7 * DefaultStyle.dp) : Math.round(17 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(searchField.widthSize > 0 ? 7 : 17)
clip: true
Image {
id: searchIcon
source: "image://emoji/icons/search.svg"
sourceSize: Qt.size(Math.round(21 * DefaultStyle.dp), Math.round(21 * DefaultStyle.dp))
sourceSize: Qt.size(Utils.getSizeWithScreenRatio(21),Utils.getSizeWithScreenRatio(21))
visible: !mainItem.searchMode
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
mainItem.searchMode = true
searchField.widthSize = categoriesRow.width - Math.round(25 * DefaultStyle.dp)
searchField.widthSize = categoriesRow.width - Utils.getSizeWithScreenRatio(25)
list.model = 1
searchField.focus = true
}
@ -89,7 +89,7 @@ ColumnLayout {
Image {
id: closeIcon
source: "image://emoji/icons/close.svg"
sourceSize: Qt.size(Math.round(21 * DefaultStyle.dp), Math.round(21 * DefaultStyle.dp))
sourceSize: Qt.size(Utils.getSizeWithScreenRatio(21),Utils.getSizeWithScreenRatio(21))
visible: mainItem.searchMode
MouseArea {
anchors.fill: parent
@ -106,7 +106,7 @@ ColumnLayout {
id: searchField
property int widthSize: 0
Layout.preferredWidth: widthSize
Layout.preferredHeight: Math.round(28 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(28)
visible: widthSize > 0 ? true : false
placeholderText: 'Search Emoji'
Behavior on widthSize {
@ -115,7 +115,7 @@ ColumnLayout {
}
}
background: Rectangle {
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
border.color: DefaultStyle.main1_500_main
}
onTextChanged: {
@ -134,7 +134,7 @@ ColumnLayout {
delegate: Image {
id: icon
source: "image://emoji/icons/" + cateIcons.blackSvg[index]
sourceSize: Qt.size(Math.round(20 * DefaultStyle.dp), Math.round(20 * DefaultStyle.dp))
sourceSize: Qt.size(Utils.getSizeWithScreenRatio(20),Utils.getSizeWithScreenRatio(20))
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@ -156,46 +156,46 @@ ColumnLayout {
ListView {
id: list
width: mainItem.width
height: Math.round(250 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(250)
Layout.fillWidth: true
Layout.fillHeight: true
model: mainItem.categories
spacing: Math.round(30 * DefaultStyle.dp)
topMargin: Math.round(7 * DefaultStyle.dp)
bottomMargin: Math.round(7 * DefaultStyle.dp)
leftMargin: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(30)
topMargin: Utils.getSizeWithScreenRatio(7)
bottomMargin: Utils.getSizeWithScreenRatio(7)
leftMargin: Utils.getSizeWithScreenRatio(12)
clip: true
delegate: GridLayout {
id: grid
property string category: mainItem.searchMode ? 'Search Result' : modelData
property int columnCount: Math.round(list.width / 50 * DefaultStyle.dp)
property int columnCount: Math.round(list.width / Utils.getSizeWithScreenRatio(50))
property int sc: grid.category === 'People & Body' ? mainItem.skinColor : -1
columns: columnCount
width: list.width
columnSpacing: Math.round(5 * DefaultStyle.dp)
columnSpacing: Utils.getSizeWithScreenRatio(5)
Text {
Layout.fillWidth: true
Layout.preferredHeight: Math.round(20 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
text: grid.category
color: Qt.rgba(0, 0, 0, 0.5)
font.pixelSize: Math.round(15 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(15)
horizontalAlignment: Text.AlignLeft
leftPadding: Math.round(6 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(6)
Layout.columnSpan: grid.columnCount != 0 ? grid.columnCount : 1
Layout.bottomMargin: Math.round(8 * DefaultStyle.dp)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(8)
}
Repeater {
model: mainItem.searchMode ? mainItem.searchModel : mainItem.model.count(grid.category)
delegate: Rectangle {
property alias es: emojiSvg
Layout.preferredWidth: Math.round(40 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(40 * DefaultStyle.dp)
radius: Math.round(40 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(40)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(40)
radius: Utils.getSizeWithScreenRatio(40)
color: mouseArea.containsMouse ? '#e6e6e6' : '#ffffff'
Image {
id: emojiSvg
source: mainItem.searchMode ? path : mainItem.model.path(grid.category, index, grid.sc)
sourceSize: Qt.size(Math.round(30 * DefaultStyle.dp), Math.round(30 * DefaultStyle.dp))
sourceSize: Qt.size(Utils.getSizeWithScreenRatio(30),Utils.getSizeWithScreenRatio(30))
anchors.centerIn: parent
asynchronous: true
}
@ -224,7 +224,7 @@ ColumnLayout {
}
}
RowLayout {
Layout.preferredHeight: Math.round(35 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(35)
Layout.alignment: Qt.AlignCenter
spacing: 10
Repeater {
@ -234,10 +234,10 @@ ColumnLayout {
model: 6
delegate: Rectangle {
id: colorRect
Layout.preferredWidth: Math.round(30 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.bottomMargin: Math.round(3 * DefaultStyle.dp)
radius: Math.round(30 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(30)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(3)
radius: Utils.getSizeWithScreenRatio(30)
scale: 0.65
color: skinColors.colors[index]
Behavior on scale {

View file

@ -2,24 +2,25 @@ import QtQuick
import QtQuick.Layouts
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Rectangle {
anchors.centerIn: parent
property EventLogGui eventLogGui
property var eventLogCore: eventLogGui.core
visible: eventLogCore.handled
height: row.height + 15 * DefaultStyle.dp
width: row.width + 15 * DefaultStyle.dp
radius: 10 * DefaultStyle.dp
border.width: 2 * DefaultStyle.dp
height: row.height + Utils.getSizeWithScreenRatio(15)
width: row.width + Utils.getSizeWithScreenRatio(15)
radius: Utils.getSizeWithScreenRatio(10)
border.width: Utils.getSizeWithScreenRatio(2)
border.color: DefaultStyle.main2_200
color: "transparent"
RowLayout {
id: row
anchors.centerIn: parent
EffectImage {
Layout.preferredWidth: visible ? 20 * DefaultStyle.dp : 0
Layout.preferredHeight: 20 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(20) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
colorizationColor: DefaultStyle.main2_400
imageSource: AppIcons.clockCountDown
Layout.alignment: Qt.AlignHCenter

View file

@ -2,10 +2,11 @@ import QtQuick
import QtQuick.Layouts
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
RowLayout {
id: mainLayout
height: 40 * DefaultStyle.dp
height: Utils.getSizeWithScreenRatio(40)
visible: eventLogCore.handled
property EventLogGui eventLogGui
property var eventLogCore: eventLogGui.core
@ -17,8 +18,8 @@ RowLayout {
}
ColumnLayout {
Layout.rightMargin: 20 * DefaultStyle.dp
Layout.leftMargin: 20 * DefaultStyle.dp
Layout.rightMargin: Utils.getSizeWithScreenRatio(20)
Layout.leftMargin: Utils.getSizeWithScreenRatio(20)
Layout.alignment: Qt.AlignVCenter
Text {

View file

@ -116,8 +116,8 @@ Item {
EffectImage {
anchors.centerIn: parent
visible: videoThumbnail.playbackState !== MediaPlayer.PlayingState
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
imageSource: AppIcons.playFill
colorizationColor: DefaultStyle.main2_0
}
@ -126,8 +126,8 @@ Item {
property int timeDisplayed: videoThumbnail.playbackState === MediaPlayer.PlayingState ? videoThumbnail.position : videoThumbnail.duration
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: Math.round(6 * DefaultStyle.dp)
anchors.leftMargin: Math.round(6 * DefaultStyle.dp)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(6)
anchors.leftMargin: Utils.getSizeWithScreenRatio(6)
text: UtilsCpp.formatDuration(timeDisplayed)
color: DefaultStyle.grey_0
font {
@ -156,10 +156,10 @@ Item {
Component {
id: defaultSquareView
Control.Control {
leftPadding: Math.round(4 * DefaultStyle.dp)
rightPadding: Math.round(4 * DefaultStyle.dp)
topPadding: Math.round(23 * DefaultStyle.dp)
bottomPadding: Math.round(4 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(4)
rightPadding: Utils.getSizeWithScreenRatio(4)
topPadding: Utils.getSizeWithScreenRatio(23)
bottomPadding: Utils.getSizeWithScreenRatio(4)
hoverEnabled: false
background: Rectangle {
@ -172,12 +172,12 @@ Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: Math.round(23 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(23)
EffectImage {
anchors.centerIn: parent
imageSource: mainItem.imageSource
imageWidth: Math.round(14 * DefaultStyle.dp)
imageHeight: Math.round(14 * DefaultStyle.dp)
imageWidth: Utils.getSizeWithScreenRatio(14)
imageHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.main2_600
}
}
@ -234,8 +234,8 @@ Item {
visible: thumbnailProvider.state === 'hovered' && mainItem.contentGui && (/*!mainItem.isOutgoing &&*/ !mainItem.contentGui.core.wasDownloaded)
anchors.centerIn: parent
imageSource: AppIcons.download
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
colorizationColor: DefaultStyle.main2_600
}
}
@ -244,20 +244,20 @@ Item {
Component {
id: defaultView
Control.Control {
rightPadding: Math.round(17*DefaultStyle.dp)
rightPadding: Utils.getSizeWithScreenRatio(17)
background: Rectangle {
id: bg
color: DefaultStyle.grey_100
width: mainItem.width
height: mainItem.height
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
}
contentItem: RowLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
Rectangle {
color: DefaultStyle.main2_200
width: Math.round(58 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(58)
height: bg.height
radius: bg.radius
Rectangle {
@ -272,13 +272,13 @@ Item {
z: parent.z + 1
anchors.centerIn: parent
imageSource: defaultViewStack.imageSource
width: Math.round(22 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(22)
height: width
colorizationColor: DefaultStyle.main2_600
}
}
ColumnLayout {
spacing: Math.round(1 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(1)
Text {
text: mainItem.name
Layout.fillWidth: true

View file

@ -40,8 +40,8 @@ Rectangle {
property int timeDisplayed: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.position : mediaPlayer.duration
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: Math.round(6 * DefaultStyle.dp)
anchors.leftMargin: Math.round(6 * DefaultStyle.dp)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(6)
anchors.leftMargin: Utils.getSizeWithScreenRatio(6)
text: UtilsCpp.formatDuration(timeDisplayed)
color: DefaultStyle.grey_0
font {
@ -64,8 +64,8 @@ Rectangle {
EffectImage {
anchors.centerIn: parent
visible: mediaPlayer.playbackState !== MediaPlayer.PlayingState
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
imageSource: AppIcons.playFill
colorizationColor: DefaultStyle.main2_0
}

View file

@ -46,10 +46,10 @@ Flickable {
property bool haveContacts: count > 0
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(60 * DefaultStyle.dp)
property real sectionsSpacing: Utils.getSizeWithScreenRatio(18)
property real busyIndicatorSize: Utils.getSizeWithScreenRatio(60)
property real itemsRightMargin: Math.round(39 * DefaultStyle.dp)
property real itemsRightMargin: Utils.getSizeWithScreenRatio(39)
property int count: contactsList.count + suggestionsList.count + favoritesList.count
contentHeight: contentsLayout.height
@ -233,7 +233,7 @@ Flickable {
Control.ScrollBar.vertical: ScrollBar {
id: scrollbar
z: 1
topPadding: Math.round(24 * DefaultStyle.dp) // Avoid to be on top of collapse button
topPadding: Utils.getSizeWithScreenRatio(24) // Avoid to be on top of collapse button
active: true
interactive: true
visible: mainItem.contentHeight > mainItem.height
@ -243,7 +243,7 @@ Flickable {
ColumnLayout {
id: contentsLayout
width: mainItem.width
spacing: 0 //Math.round(20 * DefaultStyle.dp)
spacing: 0
BusyIndicator {
id: busyIndicator
@ -307,7 +307,7 @@ Flickable {
visible: contentHeight > 0
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
Layout.topMargin: favoritesList.height > 0 ? Math.round(4 * DefaultStyle.dp) : 0
Layout.topMargin: favoritesList.height > 0 ? Utils.getSizeWithScreenRatio(4) : 0
interactive: false
highlightText: mainItem.highlightText
showActions: mainItem.showActions
@ -345,13 +345,11 @@ Flickable {
| (mainItem.searchText != '*'
&& mainItem.searchText != ''
|| SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap | MagicSearchProxy.FilteringTypes.CardDAV : 0)
initialDisplayItems: Math.max(
20,
2 * mainItem.height / (Math.round(63 * DefaultStyle.dp)))
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(63)))
displayItemsStep: 3 * initialDisplayItems / 2
onLocalFriendCreated: index => {
contactsList.selectIndex(index)
}
onLocalFriendCreated: (index) => {
contactsList.selectIndex(index)
}
}
}
ContactListView {
@ -359,8 +357,7 @@ Flickable {
visible: contentHeight > 0
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
Layout.topMargin: contactsList.height + favoritesList.height
> 0 ? Math.round(4 * DefaultStyle.dp) : 0
Layout.topMargin: (contactsList.height + favoritesList.height) > 0 ? Utils.getSizeWithScreenRatio(4) : 0
interactive: false
showInitials: false
highlightText: mainItem.highlightText
@ -395,11 +392,9 @@ Flickable {
id: suggestionsProxy
parentProxy: mainItem.mainModel
filterType: mainItem.hideSuggestions ? MagicSearchProxy.FilteringTypes.None : MagicSearchProxy.FilteringTypes.Other
initialDisplayItems: contactsProxy.haveMore
&& contactsList.expanded ? 0 : Math.max(
20,
2 * mainItem.height
/ (Math.round(63 * DefaultStyle.dp)))
initialDisplayItems: contactsProxy.haveMore && contactsList.expanded
? 0
: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(63)))
onInitialDisplayItemsChanged: maxDisplayItems = initialDisplayItems
displayItemsStep: 3 * initialDisplayItems / 2
onModelReset: maxDisplayItems = initialDisplayItems

View file

@ -6,6 +6,7 @@ import QtQuick.Effects
import Linphone
import UtilsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// Fill contact, account or call
// Initials will be displayed if there isn't any avatar.
@ -93,7 +94,7 @@ Loader{
z: 1
color: "transparent"
border {
width: Math.round(2 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(2)
color: mainItem.secured ? DefaultStyle.info_500_main : DefaultStyle.danger_500_main
}
EffectImage {

View file

@ -120,8 +120,8 @@ Control.Control{
color: DefaultStyle.grey_0
minimumPixelSize: 5
fontSizeMode: Text.Fit
font.pixelSize: Math.round(11 * DefaultStyle.dp)
font.weight: Math.round(700 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(11)
font.weight: Utils.getSizeWithScreenRatio(700)
text: mainItem.account.core.unreadNotifications >= 100 ? '99+' : mainItem.account.core.unreadNotifications
}
}

View file

@ -7,10 +7,11 @@ import UtilsCpp 1.0
import ConstantsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope {
id: mainItem
implicitHeight: visible ? Math.round(56 * DefaultStyle.dp) : 0
implicitHeight: visible ? Utils.getSizeWithScreenRatio(56) : 0
property var searchResultItem
property bool showInitials: true // Display Initials of Display name.
property bool showDefaultAddress: true // Display address below display name.
@ -32,7 +33,7 @@ FocusScope {
property var previousInitial
// Use directly previous initial
property real itemsRightMargin: Math.round(39 * DefaultStyle.dp)
property real itemsRightMargin: Utils.getSizeWithScreenRatio(39)
property var displayName: searchResultItem? searchResultItem.core.fullName : ""
property var initial: displayName != "" ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
@ -48,15 +49,15 @@ FocusScope {
anchors.left: parent.left
visible: mainItem.showInitials
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: Math.round(15 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(15)
verticalAlignment: Text.AlignVCenter
width: Math.round(20 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(20)
opacity: previousInitial != mainItem.initial ? 1 : 0
text: mainItem.initial || ""
color: DefaultStyle.main2_400
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Utils.getSizeWithScreenRatio(500)
capitalization: Font.AllUppercase
}
}
@ -67,12 +68,12 @@ FocusScope {
anchors.rightMargin: mainItem.itemsRightMargin
anchors.top: parent.top
anchors.bottom: parent.bottom
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
z: contactArea.z + 1
Avatar {
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.leftMargin: Math.round(5 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
Layout.leftMargin: Utils.getSizeWithScreenRatio(5)
contact: searchResultItem
shadowEnabled: false
}
@ -93,7 +94,7 @@ FocusScope {
maximumLineCount: 1
}
Text {
Layout.topMargin: Math.round(2 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(2)
Layout.fillWidth: true
Layout.preferredHeight: visible ? implicitHeight: 0
visible: mainItem.showDefaultAddress
@ -104,8 +105,8 @@ FocusScope {
maximumLineCount: 1
elide: Text.ElideRight
font {
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Utils.getSizeWithScreenRatio(300)
pixelSize: Utils.getSizeWithScreenRatio(12)
}
}
}
@ -116,31 +117,31 @@ FocusScope {
id: actionsRow
z: contactArea.z + 1
visible: mainItem.showActions || actionButtons.visible || mainItem.showContactMenu || mainItem.multiSelectionEnabled
spacing: visible ? Math.round(16 * DefaultStyle.dp) : 0
spacing: visible ? Utils.getSizeWithScreenRatio(16) : 0
enabled: visible
Layout.rightMargin: Math.round(5 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(5)
EffectImage {
id: isSelectedCheck
visible: mainItem.multiSelectionEnabled
&& (mainItem.selectedContacts.indexOf(mainItem.addressFromFilter) != -1)
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
imageSource: AppIcons.check
colorizationColor: DefaultStyle.main1_500_main
}
RowLayout {
id: actionButtons
visible: mainItem.showActions
spacing: visible ? Math.round(10 * DefaultStyle.dp) : 0
spacing: visible ? Utils.getSizeWithScreenRatio(10) : 0
IconButton {
id: callButton
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
icon.source: AppIcons.phone
focus: visible
radius: Math.round(40 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(40)
style: ButtonStyle.grey
onClicked: UtilsCpp.createCall(mainItem.addressFromFilter)
KeyNavigation.left: chatButton
@ -149,13 +150,13 @@ FocusScope {
IconButton {
id: videoCallButton
visible: SettingsCpp.videoEnabled
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
icon.source: AppIcons.videoCamera
focus: visible && !callButton.visible
radius: Math.round(40 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(40)
style: ButtonStyle.grey
onClicked: UtilsCpp.createCall(mainItem.addressFromFilter, {"localVideoEnabled": true})
KeyNavigation.left: callButton
@ -165,14 +166,14 @@ FocusScope {
id: chatButton
visible: actionButtons.visible
&& !SettingsCpp.disableChatFeature
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
icon.source: AppIcons.chatTeardropText
focus: visible && !callButton.visible
&& !videoCallButton.visible
radius: Math.round(40 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(40)
style: ButtonStyle.grey
KeyNavigation.left: videoCallButton
KeyNavigation.right: callButton
@ -186,7 +187,7 @@ FocusScope {
id: friendPopup
z: contactArea.z + 1
popup.x: 0
popup.padding: Math.round(10 * DefaultStyle.dp)
popup.padding: Utils.getSizeWithScreenRatio(10)
visible: mainItem.showContactMenu && (contactArea.containsMouse || mainItem.isLastHovered || hovered || popup.opened)
enabled: visible
@ -200,7 +201,7 @@ FocusScope {
//: "Ajouter aux favoris"
: qsTr("contact_details_add_to_favourites")
icon.source: searchResultItem.core.starred ? AppIcons.heartFill : AppIcons.heart
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
textColor: DefaultStyle.main2_500_main
hoveredImageColor: searchResultItem.core.starred ? DefaultStyle.main1_700 : DefaultStyle.danger_700
contentImageColor: searchResultItem.core.starred ? DefaultStyle.danger_500_main : DefaultStyle.main2_600
@ -215,7 +216,7 @@ FocusScope {
text: qsTr("Partager")
Layout.fillWidth: true
icon.source: AppIcons.shareNetwork
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
textColor: DefaultStyle.main2_500_main
onClicked: {
var vcard = searchResultItem.core.getVCard()
@ -243,7 +244,7 @@ FocusScope {
//: "Supprimer"
text: qsTr("contact_details_delete")
icon.source: AppIcons.trashCan
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
visible: searchResultItem && searchResultItem.core.isStored && !searchResultItem.core.readOnly
Layout.fillWidth: true
onClicked: {
@ -269,7 +270,7 @@ FocusScope {
}
Rectangle {
anchors.fill: contactArea
radius: Math.round(8 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(8)
opacity: 0.7
color: mainItem.isSelected ? DefaultStyle.main2_200 : DefaultStyle.main2_100
visible: mainItem.isLastHovered || mainItem.isSelected || friendPopup.hovered

View file

@ -63,18 +63,18 @@ PopupButton {
colorizationColor: DefaultStyle.main2_600
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
Layout.rightMargin: 8 * DefaultStyle.dp
Layout.rightMargin: Utils.getSizeWithScreenRatio(8)
}
}
}
popup.contentItem: Rectangle {
implicitWidth: Utils.getSizeWithScreenRatio(280)
implicitHeight: 20 * DefaultStyle.dp + (setCustomStatus.visible ? 240 * DefaultStyle.dp : setPresence.implicitHeight)
implicitHeight: Utils.getSizeWithScreenRatio(20) + (setCustomStatus.visible ? Utils.getSizeWithScreenRatio(240) : setPresence.implicitHeight)
Presence {
id: setPresence
visible: !presenceAndRegistrationItem.editCustomStatus
anchors.fill: parent
anchors.margins: 20 * DefaultStyle.dp
anchors.margins: Utils.getSizeWithScreenRatio(20)
accountCore: mainItem.account.core
onSetCustomStatusClicked: {
presenceAndRegistrationItem.editCustomStatus = true
@ -85,7 +85,7 @@ PopupButton {
id: setCustomStatus
visible: presenceAndRegistrationItem.editCustomStatus
anchors.fill: parent
anchors.margins: 20 * DefaultStyle.dp
anchors.margins: Utils.getSizeWithScreenRatio(20)
accountCore: mainItem.account.core
onVisibleChanged: {
if (!visible) {

View file

@ -4,10 +4,11 @@ import QtQuick.Layouts
import Linphone
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Column {
id: mainItem
spacing: 20 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(20)
anchors.centerIn: parent
property var accountCore
signal isSet
@ -21,15 +22,15 @@ Column {
Rectangle {
width: parent.width
height: 150 * DefaultStyle.dp
height: Utils.getSizeWithScreenRatio(150)
color: "transparent"
border.color: DefaultStyle.main1_500_main
border.width: 1 * DefaultStyle.dp
radius: 8 * DefaultStyle.dp
border.width: Utils.getSizeWithScreenRatio(1)
radius: Utils.getSizeWithScreenRatio(8)
ColumnLayout {
anchors.fill: parent
anchors.margins: 10 * DefaultStyle.dp
anchors.margins: Utils.getSizeWithScreenRatio(10)
TextEdit {
id: statusMessage
wrapMode: TextEdit.Wrap
@ -62,7 +63,7 @@ Column {
}
Row {
spacing: 10 * DefaultStyle.dp
spacing: Utils.getSizeWithScreenRatio(10)
anchors.right: parent.right
SmallButton {

View file

@ -5,13 +5,14 @@ import QtQuick.Controls.Basic
import Linphone
import UtilsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Rectangle{
id: mainItem
property int voicemailCount: 0
property bool showMwi: false
width: Math.round(42 * DefaultStyle.dp) * scaleFactor
height: Math.round(36 * DefaultStyle.dp) * scaleFactor
width: Utils.getSizeWithScreenRatio(42 * scaleFactor)
height: Utils.getSizeWithScreenRatio(36 * scaleFactor)
property real scaleFactor: 1.0
signal clicked()
color: 'transparent'
@ -20,7 +21,7 @@ Rectangle{
anchors.left: parent.left
icon.source: AppIcons.voicemail
icon.color: DefaultStyle.main2_600
width: Math.round(33 * DefaultStyle.dp) * scaleFactor
width: Utils.getSizeWithScreenRatio(33 * scaleFactor)
height: width
icon.width: width
icon.height: width
@ -35,7 +36,7 @@ Rectangle{
Text {
anchors.top: parent.top
anchors.right: parent.right
width: Math.round(14 * DefaultStyle.dp) * scaleFactor
width: Utils.getSizeWithScreenRatio(14 * scaleFactor)
height: width
horizontalAlignment: Text.AlignHCenter
font.weight: Typography.p2.weight
@ -51,12 +52,12 @@ Rectangle{
anchors.right: parent.right
color: DefaultStyle.danger_500_main
visible: showMwi && voicemailCount == 0
width: Math.round(14 * DefaultStyle.dp) * scaleFactor
width: Utils.getSizeWithScreenRatio(14 * scaleFactor)
height: width
radius: width / 2
EffectImage {
anchors.fill: parent
anchors.margins: Math.round(1.5 * DefaultStyle.dp) * scaleFactor
anchors.margins: Utils.getSizeWithScreenRatio(1.5 * scaleFactor)
imageSource: AppIcons.bell
colorizationColor: DefaultStyle.grey_0
}

View file

@ -1,9 +1,10 @@
import QtQuick
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Item {
id: mainItem
property real borderWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1)
property real borderWidth: Utils.getSizeWithScreenRatio(1)
property alias borderGradient: border.gradient
property alias gradient: fill.gradient
property alias color: fill.color

View file

@ -9,6 +9,7 @@ import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
@ -74,7 +75,7 @@ ProgressBar {
GradientStop { position: 0.0; color: "#FF9E79" }
GradientStop { position: 1.0; color: "#FE5E00" }
}
radius: Math.round(70 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(70)
}
Rectangle {
id: mask
@ -115,10 +116,10 @@ ProgressBar {
RoundButton {
z: parent.z + 1
anchors.left: parent.left
anchors.leftMargin: Math.round(9 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(9)
anchors.verticalCenter: parent.verticalCenter
icon.width: Math.round(14 * DefaultStyle.dp)
icon.height: Math.round(14 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(14)
icon.height: Utils.getSizeWithScreenRatio(14)
icon.source: animationTest.running
? mainItem.recording
? AppIcons.stopFill
@ -131,25 +132,25 @@ ProgressBar {
}
Control.Control {
anchors.right: parent.right
anchors.rightMargin: Math.round(9 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(9)
anchors.verticalCenter: parent.verticalCenter
leftPadding: Math.round(18 * DefaultStyle.dp)
rightPadding: Math.round(18 * DefaultStyle.dp)
topPadding: Math.round(5 * DefaultStyle.dp)
bottomPadding: Math.round(5 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(18)
rightPadding: Utils.getSizeWithScreenRatio(18)
topPadding: Utils.getSizeWithScreenRatio(5)
bottomPadding: Utils.getSizeWithScreenRatio(5)
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_0
radius: Math.round(50 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(50)
}
contentItem: RowLayout {
spacing: mainItem.recording ? Math.round(5 * DefaultStyle.dp) : 0
spacing: mainItem.recording ? Utils.getSizeWithScreenRatio(5) : 0
EffectImage {
visible: mainItem.recording
colorizationColor: DefaultStyle.danger_500_main
imageSource: AppIcons.recordFill
Layout.preferredWidth: Math.round(14 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(14 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(14)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
}
Text {
id: durationText

View file

@ -18,12 +18,12 @@ ListView {
property ConferenceInfoGui selectedConference
property bool _moveToIndex: false
property bool loading: false
property real busyIndicatorSize: Math.round(60 * DefaultStyle.dp)
property real busyIndicatorSize: Utils.getSizeWithScreenRatio(60)
clip: true
cacheBuffer: height/2
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
highlightFollowsCurrentItem: false
signal meetingDeletionRequested(ConferenceInfoGui confInfo, bool canCancel)
@ -93,13 +93,13 @@ ListView {
}
// Let some space for better UI
footer: Item{height: Math.round(38 * DefaultStyle.dp)}
footer: Item{height: Utils.getSizeWithScreenRatio(38)}
model: ConferenceInfoProxy {
id: confInfoProxy
filterText: searchBarText
filterType: ConferenceInfoProxy.None
initialDisplayItems: Math.max(20, 2 * mainItem.height / (Math.round(63 * DefaultStyle.dp)))
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(63)))
displayItemsStep: initialDisplayItems/2
Component.onCompleted: {
mainItem.loading = !confInfoProxy.accountConnected
@ -137,7 +137,7 @@ ListView {
ScrollBar.vertical: ScrollBar {
id: scrollbar
rightPadding: Math.round(8 * DefaultStyle.dp)
rightPadding: Utils.getSizeWithScreenRatio(8)
active: true
interactive: true
@ -147,14 +147,14 @@ ListView {
section {
criteria: ViewSection.FullString
delegate: Text {
topPadding: Math.round(24 * DefaultStyle.dp)
bottomPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(24)
bottomPadding: Utils.getSizeWithScreenRatio(16)
text: section
height: Math.round(29 * DefaultStyle.dp) + topPadding + bottomPadding
height: Utils.getSizeWithScreenRatio(29) + topPadding + bottomPadding
wrapMode: Text.NoWrap
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
weight: Math.round(800 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Utils.getSizeWithScreenRatio(800)
capitalization: Font.Capitalize
}
}
@ -164,7 +164,7 @@ ListView {
delegate: FocusScope {
id: itemDelegate
visible: !mainItem.loading
height: Math.round(63 * DefaultStyle.dp) + (!isFirst && dateDay.visible ? topOffset : 0)
height: Utils.getSizeWithScreenRatio(63) + (!isFirst && dateDay.visible ? topOffset : 0)
width: mainItem.width
enabled: haveModel
@ -176,7 +176,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 real topOffset: (dateDay.visible && !isFirst? Math.round(8 * DefaultStyle.dp) : 0)
property real topOffset: (dateDay.visible && !isFirst) ? Utils.getSizeWithScreenRatio(8) : 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
@ -188,19 +188,19 @@ ListView {
anchors.topMargin: !itemDelegate.isFirst && dateDay.visible ? itemDelegate.topOffset : 0
spacing: 0
Item{
Layout.preferredWidth: Math.round(32 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(32)
visible: !dateDay.visible
}
ColumnLayout {
id: dateDay
Layout.fillWidth: false
Layout.preferredWidth: Math.round(32 * DefaultStyle.dp)
Layout.minimumWidth: Math.round(32 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(51 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(32)
Layout.minimumWidth: Utils.getSizeWithScreenRatio(32)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(51)
visible: previousDateString.length == 0 || previousDateString != dateString
spacing: 0
Text {
Layout.preferredHeight: Math.round(19 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(19)
Layout.alignment: Qt.AlignCenter
text: day.substring(0,3) + '.'
color: DefaultStyle.main2_500_main
@ -214,8 +214,8 @@ ListView {
}
Rectangle {
id: dayNum
Layout.preferredWidth: Math.round(32 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(32 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(32)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(32)
Layout.alignment: Qt.AlignCenter
radius: height/2
property var isCurrentDay: UtilsCpp.isCurrentDay(dateTime)
@ -230,40 +230,40 @@ ListView {
color: dayNum.isCurrentDay ? DefaultStyle.grey_0 : DefaultStyle.main2_500_main
wrapMode: Text.NoWrap
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
weight: Math.round(800 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Utils.getSizeWithScreenRatio(800)
}
}
}
Item{Layout.fillHeight:true;Layout.fillWidth: true}
}
Item {
Layout.preferredWidth: Math.round(265 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(63 * DefaultStyle.dp)
Layout.leftMargin: Math.round(23 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(265)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(63)
Layout.leftMargin: Utils.getSizeWithScreenRatio(23)
Rectangle {
id: conferenceInfoDelegate
anchors.fill: parent
anchors.rightMargin: 5 // margin to avoid clipping shadows at right
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
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: 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)
anchors.leftMargin: Utils.getSizeWithScreenRatio(16)
anchors.rightMargin: Utils.getSizeWithScreenRatio(16)
anchors.topMargin: Utils.getSizeWithScreenRatio(10)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(10)
spacing: Utils.getSizeWithScreenRatio(2)
visible: itemDelegate.haveModel
RowLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
imageSource: AppIcons.usersThree
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
Text {
text: itemGui.core? itemGui.core.subject : ""
@ -296,14 +296,14 @@ ListView {
}
Text {
anchors.fill: parent
anchors.rightMargin: Math.round(5 * DefaultStyle.dp) // margin to avoid clipping shadows at right
anchors.leftMargin: Math.round(16 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(5) // margin to avoid clipping shadows at right
anchors.leftMargin: Utils.getSizeWithScreenRatio(16)
verticalAlignment: Text.AlignVCenter
visible: !itemDelegate.haveModel
//: "Aucune réunion aujourd'hui"
text: qsTr("meetings_list_no_meeting_for_today")
lineHeightMode: Text.FixedHeight
lineHeight: Math.round(18 * DefaultStyle.dp)
lineHeight: Utils.getSizeWithScreenRatio(18)
font {
pixelSize: Typography.p2.pixelSize
weight: Typography.p2.weight

View file

@ -2,7 +2,8 @@ import QtQuick
import QtQuick.Layouts
import Linphone
import UtilsCpp 1.0
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
@ -10,8 +11,8 @@ ListView {
height: contentHeight
visible: contentHeight > 0
clip: true
rightMargin: Math.round(5 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp)
rightMargin: Utils.getSizeWithScreenRatio(5)
spacing: Utils.getSizeWithScreenRatio(5)
property string searchBarText
@ -31,28 +32,28 @@ ListView {
}
delegate: Item {
height: Math.round(56 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(56)
width: mainItem.width
RowLayout {
id: participantDelegate
anchors.left: parent.left
anchors.leftMargin: Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(10)
anchors.right: parent.right
anchors.rightMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(10)
anchors.verticalCenter: parent.verticalCenter
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
z: 1
Avatar {
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
_address: modelData.core.address
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
shadowEnabled: false
}
Text {
text: modelData.core.displayName
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
maximumLineCount: 1
Layout.fillWidth: true

View file

@ -3,11 +3,12 @@ import QtQuick.Layouts
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
clip: true
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
property bool hoverEnabled: true
property bool displayNameCapitalization: true
@ -26,22 +27,22 @@ ListView {
delegate: Item {
id: participantDelegate
height: Math.round(56 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(56)
width: mainItem.width//mainItem.width
RowLayout {
anchors.fill: parent
anchors.leftMargin: Math.round(18 * DefaultStyle.dp)
anchors.rightMargin: Math.round(18 * DefaultStyle.dp)
spacing: Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(18)
anchors.rightMargin: Utils.getSizeWithScreenRatio(18)
spacing: Utils.getSizeWithScreenRatio(10)
Avatar {
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
_address: modelData.core.sipAddress
shadowEnabled: false
}
Text {
text: modelData.core.displayName
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
maximumLineCount: 1
Layout.fillWidth: true

View file

@ -3,15 +3,16 @@ import QtQuick.Layouts
import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp 1.0
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
visible: contentHeight > 0
clip: true
rightMargin: Math.round(5 * DefaultStyle.dp)
spacing: Math.round(8 * DefaultStyle.dp)
rightMargin: Utils.getSizeWithScreenRatio(5)
spacing: Utils.getSizeWithScreenRatio(8)
property string searchBarText
@ -43,25 +44,25 @@ ListView {
}
delegate: Item {
height: Math.round(56 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(56)
width: mainItem.width
RowLayout {
id: participantDelegate
anchors.fill: parent
anchors.rightMargin: (scrollbar.width + 5 * DefaultStyle.dp)
spacing: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: (scrollbar.width + Utils.getSizeWithScreenRatio(5))
spacing: Utils.getSizeWithScreenRatio(10)
z: 1
Avatar {
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
_address: modelData.core.sipAddress
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
shadowEnabled: false
}
Text {
text: modelData.core.displayName
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
maximumLineCount: 1
Layout.fillWidth: true
@ -71,9 +72,9 @@ ListView {
Layout.alignment: Qt.AlignRight
property bool isMe: modelData.core.isMe
onIsMeChanged: if (isMe) mainItem.me = modelData
spacing: Math.round(26 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(26)
RowLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Text {
visible: mainItem.isMeAdmin || modelData.core.isAdmin
Layout.alignment: Qt.AlignRight
@ -81,8 +82,8 @@ ListView {
text: qsTr("meeting_participant_is_admin_label")
color: DefaultStyle.main2_400
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
Switch {
@ -94,13 +95,13 @@ ListView {
}
SmallButton {
opacity: mainItem.isMeAdmin && !modelData.core.isMe ? 1 : 0
Layout.preferredWidth: Math.round(20 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(20 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
color: DefaultStyle.main2_100
leftPadding: Math.round(3 * DefaultStyle.dp)
rightPadding: Math.round(3 * DefaultStyle.dp)
topPadding: Math.round(3 * DefaultStyle.dp)
bottomPadding: Math.round(3 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(3)
rightPadding: Utils.getSizeWithScreenRatio(3)
topPadding: Utils.getSizeWithScreenRatio(3)
bottomPadding: Utils.getSizeWithScreenRatio(3)
style: ButtonStyle.hoveredBackground
icon.source: AppIcons.closeX
onClicked: participantModel.removeParticipant(modelData.core)

View file

@ -1,11 +1,12 @@
import QtQuick
import QtQuick.Controls.Basic as Control
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.ProgressBar {
id: mainItem
padding: Math.round(3 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(3)
property color backgroundColor: DefaultStyle.main2_100
property color innerColor: DefaultStyle.info_500_main
@ -19,15 +20,15 @@ Control.ProgressBar {
id: textSize
text: mainItem.innerText
font {
pixelSize: Math.round(10 * DefaultStyle.dp)
weight: Math.round(700 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(10)
weight: Utils.getSizeWithScreenRatio(700)
bold: true
}
}
background: Rectangle {
color: mainItem.backgroundColor
radius: Math.round(50 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(50)
anchors.fill: mainItem
width: mainItem.width
height: mainItem.height
@ -37,7 +38,7 @@ Control.ProgressBar {
Rectangle {
id: bar
color: mainItem.innerColor
radius: Math.round(50 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(50)
width: mainItem.barWidth
height: parent.height
}
@ -51,8 +52,8 @@ Control.ProgressBar {
color: mainItem.innerTextColor
maximumLineCount: 1
font {
pixelSize: Math.round(10 * DefaultStyle.dp)
weight: Math.round(700 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(10)
weight: Utils.getSizeWithScreenRatio(700)
}
}
}

View file

@ -2,7 +2,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Shapes
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ProgressBar{
id: mainItem
@ -22,9 +22,9 @@ ProgressBar{
Shape {
id: shape
anchors.fill: parent
anchors.margins: Math.round(2 * DefaultStyle.dp)
anchors.margins: Utils.getSizeWithScreenRatio(2)
property real progressionRadius : Math.min(shape.width / 2, shape.height / 2) - Math.round(3 * DefaultStyle.dp) / 2
property real progressionRadius : Math.round(Math.min(shape.width / 2, shape.height / 2) - Utils.getSizeWithScreenRatio(3) / 2)
layer.enabled: true
layer.samples: 8
@ -35,14 +35,14 @@ ProgressBar{
id: pathDial
strokeColor: DefaultStyle.main1_100
fillColor: 'transparent'
strokeWidth: Math.round(3 * DefaultStyle.dp)
strokeWidth: Utils.getSizeWithScreenRatio(3)
capStyle: Qt.RoundCap
PathAngleArc {
radiusX: shape.progressionRadius
radiusY: shape.progressionRadius
centerX: shape.width / 2
centerY: shape.height / 2
centerX: Math.round(shape.width / 2)
centerY: Math.round(shape.height / 2)
startAngle: -90 // top start
sweepAngle: 360
}
@ -52,14 +52,14 @@ ProgressBar{
id: pathProgress
strokeColor: DefaultStyle.main1_500_main
fillColor: 'transparent'
strokeWidth: Math.round(3 * DefaultStyle.dp)
strokeWidth: Utils.getSizeWithScreenRatio(3)
capStyle: Qt.RoundCap
PathAngleArc {
radiusX: shape.progressionRadius
radiusY: shape.progressionRadius
centerX: shape.width / 2
centerY: shape.height / 2
centerX: Math.round(shape.width / 2)
centerY: Math.round(shape.height / 2)
startAngle: -90 // top start
sweepAngle: (360/ mainItem.to * mainItem.value)
}

View file

@ -1,15 +1,16 @@
import QtQuick
import QtQuick.Controls.Basic as Control
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.Control {
id: mainItem
// width: Math.round(360 * DefaultStyle.dp)
// width: Utils.getSizeWithScreenRatio(360)
property color backgroundColor: DefaultStyle.grey_0
padding: Math.round(10 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(10)
background: Rectangle {
anchors.fill: parent
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
color: mainItem.backgroundColor
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// Display a sticker from a call or from an account.
// The Avatar is shown while the camera become available.
@ -25,7 +26,7 @@ Item {
property bool displayBorder : participantDevice && participantDevice.core.isSpeaking || false
property alias displayPresence: avatar.displayPresence
property color color: DefaultStyle.grey_600
property real radius: Math.round(15 * DefaultStyle.dp)
property real radius: Utils.getSizeWithScreenRatio(15)
property bool remoteIsPaused: participantDevice
? participantDevice.core.isPaused
: previewEnabled
@ -74,7 +75,7 @@ Item {
radius: mainItem.radius
anchors.fill: parent
border.color: DefaultStyle.main2_200
border.width: mainItem.displayBorder ? Math.round(3 * DefaultStyle.dp) : 0
border.width: mainItem.displayBorder ? Utils.getSizeWithScreenRatio(3) : 0
property real minSize: Math.min(height, width)
Item {
id: noCameraLayout
@ -82,7 +83,7 @@ Item {
visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady
ColumnLayout {
anchors.top: parent.top
anchors.topMargin: Math.round(81 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(81)
anchors.horizontalCenter: parent.horizontalCenter
// Layout.alignment: Qt.AlignHCenter |Qt.AlignTop
spacing: 0
@ -94,8 +95,8 @@ Item {
BusyIndicator {
indicatorColor: DefaultStyle.main2_100
Layout.alignment: Qt.AlignHCenter
indicatorHeight: Math.round(42 * DefaultStyle.dp)
indicatorWidth: Math.round(42 * DefaultStyle.dp)
indicatorHeight: Utils.getSizeWithScreenRatio(42)
indicatorWidth: Utils.getSizeWithScreenRatio(42)
}
}
Item{
@ -104,7 +105,7 @@ Item {
anchors.centerIn: parent
height: mainItem.conference
? background.minSize * 142 / 372
: Math.round(120 * DefaultStyle.dp)
: Utils.getSizeWithScreenRatio(120)
width: height
Avatar{
id: avatar
@ -122,30 +123,30 @@ Item {
spacing: 0
visible: mainItem.participantDevice && (mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Joining || mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Alerting) || false
BusyIndicator {
Layout.preferredHeight: Math.round(42 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(42)
indicatorColor: DefaultStyle.main2_100
Layout.alignment: Qt.AlignHCenter
indicatorHeight: Math.round(42 * DefaultStyle.dp)
indicatorWidth: Math.round(42 * DefaultStyle.dp)
indicatorHeight: Utils.getSizeWithScreenRatio(42)
indicatorWidth: Utils.getSizeWithScreenRatio(42)
}
Text {
Layout.preferredHeight: Math.round(27 * DefaultStyle.dp)
Layout.topMargin: Math.round(15 * DefaultStyle.dp) // (84-27)-42
Layout.preferredHeight: Utils.getSizeWithScreenRatio(27)
Layout.topMargin: Utils.getSizeWithScreenRatio(15) // (84-27)-42
//: "rejoint"
text: qsTr("conference_participant_joining_text")
color: DefaultStyle.grey_0
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
}
ColumnLayout {
anchors.centerIn: parent
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
visible: mainItem.remoteIsPaused
EffectImage {
imageSource: AppIcons.pause
@ -160,8 +161,8 @@ Item {
//: "En pause"
text: qsTr("conference_participant_paused_text")
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
@ -169,7 +170,7 @@ Item {
spacing: 0
visible: mainItem.displayAll && !mainItem.remoteIsPaused && !mainItem.conference
anchors.top: centerItem.bottom
anchors.topMargin: Math.round(21 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(21)
anchors.left: parent.left
anchors.right: parent.right
@ -179,8 +180,8 @@ Item {
text: mainItem.displayName
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(22 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(22)
weight: Utils.getSizeWithScreenRatio(300)
capitalization: Font.Capitalize
}
}
@ -191,8 +192,8 @@ Item {
text: SettingsCpp.hideSipAddresses ? UtilsCpp.getUsername(_text) : _text
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(14 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(14)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}
@ -255,9 +256,9 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.leftMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: Math.round(10 * DefaultStyle.dp)
anchors.bottomMargin: Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(10)
anchors.rightMargin: Utils.getSizeWithScreenRatio(10)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(10)
width: implicitWidth
maximumLineCount: 1
property string _text: mainItem.displayName != ''
@ -268,8 +269,8 @@ Item {
text: SettingsCpp.hideSipAddresses ? UtilsCpp.getUsername(_text) : _text
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(14 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(14)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
@ -286,22 +287,22 @@ Item {
RowLayout{
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: Math.round(8 * DefaultStyle.dp)
anchors.topMargin: Math.round(8 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(8)
anchors.topMargin: Utils.getSizeWithScreenRatio(8)
height: Math.round(18 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(18)
spacing: 0
Rectangle {
id: muteIcon
Layout.preferredWidth: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp))
Layout.preferredHeight: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp))
Layout.preferredWidth: Math.min(Math.round(mainItem.width / 16), Utils.getSizeWithScreenRatio(20))
Layout.preferredHeight: Math.min(Math.round(mainItem.width / 16), Utils.getSizeWithScreenRatio(20))
visible: mainItem.mutedStatus
color: DefaultStyle.grey_0
radius: width /2
EffectImage {
anchors.centerIn: parent
imageWidth: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp))
imageHeight: Math.min(mainItem.width / 16, Math.round(20 * DefaultStyle.dp))
imageWidth: Math.min(Math.round(mainItem.width / 16),Utils.getSizeWithScreenRatio(20))
imageHeight: Math.min(Math.round(mainItem.width / 16),Utils.getSizeWithScreenRatio(20))
imageSource: AppIcons.microphoneSlash
colorizationColor: DefaultStyle.main2_500_main
}

View file

@ -1,6 +1,7 @@
import QtQuick as Quick
import QtQuick.Layouts
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Quick.Text {
id: mainItem
@ -8,7 +9,7 @@ Quick.Text {
width: txtMeter.advanceWidth
font {
family: DefaultStyle.defaultFont
pixelSize: Math.round(10 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(10)
weight: Typography.p1.weight
}
color: DefaultStyle.main2_600

View file

@ -1,7 +1,8 @@
import QtQuick
import QtQuick.Controls.Basic as Control
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.ToolTip {
id: mainItem
delay: 1000
@ -10,7 +11,7 @@ Control.ToolTip {
id: tooltipBackground
opacity: 0.7
color: DefaultStyle.main2_200
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
}
contentItem: Text {
text: mainItem.text

View file

@ -3,6 +3,7 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import SettingsCpp 1.0
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope {
id: mainItem
@ -12,11 +13,11 @@ FocusScope {
ColumnLayout {
anchors.fill: parent
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)
anchors.topMargin: Utils.getSizeWithScreenRatio(16)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(16)
anchors.leftMargin: Utils.getSizeWithScreenRatio(17)
anchors.rightMargin: Utils.getSizeWithScreenRatio(17)
spacing: Utils.getSizeWithScreenRatio(12)
RoundedPane {
Layout.fillWidth: true
@ -32,9 +33,9 @@ FocusScope {
id: radiobutton
checkOnClick: false
color: DefaultStyle.main1_500_main
indicatorSize: Math.round(20 * DefaultStyle.dp)
indicatorSize: Utils.getSizeWithScreenRatio(20)
leftPadding: indicator.width + spacing
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
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
@ -44,11 +45,11 @@ FocusScope {
onClicked: mainItem.changeLayoutRequested(index)
contentItem: RowLayout {
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
EffectImage {
id: radioButtonImg
Layout.preferredWidth: Math.round(32 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(32 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(32)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(32)
imageSource: modelData.imgUrl
colorizationColor: DefaultStyle.main2_500_main
}
@ -56,7 +57,7 @@ FocusScope {
text: modelData.text
color: DefaultStyle.main2_500_main
verticalAlignment: Text.AlignVCenter
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
Layout.fillWidth: true
}
}

View file

@ -86,7 +86,7 @@ ColumnLayout {
implicitHeight: parent.height
Layout.alignment: Qt.AlignCenter
indicatorColor: DefaultStyle.grey_0
indicatorWidth: Math.round(25 * DefaultStyle.dp)
indicatorWidth: Utils.getSizeWithScreenRatio(25)
}
Connections {
target: LoginPageCpp

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts
import Linphone
import SettingsCpp 1.0
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
@ -11,32 +12,32 @@ ColumnLayout {
property var call
RoundedPane {
Layout.fillWidth: true
leftPadding: Math.round(16 * DefaultStyle.dp)
rightPadding: Math.round(16 * DefaultStyle.dp)
topPadding: Math.round(13 * DefaultStyle.dp)
bottomPadding: Math.round(13 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(16)
rightPadding: Utils.getSizeWithScreenRatio(16)
topPadding: Utils.getSizeWithScreenRatio(13)
bottomPadding: Utils.getSizeWithScreenRatio(13)
contentItem: ColumnLayout {
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
Text {
//: "Encryption :"
text: qsTr("call_stats_media_encryption_title")
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Typography.p2.weight
}
}
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
spacing: Math.round(7 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(7)
Text {
property bool isPostQuantum: mainItem.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && mainItem.call.core.zrtpStats.isPostQuantum
//: Media encryption : %1
text: qsTr("call_stats_media_encryption").arg(mainItem.call.core.encryptionString)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
ColumnLayout {
@ -46,8 +47,8 @@ ColumnLayout {
text: qsTr("call_stats_zrtp_cipher_algo").arg(mainItem.call && mainItem.call.core.zrtpStats.cipherAlgo)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
@ -55,8 +56,8 @@ ColumnLayout {
text: qsTr("call_stats_zrtp_key_agreement_algo").arg(mainItem.call && mainItem.call.core.zrtpStats.keyAgreementAlgo)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
@ -64,8 +65,8 @@ ColumnLayout {
text: qsTr("call_stats_zrtp_hash_algo").arg(mainItem.call && mainItem.call.core.zrtpStats.hashAlgo)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
@ -73,8 +74,8 @@ ColumnLayout {
text: qsTr("call_stats_zrtp_auth_tag_algo").arg(mainItem.call && mainItem.call.core.zrtpStats.authenticationAlgo)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
Text {
@ -82,8 +83,8 @@ ColumnLayout {
text: qsTr("call_stats_zrtp_sas_algo").arg(mainItem.call && mainItem.call.core.zrtpStats.sasAlgo)
Layout.alignment: Qt.AlignHCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
@ -97,9 +98,9 @@ ColumnLayout {
//: "Validation chiffrement"
text: qsTr("call_zrtp_validation_button_label")
onClicked: mainItem.encryptionValidationRequested()
Layout.bottomMargin: Math.round(13 * DefaultStyle.dp)
Layout.leftMargin: Math.round(16 * DefaultStyle.dp)
Layout.rightMargin: Math.round(16 * DefaultStyle.dp)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(13)
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
Layout.rightMargin: Utils.getSizeWithScreenRatio(16)
style: ButtonStyle.main
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp 1.0
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
@ -14,21 +15,21 @@ ColumnLayout {
property bool isLocalScreenSharing : conference?.core.isLocalScreenSharing || false
property bool screenSharingAvailable: !!conference && (!conference.core.isScreenSharingEnabled || isLocalScreenSharing)
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
onIsLocalScreenSharingChanged: {if(isLocalScreenSharing) mainItem.call.core.videoSourceDescriptor = mainItem.desc }
Text {
Layout.fillWidth: true
//: "Veuillez choisir lécran ou la fenêtre que vous souihaitez partager au autres participants"
text: qsTr("screencast_settings_choose_window_text")
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
color: DefaultStyle.main2_500_main
}
TabBar {
Layout.fillWidth: true
id: bar
spacing: Math.round(40 * DefaultStyle.dp)
pixelSize: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(40)
pixelSize: Utils.getSizeWithScreenRatio(16)
//: "Ecran entier"
model: [qsTr("screencast_settings_all_screen_label"),
//: "Fenêtre"
@ -42,18 +43,18 @@ ColumnLayout {
property bool selected: false
property bool displayScreen: true
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)
leftPadding: Utils.getSizeWithScreenRatio(18)
rightPadding: Utils.getSizeWithScreenRatio(18)
topPadding: Utils.getSizeWithScreenRatio(13)
bottomPadding: Utils.getSizeWithScreenRatio(13)
background: Rectangle {
anchors.fill: parent
anchors.leftMargin: screenPreview.horizontalMargin
anchors.rightMargin: screenPreview.horizontalMargin
color: screenPreview.selected ? DefaultStyle.main2_100 : DefaultStyle.grey_0
border.width: Math.round(2 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(2)
border.color: screenPreview.selected ? DefaultStyle.main2_400 : DefaultStyle.main2_200
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
MouseArea {
anchors.fill: parent
onClicked: {
@ -68,7 +69,7 @@ ColumnLayout {
Layout.fillHeight: true
Image {
anchors.centerIn: parent
//Layout.preferredHeight: Math.round(170 * DefaultStyle.dp)
//Layout.preferredHeight: Utils.getSizeWithScreenRatio(170)
source: $modelData?.windowId ? "image://window/"+ $modelData.windowId : "image://screen/"+ $modelData.screenIndex
sourceSize.width: parent.width
sourceSize.height: parent.height
@ -76,11 +77,11 @@ ColumnLayout {
}
}
RowLayout{
Layout.topMargin: Math.round(6 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(6)
spacing: Utils.getSizeWithScreenRatio(5)
Image{
Layout.preferredHeight: Math.round(15 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(15 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(15)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(15)
visible: !!$modelData?.windowId
source: visible ? "image://window_icon/"+ $modelData.windowId : ''
sourceSize.width: width
@ -92,7 +93,7 @@ ColumnLayout {
//: "Ecran %1"
text: !!$modelData?.windowId ? $modelData.name : qsTr("screencast_settings_screen").arg(screenIndex+1)
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Math.round((displayScreen ? 14 : 10) * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(displayScreen ? 14 : 10)
elide: Text.ElideRight
maximumLineCount: 1
}
@ -104,7 +105,7 @@ ColumnLayout {
currentIndex: bar.currentIndex
ListView{
id: screensLayout
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
clip: true
Layout.fillWidth: true
height: visible ? contentHeight : 0
@ -118,9 +119,9 @@ ColumnLayout {
else currentIndex = -1
}
delegate: ScreenPreviewLayout {
horizontalMargin: Math.round((28 - 20 ) * DefaultStyle.dp) // 20 coming from CallsWindow panel
horizontalMargin: Utils.getSizeWithScreenRatio(28 - 20 ) // 20 coming from CallsWindow panel
width: screensLayout.width
height: Math.round(219 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(219)
screenIndex: index
onClicked: {//screensLayout.selectedIndex = index
screensLayout.currentIndex = index
@ -147,14 +148,14 @@ ColumnLayout {
else currentIndex = -1
}
cellWidth: width / 2
cellHeight: Math.round((112 + 15) * DefaultStyle.dp)
cellHeight: Utils.getSizeWithScreenRatio(112 + 15)
clip: true
delegate: Item {
width: windowsLayout.cellWidth
height: windowsLayout.cellHeight
ScreenPreviewLayout {
anchors.fill: parent
anchors.margins: Math.round(7 * DefaultStyle.dp)
anchors.margins: Utils.getSizeWithScreenRatio(7)
displayScreen: false
screenIndex: index
onClicked: {

View file

@ -7,6 +7,7 @@ import Linphone
import ConstantsCpp 1.0
import UtilsCpp 1.0
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ListView {
id: mainItem
@ -40,10 +41,10 @@ ListView {
ColumnLayout {
anchors.fill: parent
property int currentMonth: model.month
spacing: Math.round(18 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(18)
RowLayout {
Layout.fillWidth: true
spacing: Math.round(38 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(38)
Text {
text: UtilsCpp.toDateMonthAndYearString(new Date(model.year, model.month, 15))// 15 because of timezones that can change the date for localeString
font {
@ -57,8 +58,8 @@ ListView {
}
Button {
id: previousButton
Layout.preferredWidth: Math.round(20 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(20 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
icon.width: width
icon.height: height
style: ButtonStyle.noBackground
@ -67,8 +68,8 @@ ListView {
}
Button {
id: nextButton
Layout.preferredWidth: Math.round(20 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(20 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
icon.width: width
icon.height: height
style: ButtonStyle.noBackground
@ -78,7 +79,7 @@ ListView {
}
ColumnLayout {
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
Control.DayOfWeekRow {
locale: monthGrid.locale
Layout.column: 1
@ -89,8 +90,8 @@ ListView {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}
@ -146,9 +147,9 @@ ListView {
Rectangle {
anchors.centerIn: parent
width: Math.round(30 * DefaultStyle.dp)
height: Math.round(30 * DefaultStyle.dp)
radius: Math.round(50 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(30)
height: Utils.getSizeWithScreenRatio(30)
radius: Utils.getSizeWithScreenRatio(50)
color: isSelectedDay ? DefaultStyle.main1_500_main : "transparent"
border.width: focusDay.activeFocus || hoveringArea.containsMouse ? 1 : 0
@ -164,8 +165,8 @@ ListView {
? DefaultStyle.main2_700
: DefaultStyle.main2_400
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}

View file

@ -58,10 +58,10 @@ Control.Control {
// width: mainItem.implicitWidth
// height: mainItem.height
leftPadding: Math.round(15 * DefaultStyle.dp)
rightPadding: Math.round(15 * DefaultStyle.dp)
topPadding: Math.round(16 * DefaultStyle.dp)
bottomPadding: Math.round(16 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(15)
rightPadding: Utils.getSizeWithScreenRatio(15)
topPadding: Utils.getSizeWithScreenRatio(16)
bottomPadding: Utils.getSizeWithScreenRatio(16)
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_100
@ -75,13 +75,13 @@ Control.Control {
Component {
id: textAreaComp
RowLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
PopupButton {
id: emojiPickerButton
style: ButtonStyle.noBackground
icon.source: checked ? AppIcons.closeX : AppIcons.smiley
popup.width: Math.round(393 * DefaultStyle.dp)
popup.height: Math.round(291 * DefaultStyle.dp)
popup.width: Utils.getSizeWithScreenRatio(393)
popup.height: Utils.getSizeWithScreenRatio(291)
popup.contentItem: EmojiPicker {
editor: sendingTextArea
}
@ -100,14 +100,14 @@ Control.Control {
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
leftPadding: Math.round(24 * DefaultStyle.dp)
rightPadding: Math.round(20 * DefaultStyle.dp)
topPadding: Math.round(12 * DefaultStyle.dp)
bottomPadding: Math.round(12 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(24)
rightPadding: Utils.getSizeWithScreenRatio(20)
topPadding: Utils.getSizeWithScreenRatio(12)
bottomPadding: Utils.getSizeWithScreenRatio(12)
background: Rectangle {
id: inputBackground
anchors.fill: parent
radius: Math.round(35 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(35)
color: DefaultStyle.grey_0
MouseArea {
anchors.fill: parent
@ -118,7 +118,7 @@ Control.Control {
contentItem: RowLayout {
Flickable {
id: sendingAreaFlickable
Layout.preferredHeight: Math.min(Math.round(100 * DefaultStyle.dp), contentHeight)
Layout.preferredHeight: Math.min(Utils.getSizeWithScreenRatio(100), contentHeight)
Layout.fillHeight: true
width: sendingControl.width - sendingControl.leftPadding - sendingControl.rightPadding
Layout.fillWidth: true
@ -215,15 +215,15 @@ Control.Control {
Component {
id: voiceMessageRecordComp
RowLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
RoundButton {
style: ButtonStyle.player
shadowEnabled: true
padding: Math.round(4 * DefaultStyle.dp)
icon.width: Math.round(22 * DefaultStyle.dp)
icon.height: Math.round(22 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(4)
icon.width: Utils.getSizeWithScreenRatio(22)
icon.height: Utils.getSizeWithScreenRatio(22)
icon.source: AppIcons.closeX
width: Math.round(30 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(30)
Layout.preferredWidth: width
Layout.preferredHeight: height
onClicked: {
@ -238,7 +238,7 @@ Control.Control {
}
recording: true
Layout.fillWidth: true
Layout.preferredHeight: Math.round(48 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(48)
chatMessageContentGui: chatMessage ? chatMessage.core.getVoiceRecordingContent() : null
onVoiceRecordingMessageCreationRequested: (recorderGui) => {
chatMessageObj = UtilsCpp.createVoiceRecordingMessage(recorderGui, mainItem.chat)
@ -248,8 +248,8 @@ Control.Control {
id: sendButton
style: ButtonStyle.noBackgroundOrange
icon.source: AppIcons.paperPlaneRight
icon.width: Math.round(22 * DefaultStyle.dp)
icon.height: Math.round(22 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(22)
icon.height: Utils.getSizeWithScreenRatio(22)
// Layout.preferredWidth: icon.width
// Layout.preferredHeight: icon.height
property bool sendVoiceRecordingOnCreated: false
@ -283,13 +283,13 @@ Control.Control {
anchors.fill: parent
color: DefaultStyle.main2_0
visible: false
radius: Math.round(20 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(20)
EffectImage {
anchors.centerIn: parent
imageSource: AppIcons.filePlus
width: Math.round(37 * DefaultStyle.dp)
height: Math.round(37 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(37)
height: Utils.getSizeWithScreenRatio(37)
colorizationColor: DefaultStyle.main2_500_main
}

View file

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Effects
import UtilsCpp
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FormItemLayout {
id: mainItem
@ -39,7 +40,7 @@ FormItemLayout {
contentItem: TextField {
id: textField
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
placeholderText: useTitleAsPlaceHolder ? mainItem.title : mainItem.placeHolder
initialText: (mainItem.propertyOwnerGui ? mainItem.propertyOwnerGui.core[mainItem.propertyName] : mainItem.propertyOwner[mainItem.propertyName]) || ''
customWidth: mainItem.parent.width

View file

@ -1,10 +1,11 @@
import QtQuick
import QtQuick.Controls.Basic as Control
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.TextField {
id: mainItem
property real inputSize: Math.round(100 * DefaultStyle.dp)
property real inputSize: Utils.getSizeWithScreenRatio(100)
color: activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500_main
validator: IntValidator{bottom: 0; top: 9}
@ -24,7 +25,7 @@ Control.TextField {
// horizontalAlignment: Control.TextField.AlignHCenter
font.family: DefaultStyle.defaultFont
font.pixelSize: inputSize / 2
font.weight: Math.round(300 * DefaultStyle.dp)
font.weight: Utils.getSizeWithScreenRatio(300)
background: Item {
anchors.fill: parent
@ -32,7 +33,7 @@ Control.TextField {
// height: mainItem.inputSize
Rectangle {
id: background
border.width: Math.round(Math.max(DefaultStyle.dp), 1)
border.width: Utils.getSizeWithScreenRatio(1)
border.color: mainItem.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500_main
radius: mainItem.inputSize * 0.15
width: mainItem.inputSize * 0.9
@ -42,11 +43,11 @@ Control.TextField {
id: indicator
visible: mainItem.activeFocus
color: DefaultStyle.main1_500_main
height : Math.max(1, Math.round(1 * DefaultStyle.dp))
height : Utils.getSizeWithScreenRatio(1)
width: mainItem.inputSize * 0.67
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Math.round((mainItem.inputSize / 8) * DefaultStyle.dp)
anchors.bottomMargin: Utils.getSizeWithScreenRatio(mainItem.inputSize / 8)
}
}
}

View file

@ -5,6 +5,7 @@ import QtQuick.Effects
import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope {
id: mainItem
@ -90,8 +91,8 @@ FocusScope {
Layout.GridLayout {
id: numPadGrid
columns: 3
columnSpacing: Math.round(40 * DefaultStyle.dp)
rowSpacing: Math.round(10 * DefaultStyle.dp)
columnSpacing: Utils.getSizeWithScreenRatio(40)
rowSpacing: Utils.getSizeWithScreenRatio(10)
function getButtonAt(index){
index = (index+15) % 15
if(index >= 0){
@ -113,8 +114,8 @@ FocusScope {
id: numPadButton
Layout.Layout.alignment: Qt.AlignHCenter
required property int index
implicitWidth: Math.round(60 * DefaultStyle.dp)
implicitHeight: Math.round(60 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(60)
implicitHeight: Utils.getSizeWithScreenRatio(60)
onClicked: {
mainItem.buttonPressed(text)
}
@ -123,10 +124,10 @@ FocusScope {
KeyNavigation.up: numPadGrid.getButtonAt(index - 3)
KeyNavigation.down: numPadGrid.getButtonAt(index + 3)
style: ButtonStyle.numericPad
radius: Math.round(71 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(71)
text: index + 1
textSize: Math.round(32 * DefaultStyle.dp)
textWeight: Math.round(400 * DefaultStyle.dp)
textSize: Utils.getSizeWithScreenRatio(32)
textWeight: Utils.getSizeWithScreenRatio(400)
}
}
Repeater {
@ -139,8 +140,8 @@ FocusScope {
BigButton {
id: digitButton
Layout.Layout.alignment: Qt.AlignHCenter
implicitWidth: Math.round(60 * DefaultStyle.dp)
implicitHeight: Math.round(60 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(60)
implicitHeight: Utils.getSizeWithScreenRatio(60)
onClicked: mainItem.buttonPressed(pressText.text)
onPressAndHold: mainItem.buttonPressed(longPressText.text)
@ -149,7 +150,7 @@ FocusScope {
KeyNavigation.right: numPadGrid.getButtonAt((index + 1)+9)
KeyNavigation.up: numPadGrid.getButtonAt((index - 3)+9)
KeyNavigation.down: numPadGrid.getButtonAt((index + 3)+9)
radius: Math.round(71 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(71)
style: ButtonStyle.numericPad
contentItem: Item {
@ -163,7 +164,7 @@ FocusScope {
horizontalAlignment: Text.AlignHCenter
Component.onCompleted: {if (modelData.longPressText === undefined) anchors.centerIn= parent}
text: modelData.pressText
font.pixelSize: Math.round(32 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(32)
}
Text {
id: longPressText
@ -175,7 +176,7 @@ FocusScope {
horizontalAlignment: Text.AlignHCenter
visible: modelData.longPressText ? modelData.longPressText.length > 0 : false
text: modelData.longPressText ? modelData.longPressText : ""
font.pixelSize: Math.round(22 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(22)
}
}
}
@ -187,12 +188,12 @@ FocusScope {
Button {
id: launchCallButton
visible: mainItem.lastRowVisible
implicitWidth: Math.round(75 * DefaultStyle.dp)
implicitHeight: Math.round(55 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(75)
implicitHeight: Utils.getSizeWithScreenRatio(55)
Layout.Layout.alignment: Qt.AlignHCenter
icon.width: Math.round(32 * DefaultStyle.dp)
icon.height: Math.round(32 * DefaultStyle.dp)
radius: Math.round(71 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(32)
icon.height: Utils.getSizeWithScreenRatio(32)
radius: Utils.getSizeWithScreenRatio(71)
style: ButtonStyle.phoneGreen
onClicked: mainItem.launchCall()
@ -205,17 +206,17 @@ FocusScope {
Button {
id: eraseButton
visible: mainItem.lastRowVisible
leftPadding: Math.round(5 * DefaultStyle.dp)
rightPadding: Math.round(5 * DefaultStyle.dp)
topPadding: Math.round(5 * DefaultStyle.dp)
bottomPadding: Math.round(5 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(5)
rightPadding: Utils.getSizeWithScreenRatio(5)
topPadding: Utils.getSizeWithScreenRatio(5)
bottomPadding: Utils.getSizeWithScreenRatio(5)
Layout.Layout.alignment: Qt.AlignHCenter
icon.source: AppIcons.backspaceFill
style: ButtonStyle.noBackground
icon.width: Math.round(38 * DefaultStyle.dp)
icon.height: Math.round(38 * DefaultStyle.dp)
Layout.Layout.preferredWidth: Math.round(38 * DefaultStyle.dp)
Layout.Layout.preferredHeight: Math.round(38 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(38)
icon.height: Utils.getSizeWithScreenRatio(38)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(38)
Layout.Layout.preferredHeight: Utils.getSizeWithScreenRatio(38)
onClicked: mainItem.wipe()

View file

@ -3,7 +3,8 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import CustomControls 1.0
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout {
id: mainItem
@ -19,7 +20,7 @@ ColumnLayout {
property string defaultCallingCode
property bool keyboardFocus: FocusHelper.keyboardFocus
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
Text {
visible: label.length > 0
@ -34,12 +35,12 @@ ColumnLayout {
Control.Control {
Layout.preferredWidth: mainItem.width
Layout.preferredHeight: Math.round(49 * DefaultStyle.dp)
leftPadding: Math.round(16 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(49)
leftPadding: Utils.getSizeWithScreenRatio(16)
background: Rectangle {
id: contentBackground
anchors.fill: parent
radius: Math.round(63 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(63)
color: DefaultStyle.grey_100
border.color: mainItem.errorMessage.length > 0
? DefaultStyle.danger_500_main
@ -50,7 +51,7 @@ ColumnLayout {
contentItem: RowLayout {
CountryIndicatorCombobox {
id: combobox
implicitWidth: Math.round(110 * DefaultStyle.dp)
implicitWidth: Utils.getSizeWithScreenRatio(110)
Layout.fillHeight: true
defaultCallingCode: mainItem.defaultCallingCode
property bool keyboardFocus: FocusHelper.keyboardFocus
@ -58,10 +59,10 @@ ColumnLayout {
Accessible.name: qsTr("prefix_phone_number_accessible_name").arg(mainItem.Accessible.name)
}
Rectangle {
Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(1)
Layout.fillHeight: true
Layout.topMargin: Math.round(10 * DefaultStyle.dp)
Layout.bottomMargin: Math.round(10 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(10)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(10)
color: DefaultStyle.main2_600
}
TextField {
@ -80,7 +81,7 @@ ColumnLayout {
TemporaryText {
id: errorText
Layout.fillWidth: true
Layout.topMargin: Math.round(-3 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(-3)
// visible: mainItem.enableErrorText
text: mainItem.errorMessage
color: DefaultStyle.danger_500_main
@ -88,7 +89,7 @@ ColumnLayout {
elide: Text.ElideRight
wrapMode: Text.Wrap
font {
pixelSize: Math.round(13 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(13)
family: DefaultStyle.defaultFont
bold: true
}

View file

@ -25,7 +25,7 @@ FocusScope {
// Text properties
property string placeholderText: ""
property color placeholderTextColor: DefaultStyle.main2_400
property real textInputWidth: Math.round(350 * DefaultStyle.dp)
property real textInputWidth: Utils.getSizeWithScreenRatio(350)
property string text: textField.searchText
signal openNumericPadRequested()// Useful for redirection before displaying numeric pad.
@ -45,12 +45,12 @@ FocusScope {
implicitWidth: mainItem.textInputWidth
implicitHeight: Math.round(50 * DefaultStyle.dp)
implicitHeight: Utils.getSizeWithScreenRatio(50)
Rectangle{
id: backgroundItem
anchors.fill: parent
radius: Math.round(28 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(28)
color: DefaultStyle.grey_100
border.color: textField.keyboardFocus ? mainItem.keyboardFocusedBorderColor : textField.activeFocus ? mainItem.focusedBorderColor : mainItem.borderColor
border.width: textField.keyboardFocus ? mainItem.keyboardFocusedBorderWidth : mainItem.borderWidth
@ -61,15 +61,15 @@ FocusScope {
colorizationColor: DefaultStyle.main2_500_main
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(10)
imageSource: AppIcons.magnifier
width: Math.round(20 * DefaultStyle.dp)
height: Math.round(20 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(20)
height: Utils.getSizeWithScreenRatio(20)
}
Control.TextField {
id: textField
anchors.left: magnifier.visible ? magnifier.right : parent.left
anchors.leftMargin: magnifier.visible ? 0 : Math.round(10 * DefaultStyle.dp)
anchors.leftMargin: magnifier.visible ? 0 : Utils.getSizeWithScreenRatio(10)
anchors.right: clearTextButton.left
anchors.verticalCenter: parent.verticalCenter
property bool keyboardFocus: FocusHelper.keyboardFocus
@ -96,7 +96,7 @@ FocusScope {
cursorDelegate: Rectangle {
visible: textField.cursorVisible
color: DefaultStyle.main2_500_main
width: Math.max(Math.round(1 * DefaultStyle.dp), 1)
width: Utils.getSizeWithScreenRatio(1)
}
Timer{
id: delayTimer
@ -113,13 +113,13 @@ FocusScope {
icon.source: AppIcons.dialer
contentImageColor: checked ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
hoveredImageColor: contentImageColor
width: Math.round(30 * DefaultStyle.dp)
height: Math.round(30* DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(30)
height: Utils.getSizeWithScreenRatio(30)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Math.round(20 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(20)
//: "Open dialer"
Accessible.name: qsTr("open_dialer_acccessibility_label")
onClicked: {
@ -132,14 +132,14 @@ FocusScope {
Button {
id: clearTextButton
visible: textField.text.length > 0 && mainItem.enabled
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
style: ButtonStyle.noBackground
icon.source: AppIcons.closeX
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: Math.round(20 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(20)
//: "Clear text input"
Accessible.name: qsTr("clear_text_input_acccessibility_label")
onClicked: {

View file

@ -3,6 +3,7 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
TextEdit {
id: mainItem
@ -14,8 +15,8 @@ TextEdit {
property alias background: background.data
property bool hoverEnabled: true
property bool hovered: mouseArea.hoverEnabled && mouseArea.containsMouse
topPadding: Math.round(5 * DefaultStyle.dp)
bottomPadding: Math.round(5 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(5)
bottomPadding: Utils.getSizeWithScreenRatio(5)
activeFocusOnTab: true
KeyNavigation.priority: KeyNavigation.BeforeItem

View file

@ -9,7 +9,7 @@ import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
Control.TextField {
id: mainItem
property var customWidth
width: Math.round((customWidth ? customWidth - 1 : 360) * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(customWidth ? customWidth - 1 : 360)
height: Utils.getSizeWithScreenRatio(49)
leftPadding: Utils.getSizeWithScreenRatio(15)
rightPadding: eyeButton.visible
@ -136,7 +136,7 @@ Control.TextField {
cursorDelegate: Rectangle {
id: cursor
color: DefaultStyle.main1_500_main
width: Math.max(Utils.getSizeWithScreenRatio(1), 1)
width: Utils.getSizeWithScreenRatio(1)
anchors.verticalCenter: mainItem.verticalCenter
SequentialAnimation {

View file

@ -1,10 +1,11 @@
import QtQuick
import Linphone
import UtilsCpp 1.0
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ComboBox {
id: mainItem
indicatorRightMargin: Math.round(10 * DefaultStyle.dp)
indicatorRightMargin: Utils.getSizeWithScreenRatio(10)
property var selectedDateTime
onSelectedDateTimeChanged: {
if (minTime != undefined) {
@ -22,10 +23,10 @@ ComboBox {
property alias contentText: input
property var minTime
property var maxTime
popup.width: Math.round(73 * DefaultStyle.dp)
popup.width: Utils.getSizeWithScreenRatio(73)
listView.model: 48
listView.height: Math.min(Math.round(204 * DefaultStyle.dp), listView.contentHeight)
popup.height: Math.min(Math.round(204 * DefaultStyle.dp), listView.contentHeight)
listView.height: Math.min(Utils.getSizeWithScreenRatio(204), listView.contentHeight)
popup.height: Math.min(Utils.getSizeWithScreenRatio(204), listView.contentHeight)
editable: true
popup.closePolicy: Popup.PressOutsideParent | Popup.CloseOnPressOutside
onCurrentTextChanged: input.text = currentText
@ -74,7 +75,7 @@ ComboBox {
text: Qt.formatDateTime(currentDateTime, "hh:mm")
width: mainItem.width
visible: mainItem.minTime == undefined || UtilsCpp.timeOffset(mainItem.minTime, currentDateTime) > 0
height: visible ? Math.round(25 * DefaultStyle.dp) : 0
height: visible ? Utils.getSizeWithScreenRatio(25) : 0
verticalAlignment: TextInput.AlignVCenter
horizontalAlignment: TextInput.AlignHCenter
font {

View file

@ -8,6 +8,7 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Dialog {
id: mainItem
@ -17,11 +18,11 @@ Dialog {
readonly property string password: passwordEdit.text
property var callback// Define cb(var) function
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)
topPadding: Utils.getSizeWithScreenRatio(20)
bottomPadding: Utils.getSizeWithScreenRatio(20)
leftPadding: Utils.getSizeWithScreenRatio(20)
rightPadding: Utils.getSizeWithScreenRatio(20)
width: Utils.getSizeWithScreenRatio(637)
modal: true
closePolicy: Popup.NoAutoClose
@ -33,11 +34,11 @@ Dialog {
Component.onDestruction: if(callback) callback.destroy()
content: ColumnLayout {
spacing:Math.round( 20 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(20)
id: contentLayout
Text {
Layout.fillWidth: true
Layout.preferredWidth:Math.round( 250 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(250)
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
@ -50,13 +51,13 @@ Dialog {
}
Text {
Layout.fillWidth: true
Layout.preferredWidth:Math.round( 250 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(250)
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
//: La connexion a échoué pour le compte %1. Vous pouvez renseigner votre mot de passe à nouveau ou bien vérifier les options de configuration de votre compte.
text: qsTr("account_settings_dialog_invalid_password_message").arg(mainItem.identity)
font.pixelSize:Math.round( 16 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(16)
font {
pixelSize: Typography.h4.pixelSize
weight: Typography.h4.weight
@ -80,7 +81,7 @@ Dialog {
buttons: [
MediumButton {
id: cancelButton
Layout.topMargin: Math.round( 10 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(10)
//: "Annuler
text: qsTr("cancel")
style: ButtonStyle.secondary
@ -90,7 +91,7 @@ Dialog {
},
MediumButton {
id: connectButton
Layout.topMargin:Math.round( 10 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(10)
//: Connexion
text: qsTr("assistant_account_login")
style: ButtonStyle.main

View file

@ -4,18 +4,19 @@ import QtQuick.Effects
import QtQuick.Layouts
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Popup {
id: mainItem
modal: true
anchors.centerIn: parent
closePolicy: Control.Popup.NoAutoClose
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)
leftPadding: Utils.getSizeWithScreenRatio(title.length === 0 ? 10 : 33)
rightPadding: Utils.getSizeWithScreenRatio(title.length === 0 ? 10 : 33)
topPadding: Utils.getSizeWithScreenRatio(title.length === 0 ? 10 : 37)
bottomPadding: Utils.getSizeWithScreenRatio(title.length === 0 ? 10 : 37)
underlineColor: DefaultStyle.main1_500_main
radius: title.length === 0 ? Math.round(16 * DefaultStyle.dp) : 0
radius: title.length === 0 ? Utils.getSizeWithScreenRatio(16) : 0
property string title
property var titleColor: DefaultStyle.main1_500_main
property string text
@ -51,7 +52,7 @@ Popup {
ColumnLayout {
id: child
anchors.fill: parent
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
Text{
id: titleText
@ -90,7 +91,7 @@ Popup {
id: detailsText
visible: text.length != 0
Layout.fillWidth: true
//Layout.preferredWidth: Math.round(278 * DefaultStyle.dp)
//Layout.preferredWidth: Utils.getSizeWithScreenRatio(278)
Layout.alignment: Qt.AlignCenter
text: mainItem.details
font {
@ -111,7 +112,7 @@ Popup {
RowLayout {
id: buttonsLayout
Layout.alignment: Qt.AlignBottom | ( titleText.visible ? Qt.AlignRight : Qt.AlignHCenter)
spacing: titleText.visible ? Math.round(20 * DefaultStyle.dp) : Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(titleText.visible ? 20 : 10)
// Default buttons only visible if no other children
// have been set

View file

@ -5,15 +5,16 @@ import QtQuick.Effects
import Linphone
import UtilsCpp 1.0
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
Dialog {
id: mainItem
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)
width: Utils.getSizeWithScreenRatio(436)
rightPadding: Utils.getSizeWithScreenRatio(0)
leftPadding: Utils.getSizeWithScreenRatio(0)
topPadding: Utils.getSizeWithScreenRatio(85 + 24)
bottomPadding: Utils.getSizeWithScreenRatio(24)
modal: true
closePolicy: Popup.NoAutoClose
@ -39,10 +40,10 @@ Dialog {
radius: mainItem.radius
Layout.ColumnLayout {
anchors.top: parent.top
anchors.topMargin: Math.round(18 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(18)
anchors.horizontalCenter: parent.horizontalCenter
Item {
// spacing: Math.round(14 * DefaultStyle.dp)
// spacing: Utils.getSizeWithScreenRatio(14)
Layout.Layout.preferredWidth: childrenRect.width
Layout.Layout.preferredHeight: childrenRect.height
Layout.Layout.fillWidth: true
@ -50,19 +51,19 @@ Dialog {
id: trustShield
anchors.centerIn: parent
source: AppIcons.trustedWhite
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)
sourceSize.width: Utils.getSizeWithScreenRatio(24)
sourceSize.height: Utils.getSizeWithScreenRatio(24)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
}
EffectImage {
anchors.left: trustShield.right
anchors.leftMargin: Math.round(14 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(14)
visible: mainItem.securityError
imageSource: AppIcons.shieldWarning
colorizationColor: DefaultStyle.main2_700
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
}
}
Text {
@ -81,8 +82,8 @@ Dialog {
visible: !mainItem.securityError
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: Math.round(17 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(10)
anchors.rightMargin: Utils.getSizeWithScreenRatio(17)
style: ButtonStyle.noBackground
//: "Passer"
text: qsTr("call_zrtp_sas_validation_skip")
@ -99,9 +100,9 @@ Dialog {
Rectangle {
z: 1
width: mainItem.width
height: parent.height - Math.round(85 * DefaultStyle.dp)
height: Math.round(parent.height - Utils.getSizeWithScreenRatio(85))
x: parent.x
y: parent.y + Math.round(85 * DefaultStyle.dp)
y: Math.round(parent.y + Utils.getSizeWithScreenRatio(85))
color: DefaultStyle.grey_0
radius: mainItem.radius
}
@ -118,14 +119,14 @@ Dialog {
content: [
Layout.ColumnLayout {
visible: !mainItem.securityError
spacing: Math.round(20 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(20)
Layout.Layout.alignment: Qt.AlignHCenter
Layout.Layout.fillWidth: true
Layout.ColumnLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
Layout.Layout.alignment: Qt.AlignHCenter
Text {
Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(343)
Layout.Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
text: !mainItem.isTokenVerified && mainItem.isCaseMismatch
@ -134,7 +135,7 @@ Dialog {
//: "Pour garantir le chiffrement, nous avons besoin dauthentifier lappareil de votre correspondant. Veuillez échanger vos codes : "
: qsTr("call_dialog_zrtp_validate_trust_message")
wrapMode: Text.WordWrap
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
}
Layout.ColumnLayout {
spacing: 0
@ -144,7 +145,7 @@ Dialog {
text: qsTr("call_dialog_zrtp_validate_trust_local_code_label")
horizontalAlignment: Text.AlignHCenter
Layout.Layout.alignment: Qt.AlignHCenter
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
}
Text {
text: mainItem.call && mainItem.call.core.localToken || ""
@ -160,18 +161,18 @@ Dialog {
Rectangle {
color: "transparent"
border.color: DefaultStyle.main2_200
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)
border.width: Utils.getSizeWithScreenRatio(1)
radius: Utils.getSizeWithScreenRatio(15)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(292)
Layout.Layout.preferredHeight: Utils.getSizeWithScreenRatio(233)
Layout.Layout.alignment: Qt.AlignHCenter
Layout.ColumnLayout {
anchors.fill: parent
anchors.topMargin: Math.round(10 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(10)
Text {
//: "Code correspondant :"
text: qsTr("call_dialog_zrtp_validate_trust_remote_code_label")
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
Layout.Layout.alignment: Qt.AlignHCenter
}
Layout.GridLayout {
@ -179,23 +180,23 @@ Dialog {
Layout.Layout.alignment: Qt.AlignHCenter
rows: 2
columns: 2
rowSpacing: Math.round(32 * DefaultStyle.dp)
columnSpacing: Math.round(32 * DefaultStyle.dp)
rowSpacing: Utils.getSizeWithScreenRatio(32)
columnSpacing: Utils.getSizeWithScreenRatio(32)
property var correctIndex
property var modelList
Repeater {
model: mainItem.call && mainItem.call.core.remoteTokens || ""
Button {
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)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(70)
Layout.Layout.preferredHeight: Utils.getSizeWithScreenRatio(70)
width: Utils.getSizeWithScreenRatio(70)
height: Utils.getSizeWithScreenRatio(70)
color: DefaultStyle.grey_0
textSize: Math.round(32 * DefaultStyle.dp)
textWeight: Math.round(400 * DefaultStyle.dp)
textSize: Utils.getSizeWithScreenRatio(32)
textWeight: Utils.getSizeWithScreenRatio(400)
text: modelData
shadowEnabled: true
radius: Math.round(71 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(71)
textColor: DefaultStyle.main2_600
onClicked: {
console.log("CHECK TOKEN", modelData)
@ -212,26 +213,26 @@ Dialog {
spacing: 0
Text {
width: Math.round(303 * DefaultStyle.dp)
// Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(303)
// Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(343)
Layout.Layout.alignment: Qt.AlignHCenter
Layout.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
//: "Le code fourni ne correspond pas."
text: qsTr("call_dialog_zrtp_validate_trust_letters_do_not_match_text")
wrapMode: Text.WordWrap
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
}
Text {
width: Math.round(303 * DefaultStyle.dp)
// Layout.Layout.preferredWidth: Math.round(343 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(303)
// Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(343)
Layout.Layout.alignment: Qt.AlignHCenter
Layout.Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
//: "La confidentialité de votre appel peut être compromise !"
text: qsTr("call_dialog_zrtp_security_alert_message")
wrapMode: Text.WordWrap
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
}
}
]
@ -240,7 +241,7 @@ Dialog {
Layout.Layout.alignment: Qt.AlignHCenter
MediumButton {
Layout.Layout.alignment: Qt.AlignHCenter
Layout.Layout.preferredWidth: Math.round(247 * DefaultStyle.dp)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(247)
//: "Aucune correspondance"
text: qsTr("call_dialog_zrtp_validate_trust_letters_do_not_match")
color: DefaultStyle.grey_0
@ -252,12 +253,12 @@ Dialog {
}
}
MediumButton {
Layout.Layout.preferredWidth: Math.round(247 * DefaultStyle.dp)
Layout.Layout.preferredWidth: Utils.getSizeWithScreenRatio(247)
Layout.Layout.alignment: Qt.AlignHCenter
visible: mainItem.securityError
style: ButtonStyle.phoneRed
onClicked: mainItem.call.core.lTerminate()
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
//: "Raccrocher"
text: qsTr("call_action_hang_up")
}

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls.Basic
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Popup {
id: mainItem
@ -18,9 +19,9 @@ Popup {
closePolicy: Popup.NoAutoClose
x : parent.x + parent.width - width
// y : parent.y + parent.height - height
rightMargin: Math.round(20 * DefaultStyle.dp)
bottomMargin: Math.round(20 * DefaultStyle.dp)
padding: Math.round(20 * DefaultStyle.dp)
rightMargin: Utils.getSizeWithScreenRatio(20)
bottomMargin: Utils.getSizeWithScreenRatio(20)
padding: Utils.getSizeWithScreenRatio(20)
underlineColor: mainItem.isSuccess ? DefaultStyle.success_500_main : DefaultStyle.danger_500_main
radius: 0
focus: true
@ -37,24 +38,24 @@ Popup {
}
}
contentItem: RowLayout {
spacing: Math.round(24 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(24)
Accessible.role: Accessible.AlertMessage
Accessible.name: "%1, %2".arg(mainItem.title).arg(mainItem.description)
EffectImage {
imageSource: mainItem.isSuccess ? AppIcons.smiley : AppIcons.smileySad
colorizationColor: mainItem.isSuccess ? DefaultStyle.success_500_main : DefaultStyle.danger_500_main
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(32)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(32)
width: Utils.getSizeWithScreenRatio(32)
height: Utils.getSizeWithScreenRatio(32)
}
Rectangle {
Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(1)
Layout.preferredHeight: parent.height
color: DefaultStyle.main2_200
}
ColumnLayout {
spacing: Math.round(2 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(2)
RowLayout {
spacing: 0
Text {
@ -67,10 +68,10 @@ Popup {
}
}
Button {
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.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
icon.width: Utils.getSizeWithScreenRatio(20)
icon.height: Utils.getSizeWithScreenRatio(20)
Layout.alignment: Qt.AlignTop | Qt.AlignRight
visible: mainItem.hovered || hovered
style: ButtonStyle.noBackground
@ -81,13 +82,13 @@ Popup {
Text {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.maximumWidth: Math.round(300 * DefaultStyle.dp)
Layout.maximumWidth: Utils.getSizeWithScreenRatio(300)
text: mainItem.description
wrapMode: Text.WordWrap
color: DefaultStyle.main2_500_main
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
weight: Math.round(300 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Utils.getSizeWithScreenRatio(300)
}
}
}

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls.Basic
import Linphone
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Popup {
id: mainItem
@ -12,18 +13,18 @@ Popup {
modal: true
closePolicy: Control.Popup.NoAutoClose
anchors.centerIn: parent
padding: Math.round(20 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(20)
underlineColor: DefaultStyle.main1_500_main
radius: Math.round(15 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(15)
// onAboutToShow: width = contentText.implicitWidth
contentItem: ColumnLayout {
spacing: Math.round(15 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(15)
// width: childrenRect.width
// height: childrenRect.height
BusyIndicator{
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: Math.round(33 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(33 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(33)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(33)
}
Text {
id: contentText
@ -31,7 +32,7 @@ Popup {
Layout.fillWidth: true
Layout.fillHeight: true
text: mainItem.text
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
}
MediumButton {
visible: mainItem.cancelButtonVisible

View file

@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
@ -11,8 +12,8 @@ DesktopPopup {
property var notificationData: ({
timelineModel : null
})
property real overriddenHeight: Math.round(120 * DefaultStyle.dp)
property real overriddenWidth: Math.round(300 * DefaultStyle.dp)
property real overriddenHeight: Utils.getSizeWithScreenRatio(120)
property real overriddenWidth: Utils.getSizeWithScreenRatio(300)
property double radius: 0
property color backgroundColor: DefaultStyle.grey_0
property double backgroundOpacity: 1
@ -56,7 +57,7 @@ DesktopPopup {
opacity: mainItem.backgroundOpacity
// border {
// color: DefaultStyle.grey_400
// width: Math.round(1 * DefaultStyle.dp)
// width: Utils.getSizeWithScreenRatio(1)
// }
}
MultiEffect {

View file

@ -3,15 +3,16 @@ import QtQuick.Layouts
import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
Notification {
id: mainItem
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
backgroundColor: DefaultStyle.grey_600
backgroundOpacity: 0.8
overriddenWidth: Math.round(400 * DefaultStyle.dp)
overriddenWidth: Utils.getSizeWithScreenRatio(400)
overriddenHeight: content.height
readonly property var call: notificationData && notificationData.call
@ -32,41 +33,41 @@ Notification {
Popup {
id: content
visible: mainItem.visible
leftPadding: Math.round(32 * DefaultStyle.dp)
rightPadding: Math.round(32 * DefaultStyle.dp)
topPadding: Math.round(9 * DefaultStyle.dp)
bottomPadding: Math.round(18 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(32)
rightPadding: Utils.getSizeWithScreenRatio(32)
topPadding: Utils.getSizeWithScreenRatio(9)
bottomPadding: Utils.getSizeWithScreenRatio(18)
anchors.centerIn: parent
background: Item{}
contentItem: ColumnLayout {
anchors.verticalCenter: parent.verticalCenter
spacing: Math.round(9 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(9)
RowLayout {
spacing: Math.round(4 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(4)
Layout.alignment: Qt.AlignHCenter
Image {
Layout.preferredWidth: Math.round(12 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(12 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(12)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(12)
source: AppIcons.logo
}
Text {
text: "Linphone"
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Typography.b3.weight
capitalization: Font.Capitalize
}
}
}
ColumnLayout {
spacing: Math.round(17 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(17)
ColumnLayout {
spacing: Math.round(14 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(14)
Layout.alignment: Qt.AlignHCenter
Avatar {
Layout.preferredWidth: Math.round(60 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(60)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(60)
Layout.alignment: Qt.AlignHCenter
call: mainItem.call
displayNameVal: mainItem.displayName
@ -84,7 +85,7 @@ Notification {
maximumLineCount: 1
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Typography.b3.weight
capitalization: Font.Capitalize
}
@ -95,8 +96,8 @@ Notification {
Layout.alignment: Qt.AlignHCenter
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(14 * DefaultStyle.dp)
weight: Math.round(500 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(14)
weight: Utils.getSizeWithScreenRatio(500)
}
}
}
@ -104,19 +105,19 @@ Notification {
RowLayout {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
spacing: Math.round(26 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(26)
Button {
spacing: Math.round(6 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(6)
style: ButtonStyle.phoneGreen
Layout.preferredWidth: Math.round(118 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(32 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(118)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(32)
asynchronous: false
icon.width: Math.round(19 * DefaultStyle.dp)
icon.height: Math.round(19 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(19)
icon.height: Utils.getSizeWithScreenRatio(19)
//: "Accepter"
text: qsTr("dialog_accept")
textSize: Math.round(14 * DefaultStyle.dp)
textWeight: Math.round(500 * DefaultStyle.dp)
textSize: Utils.getSizeWithScreenRatio(14)
textWeight: Utils.getSizeWithScreenRatio(500)
onClicked: {
console.debug("[NotificationReceivedCall] Accept click")
UtilsCpp.openCallsWindow(mainItem.call)
@ -124,17 +125,17 @@ Notification {
}
}
Button {
spacing: Math.round(6 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(6)
style: ButtonStyle.phoneRed
Layout.preferredWidth: Math.round(118 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(32 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(118)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(32)
asynchronous: false
icon.width: Math.round(19 * DefaultStyle.dp)
icon.height: Math.round(19 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(19)
icon.height: Utils.getSizeWithScreenRatio(19)
//: "Refuser
text: qsTr("dialog_deny")
textSize: Math.round(14 * DefaultStyle.dp)
textWeight: Math.round(500 * DefaultStyle.dp)
textSize: Utils.getSizeWithScreenRatio(14)
textWeight: Utils.getSizeWithScreenRatio(500)
onClicked: {
console.debug("[NotificationReceivedCall] Decline click")
mainItem.call.core.lDecline()

View file

@ -4,15 +4,16 @@ import Linphone
import UtilsCpp
import QtQuick.Controls as Control
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// =============================================================================
Notification {
id: mainItem
radius: Math.round(10 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(10)
backgroundColor: DefaultStyle.grey_600
backgroundOpacity: 0.8
overriddenWidth: Math.round(400 * DefaultStyle.dp)
overriddenWidth: Utils.getSizeWithScreenRatio(400)
overriddenHeight: content.height
property var chat: notificationData ? notificationData.chat : null
@ -35,27 +36,27 @@ Notification {
id: content
visible: mainItem.visible
width: parent.width
leftPadding: Math.round(18 * DefaultStyle.dp)
rightPadding: Math.round(18 * DefaultStyle.dp)
topPadding: Math.round(32 * DefaultStyle.dp)
bottomPadding: Math.round(18 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(18)
rightPadding: Utils.getSizeWithScreenRatio(18)
topPadding: Utils.getSizeWithScreenRatio(32)
bottomPadding: Utils.getSizeWithScreenRatio(18)
background: Item {
anchors.fill: parent
RowLayout {
anchors.top: parent.top
anchors.topMargin: Math.round(9 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(9)
anchors.horizontalCenter: parent.horizontalCenter
spacing: Math.round(4 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(4)
Image {
Layout.preferredWidth: Math.round(12 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(12 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(12)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(12)
source: AppIcons.logo
}
Text {
text: "Linphone"
color: DefaultStyle.grey_0
font {
pixelSize: Math.round(12 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(12)
weight: Typography.b3.weight
capitalization: Font.Capitalize
}
@ -64,16 +65,16 @@ Notification {
Button {
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Math.round(9 * DefaultStyle.dp)
anchors.rightMargin: Math.round(12 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(9)
anchors.rightMargin: Utils.getSizeWithScreenRatio(12)
padding: 0
z: mousearea.z + 1
background: Item{anchors.fill: parent}
icon.source: AppIcons.closeX
width: Math.round(14 * DefaultStyle.dp)
height: Math.round(14 * DefaultStyle.dp)
icon.width: Math.round(14 * DefaultStyle.dp)
icon.height: Math.round(14 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(14)
height: Utils.getSizeWithScreenRatio(14)
icon.width: Utils.getSizeWithScreenRatio(14)
icon.height: Utils.getSizeWithScreenRatio(14)
contentImageColor: DefaultStyle.grey_0
onPressed: {
mainItem.close()
@ -89,12 +90,12 @@ Notification {
}
}
contentItem: ColumnLayout {
spacing: Math.round(9 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(9)
RowLayout {
spacing: Math.round(14 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(14)
Avatar {
Layout.preferredWidth: Math.round(60 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(60 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(60)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(60)
// Layout.alignment: Qt.AlignHCenter
property var contactObj: UtilsCpp.findFriendByAddress(mainItem.remoteAddress)
contact: contactObj?.value || null

View file

@ -1,16 +1,17 @@
import QtQuick
import QtQuick.Effects
import Linphone
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.Control {
id: mainItem
// width: Math.round(269 * DefaultStyle.dp)
// width: Utils.getSizeWithScreenRatio(269)
y: -height
z: 1
topPadding: Math.round(8 * DefaultStyle.dp)
bottomPadding: Math.round(8 * DefaultStyle.dp)
leftPadding: Math.round(37 * DefaultStyle.dp)
rightPadding: Math.round(37 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(8)
bottomPadding: Utils.getSizeWithScreenRatio(8)
leftPadding: Utils.getSizeWithScreenRatio(37)
rightPadding: Utils.getSizeWithScreenRatio(37)
anchors.horizontalCenter: parent.horizontalCenter
clip: true
@ -41,15 +42,15 @@ Control.Control {
anchors.fill: parent
color: DefaultStyle.grey_0
border.color: mainItem.contentColor
border.width: Math.max(Math.round(1 * DefaultStyle.dp), 1)
radius: Math.round(50 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(1)
radius: Utils.getSizeWithScreenRatio(50)
}
contentItem: RowLayout {
Image {
visible: mainItem.imageSource != undefined
source: mainItem.imageSource
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
fillMode: Image.PreserveAspectFit
Layout.fillWidth: true
}
@ -58,7 +59,7 @@ Control.Control {
text: mainItem.text
Layout.fillWidth: true
font {
pixelSize: Math.round(14 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(14)
}
}
}

View file

@ -5,14 +5,15 @@ import QtQuick.Effects
import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.Popup {
id: mainItem
closePolicy: Control.Popup.CloseOnEscape
leftPadding: Math.round(72 * DefaultStyle.dp)
rightPadding: Math.round(72 * DefaultStyle.dp)
topPadding: Math.round(41 * DefaultStyle.dp)
bottomPadding: Math.round(18 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(72)
rightPadding: Utils.getSizeWithScreenRatio(72)
topPadding: Utils.getSizeWithScreenRatio(41)
bottomPadding: Utils.getSizeWithScreenRatio(18)
property bool closeButtonVisible: true
property bool roundedBottom: false
property bool lastRowVisible: true
@ -29,7 +30,7 @@ Control.Popup {
width: parent.width
height: parent.height
color: DefaultStyle.grey_100
radius: Math.round(20 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(20)
}
MultiEffect {
id: effect
@ -57,11 +58,11 @@ Control.Popup {
visible: mainItem.closeButtonVisible
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: Math.round(10 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(10)
anchors.rightMargin: Utils.getSizeWithScreenRatio(10)
icon.source: AppIcons.closeX
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
style: ButtonStyle.noBackground
onClicked: mainItem.close()
}

View file

@ -3,12 +3,13 @@ import QtQuick.Controls.Basic as Control
import QtQuick.Effects
import Linphone
import CustomControls 1.0
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
Control.Popup{
id: mainItem
padding: 0
property color underlineColor : DefaultStyle.main1_500_main
property real radius: Math.round(16 * DefaultStyle.dp)
property real radius: Utils.getSizeWithScreenRatio(16)
property bool hovered: mouseArea.containsMouse
property bool keyboardFocus: FocusHelper.keyboardFocus
@ -16,7 +17,7 @@ Control.Popup{
Rectangle {
visible: mainItem.underlineColor != undefined
width: mainItem.width
height: mainItem.height + Math.round(2 * DefaultStyle.dp)
height: mainItem.height +Utils.getSizeWithScreenRatio(2)
color: mainItem.underlineColor
radius: mainItem.radius
}

View file

@ -871,10 +871,9 @@ function codepointFromFilename(filename) {
// -----------------------------------------------------------------------------
function getSizeWithScreenRatio(size){
if (size == 0) {
return size;
}
return size > 0
? Math.max(Math.round(size * Linphone.DefaultStyle.dp), 1)
: Math.min(Math.round(size * Linphone.DefaultStyle.dp), -1);
return (size == 0)
? 0
: size > 0
? Math.max(Math.round(size * Linphone.DefaultStyle.dp), 1)
: Math.min(Math.round(size * Linphone.DefaultStyle.dp), -1);
}

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
// Snippet
Window {
@ -129,7 +130,7 @@ Window {
TextField {
id: usernameToCall
label: "Username to call"
Layout.preferredWidth: Math.round(250 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(250)
}
Button{
text: 'Call'

View file

@ -8,6 +8,7 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope {
id: mainItem
@ -70,27 +71,27 @@ FocusScope {
panelColor: DefaultStyle.grey_0
header.visible: !mainItem.call
clip: true
header.leftPadding: Math.round(32 * DefaultStyle.dp)
header.rightPadding: Math.round(32 * DefaultStyle.dp)
header.topPadding: Math.round(6 * DefaultStyle.dp)
header.bottomPadding: searchBarLayout.visible ? Math.round(3 * DefaultStyle.dp) : Math.round(6 * DefaultStyle.dp)
header.leftPadding: Utils.getSizeWithScreenRatio(32)
header.rightPadding: Utils.getSizeWithScreenRatio(32)
header.topPadding: Utils.getSizeWithScreenRatio(6)
header.bottomPadding: Utils.getSizeWithScreenRatio(searchBarLayout.visible ? 3 : 6)
header.contentItem: ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: mainItem.call ? 0 : Math.round(31 * DefaultStyle.dp)
Layout.rightMargin: Math.round(41 * DefaultStyle.dp)
spacing: searchBarLayout.visible ? Math.round(9 * DefaultStyle.dp) : 0
Layout.leftMargin: mainItem.call ? 0 : Utils.getSizeWithScreenRatio(31)
Layout.rightMargin: Utils.getSizeWithScreenRatio(41)
spacing: searchBarLayout.visible ? Utils.getSizeWithScreenRatio(9) : 0
RowLayout {
RowLayout {
id: chatHeader
spacing: Math.round(12 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(12)
Avatar {
property var contactObj: mainItem.chat ? UtilsCpp.findFriendByAddress(mainItem.chat?.core.peerAddress) : null
contact: contactObj?.value || null
displayNameVal: mainItem.chat?.core.avatarUri
secured: mainItem.chat && mainItem.chat.core.isSecured
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
}
Text {
text: mainItem.chat?.core.title || ""
@ -98,16 +99,16 @@ FocusScope {
maximumLineCount: 1
font {
pixelSize: Typography.h4.pixelSize
weight: Math.round(400 * DefaultStyle.dp)
weight: Utils.getSizeWithScreenRatio(400)
capitalization: Font.Capitalize
}
}
RowLayout {
visible: mainItem.chat != undefined && mainItem.chat.core.isBasic
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
Layout.preferredHeight: 14 * DefaultStyle.dp
Layout.preferredWidth: visible ? Utils.getSizeWithScreenRatio(14) : 0
Layout.preferredHeight: Utils.getSizeWithScreenRatio(14)
colorizationColor: DefaultStyle.warning_700
imageSource: AppIcons.lockSimpleOpen
}
@ -124,16 +125,16 @@ FocusScope {
}
EffectImage {
visible: mainItem.chat?.core.muted || false
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredWidth: Utils.getSizeWithScreenRatio(20)
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 20 * DefaultStyle.dp
Layout.preferredHeight: Utils.getSizeWithScreenRatio(20)
colorizationColor: DefaultStyle.main1_500_main
imageSource: AppIcons.bellSlash
}
}
Item{Layout.fillWidth: true}
RowLayout {
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
RoundButton {
visible: !mainItem.call
style: ButtonStyle.noBackground
@ -185,8 +186,8 @@ FocusScope {
if(!visible) chatMessagesSearchBar.clearText()
else chatMessagesSearchBar.forceActiveFocus()
}
spacing: Math.round(50 * DefaultStyle.dp)
height: Math.round(65 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(50)
height: Utils.getSizeWithScreenRatio(65)
Connections {
target: mainItem
function onChatChanged() {searchBarLayout.visible = false}
@ -194,7 +195,7 @@ FocusScope {
SearchBar {
id: chatMessagesSearchBar
Layout.fillWidth: true
Layout.rightMargin: Math.round(10 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(10)
property ChatMessageGui messageFound
delaySearch: false
Keys.onPressed: (event) => {
@ -217,7 +218,7 @@ FocusScope {
}
}
RowLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
RoundButton {
icon.source: AppIcons.upArrow
style: ButtonStyle.noBackground
@ -241,7 +242,7 @@ FocusScope {
}
RoundButton {
icon.source: AppIcons.closeX
Layout.rightMargin: Math.round(20 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(20)
onClicked: {
chatMessagesListView.filterText = ""
searchBarLayout.visible = false
@ -257,7 +258,7 @@ FocusScope {
handle: Rectangle {
visible: !mainItem.chat?.core.isReadOnly
enabled: visible
implicitHeight: Math.round(8 * DefaultStyle.dp)
implicitHeight: Utils.getSizeWithScreenRatio(8)
color: Control.SplitHandle.hovered ? DefaultStyle.grey_200 : DefaultStyle.grey_100
}
ColumnLayout {
@ -273,8 +274,8 @@ FocusScope {
width: parent.width - anchors.leftMargin - anchors.rightMargin
chat: mainItem.chat
anchors.fill: parent
anchors.leftMargin: Math.round(18 * DefaultStyle.dp)
anchors.rightMargin: Math.round(18 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(18)
anchors.rightMargin: Utils.getSizeWithScreenRatio(18)
Control.ScrollBar.vertical: scrollbar
onShowReactionsForMessageRequested: (chatMessage) => {
mainItem.chatMessage = chatMessage
@ -303,13 +304,13 @@ FocusScope {
anchors.top: chatMessagesListView.top
anchors.bottom: chatMessagesListView.bottom
anchors.right: parent.right
anchors.rightMargin: Math.round(5 * DefaultStyle.dp)
anchors.rightMargin: Utils.getSizeWithScreenRatio(5)
policy: Control.ScrollBar.AsNeeded
}
Control.Control {
id: participantListPopup
width: parent.width
height: Math.min(participantInfoList.height, Math.round(200 * DefaultStyle.dp))
height: Math.min(participantInfoList.height, Utils.getSizeWithScreenRatio(200))
visible: false
anchors.bottom: chatMessagesListView.bottom
anchors.left: chatMessagesListView.left
@ -323,7 +324,7 @@ FocusScope {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
radius: Math.round(20 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(20)
height: parent.height
}
MultiEffect {
@ -360,10 +361,10 @@ FocusScope {
visible: selectedFiles.count > 0 || mainItem.replyingToMessage
Layout.fillWidth: true
Layout.preferredHeight: implicitHeight
topPadding: Math.round(12 * DefaultStyle.dp)
bottomPadding: Math.round(12 * DefaultStyle.dp)
leftPadding: Math.round(19 * DefaultStyle.dp)
rightPadding: Math.round(19 * DefaultStyle.dp)
topPadding: Utils.getSizeWithScreenRatio(12)
bottomPadding: Utils.getSizeWithScreenRatio(12)
leftPadding: Utils.getSizeWithScreenRatio(19)
rightPadding: Utils.getSizeWithScreenRatio(19)
Button {
anchors.top: parent.top
@ -382,7 +383,7 @@ FocusScope {
Rectangle {
color: DefaultStyle.grey_0
border.color: DefaultStyle.main2_100
border.width: Math.round(2 * DefaultStyle.dp)
border.width: Utils.getSizeWithScreenRatio(2)
height: parent.height / 2
anchors.top: parent.top
anchors.left: parent.left
@ -396,7 +397,7 @@ FocusScope {
}
}
contentItem: ColumnLayout {
spacing: Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(5)
ColumnLayout {
id: replyLayout
spacing: 0
@ -425,38 +426,38 @@ FocusScope {
Layout.fillWidth: true
visible: replyLayout.visible && selectedFiles.visible
color: DefaultStyle.main2_300
Layout.preferredHeight: Math.max(1, Math.round(1 * DefaultStyle.dp))
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
}
ListView {
id: selectedFiles
orientation: ListView.Horizontal
visible: count > 0
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
Layout.fillWidth: true
Layout.preferredHeight: Math.round(104 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(104)
model: ChatMessageContentProxy {
id: contents
filterType: ChatMessageContentProxy.FilterContentType.File
}
delegate: Item {
width: Math.round(80 * DefaultStyle.dp)
height: Math.round(80 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(80)
height: Utils.getSizeWithScreenRatio(80)
FileView {
contentGui: modelData
anchors.left: parent.left
anchors.bottom: parent.bottom
width: Math.round(69 * DefaultStyle.dp)
height: Math.round(69 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(69)
height: Utils.getSizeWithScreenRatio(69)
}
RoundButton {
icon.source: AppIcons.closeX
icon.width: Math.round(12 * DefaultStyle.dp)
icon.height: Math.round(12 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(12)
icon.height: Utils.getSizeWithScreenRatio(12)
anchors.top: parent.top
anchors.right: parent.right
style: ButtonStyle.numericPad
shadowEnabled: true
padding: Math.round(3 * DefaultStyle.dp)
padding: Utils.getSizeWithScreenRatio(3)
onClicked: contents.removeContent(modelData)
}
}
@ -475,7 +476,7 @@ FocusScope {
ChatDroppableTextArea {
id: messageSender
Control.SplitView.preferredHeight: mainItem.chat?.core.isReadOnly ? 0 : height
Control.SplitView.minimumHeight: mainItem.chat?.core.isReadOnly ? 0 : Math.round(79 * DefaultStyle.dp)
Control.SplitView.minimumHeight: mainItem.chat?.core.isReadOnly ? 0 : Utils.getSizeWithScreenRatio(79)
chat: mainItem.chat
selectedFilesCount: contents.count
callOngoing: mainItem.call != null
@ -511,14 +512,14 @@ FocusScope {
Rectangle {
visible: detailsPanel.visible
color: DefaultStyle.main2_200
Layout.preferredWidth: Math.round(1 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(1)
Layout.fillHeight: true
}
Control.Control {
id: detailsPanel
visible: false
Layout.fillHeight: true
Layout.preferredWidth: Math.round(387 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(387)
onVisibleChanged: if(!visible) {
contentLoader.panelType = SelectedChatView.PanelType.None
}
@ -533,8 +534,8 @@ FocusScope {
property int panelType: SelectedChatView.PanelType.None
// anchors.top: parent.top
anchors.fill: parent
anchors.topMargin: Math.round(39 * DefaultStyle.dp)
anchors.rightMargin: Math.round(15 * DefaultStyle.dp)
anchors.topMargin: Utils.getSizeWithScreenRatio(39)
anchors.rightMargin: Utils.getSizeWithScreenRatio(15)
sourceComponent: panelType === SelectedChatView.PanelType.EphemeralSettings
? ephemeralSettingsComponent
: panelType === SelectedChatView.PanelType.MessageReactions
@ -643,7 +644,7 @@ FocusScope {
mainItem.chatMessage = null
}
content: ColumnLayout {
spacing: Math.round(31 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(31)
SearchBar {
id: forwardSearchBar
Layout.fillWidth: true
@ -655,7 +656,7 @@ FocusScope {
// width: parent.width
// Control.ScrollBar.vertical: ScrollBar {
// id: scrollbar
// topPadding: Math.round(24 * DefaultStyle.dp) // Avoid to be on top of collapse button
// topPadding: Utils.getSizeWithScreenRatio(24) // Avoid to be on top of collapse button
// active: true
// interactive: true
// visible: parent.contentHeight > parent.height
@ -664,8 +665,8 @@ FocusScope {
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
spacing: Math.round(8 * DefaultStyle.dp)
// width: parent.width //- scrollbar.width - Math.round(5 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
// width: parent.width //- scrollbar.width - Utils.getSizeWithScreenRatio(5)
RowLayout {
Text {
//: Conversations

View file

@ -5,6 +5,7 @@ import QtQuick.Controls.Basic
import Linphone
import UtilsCpp
import SettingsCpp
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
ColumnLayout{
id: mainItem
@ -33,8 +34,8 @@ ColumnLayout{
Layout.fillWidth: true
verticalAlignment: (topTextItem.visible?Text.AlignTop:Text.AlignVCenter)
visible: text != ''
font.weight: Math.round(300 * DefaultStyle.dp)
font.pixelSize: Math.round(12 * DefaultStyle.dp)
font.weight: Utils.getSizeWithScreenRatio(300)
font.pixelSize: Utils.getSizeWithScreenRatio(12)
color: DefaultStyle.main2_400
text: mainItem.bottomText
maximumLineCount: 1

View file

@ -173,7 +173,7 @@ MainRightPanel {
]
content: Flickable {
id: editionLayout
contentWidth: Math.round(Math.min(parent.width, 421 * DefaultStyle.dp))
contentWidth: Math.min(parent.width, Utils.getSizeWithScreenRatio(421))
width: parent.width
contentY: 0

View file

@ -55,7 +55,7 @@ LoginLayout {
RowLayout {
visible: !SettingsCpp.assistantHideCreateAccount
spacing: Utils.getSizeWithScreenRatio(20)
Layout.rightMargin: Math.round(Math.max(10 * DefaultStyle.dp, (51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp))
Layout.rightMargin: Math.max(Utils.getSizeWithScreenRatio(10), Utils.getSizeWithScreenRatio(51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))))
Text {
Layout.rightMargin: Utils.getSizeWithScreenRatio(15)

View file

@ -15,14 +15,14 @@ LoginLayout {
titleContent: [
RowLayout {
Layout.leftMargin: Math.round(119 * DefaultStyle.dp)
Layout.leftMargin: Utils.getSizeWithScreenRatio(119)
visible: !SettingsCpp.assistantHideThirdPartyAccount
spacing: Math.round(21 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(21)
Button {
id: backButton
visible: mainItem.showBackButton
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
icon.source: AppIcons.leftArrow
style: ButtonStyle.noBackground
onClicked: {
@ -35,8 +35,8 @@ LoginLayout {
EffectImage {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.profile
Layout.preferredHeight: Math.round(34 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(34 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(34)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(34)
colorizationColor: DefaultStyle.main2_600
}
Text {
@ -54,10 +54,10 @@ LoginLayout {
},
RowLayout {
visible: !SettingsCpp.assistantHideCreateAccount
Layout.rightMargin: Math.round(51 * DefaultStyle.dp)
spacing: Math.round(20 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(51)
spacing: Utils.getSizeWithScreenRatio(20)
Text {
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
Layout.rightMargin: Utils.getSizeWithScreenRatio(15)
//: Pas encore de compte ?
text: qsTr("assistant_no_account_yet")
font {
@ -81,7 +81,7 @@ LoginLayout {
Component {
id: firstItem
Flickable {
width: Math.round(361 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(361)
contentWidth: content.implicitWidth
contentHeight: content.implicitHeight
clip: true
@ -93,11 +93,11 @@ LoginLayout {
id: content
// rightMargin is negative margin
width: parent.width - scrollbar.width*2
spacing: Math.round(85 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(85)
ColumnLayout {
spacing: 0
ColumnLayout {
spacing: Math.round(28 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(28)
Text {
Layout.fillWidth: true
Layout.preferredWidth: rootStackView.width
@ -113,7 +113,7 @@ LoginLayout {
SmallButton {
id: openLinkButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: Math.round(18 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(18)
text: "linphone.org/contact"
style: ButtonStyle.secondary
onClicked: {
@ -124,7 +124,7 @@ LoginLayout {
}
}
ColumnLayout {
spacing: Math.round(20 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(20)
BigButton {
id: createAccountButton
style: ButtonStyle.secondary
@ -160,7 +160,7 @@ LoginLayout {
id: secondItem
Flickable {
id: formFlickable
width: Math.round(770 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(770)
contentWidth: content.implicitWidth
contentHeight: content.implicitHeight
clip: true
@ -171,19 +171,19 @@ LoginLayout {
RowLayout {
id: content
width: formFlickable.width - scrollbar.width*2
spacing: Math.round(50 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(50)
ColumnLayout {
spacing: Math.round(2 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(2)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
Layout.fillHeight: true
ColumnLayout {
spacing: Math.round(22 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(22)
// alignment item
Item {
Layout.preferredHeight: advancedParametersTitle.implicitHeight
}
ColumnLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
FormItemLayout {
id: username
//: "Nom d'utilisateur"
@ -194,7 +194,7 @@ LoginLayout {
contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible || (LoginPageCpp.badIds && errorText.isVisible)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
KeyNavigation.down: passwordEdit
//: "%1 mandatory"
Accessible.name: qsTr("mandatory_field_accessible_name").arg(qsTr("username"))
@ -210,7 +210,7 @@ LoginLayout {
id: passwordEdit
isError: password.errorTextVisible || (LoginPageCpp.badIds && errorText.isVisible)
hidden: true
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
KeyNavigation.up: usernameEdit
KeyNavigation.down: domainEdit
Accessible.name: qsTr("password")
@ -227,7 +227,7 @@ LoginLayout {
id: domainEdit
isError: domain.errorTextVisible
initialText: SettingsCpp.assistantThirdPartySipAccountDomain
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
KeyNavigation.up: passwordEdit
KeyNavigation.down: displayName
//: "%1 mandatory"
@ -246,7 +246,7 @@ LoginLayout {
Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
KeyNavigation.up: domainEdit
KeyNavigation.down: transportCbox
Accessible.name: qsTr("sip_address_display_name")
@ -258,8 +258,8 @@ LoginLayout {
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: Math.round(49 * DefaultStyle.dp)
width: Math.round(360 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(49)
width: Utils.getSizeWithScreenRatio(360)
textRole: "text"
valueRole: "value"
model: [
@ -292,7 +292,7 @@ LoginLayout {
BigButton {
id: connectionButton
Layout.topMargin: Math.round(15 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(15)
style: ButtonStyle.main
property Item tabTarget
Accessible.name: qsTr("assistant_account_login")
@ -315,7 +315,7 @@ LoginLayout {
implicitHeight: parent.height
Layout.alignment: Qt.AlignCenter
indicatorColor: DefaultStyle.grey_0
indicatorWidth: Math.round(25 * DefaultStyle.dp)
indicatorWidth: Utils.getSizeWithScreenRatio(25)
}
Connections {
target: LoginPageCpp
@ -373,9 +373,9 @@ LoginLayout {
}
}
ColumnLayout {
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
Layout.fillHeight: true
spacing: Math.round(22 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(22)
Text {
id: advancedParametersTitle
//: Advanced parameters
@ -383,7 +383,7 @@ LoginLayout {
font: Typography.h3m
}
ColumnLayout {
spacing: Math.round(10 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(10)
FormItemLayout {
id: outboundProxyUri
//: "Outbound SIP Proxy URI"
@ -393,7 +393,7 @@ LoginLayout {
Layout.fillWidth: true
contentItem: TextField {
id: outboundProxyUriEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
Accessible.name: qsTr("login_proxy_server_url")
KeyNavigation.up: transportCbox
KeyNavigation.down: registrarUriEdit
@ -406,7 +406,7 @@ LoginLayout {
Layout.fillWidth: true
contentItem: TextField {
id: registrarUriEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
Accessible.name: qsTr("login_registrar_uri")
KeyNavigation.up: outboundProxyUriEdit
KeyNavigation.down: connectionIdEdit
@ -419,7 +419,7 @@ LoginLayout {
Layout.fillWidth: true
contentItem: TextField {
id: connectionIdEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(360)
KeyNavigation.up: registrarUriEdit
Accessible.name: qsTr("login_id")
}
@ -444,9 +444,9 @@ LoginLayout {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
// Layout.leftMargin: Math.round(119 * DefaultStyle.dp)
// anchors.leftMargin: Math.round(119 * DefaultStyle.dp)
// anchors.rightMargin: -8 * DefaultStyle.dp
// Layout.leftMargin: Utils.getSizeWithScreenRatio(119)
// anchors.leftMargin: Utils.getSizeWithScreenRatio(119)
// anchors.rightMargin: - Utils.getSizeWithScreenRatio(8)
},
Control.StackView {
id: rootStackView
@ -454,24 +454,24 @@ LoginLayout {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(127)
width: currentItem ? currentItem.width : 0
},
// Item {
// id: sipItem
// // spacing: Math.round(8 * Defaultstyle.dp)
// // spacing: Utils.getSizeWithScreenRatio(8)
// anchors.fill: parent
// anchors.rightMargin: Math.round(50 * DefaultStyle.dp) + image.width
// anchors.rightMargin: Utils.getSizeWithScreenRatio(50) + image.width
// },
Image {
id: image
z: -1
anchors.top: parent.top
anchors.right: parent.right
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)
anchors.topMargin: Utils.getSizeWithScreenRatio(129)
anchors.rightMargin: Utils.getSizeWithScreenRatio(127)
width: Utils.getSizeWithScreenRatio(395)
height: Utils.getSizeWithScreenRatio(350)
fillMode: Image.PreserveAspectFit
source: AppIcons.loginImage
}

View file

@ -34,7 +34,7 @@ FocusScope {
Layout.preferredHeight: contentHeight
Layout.maximumHeight: mainItem.height / 3
width: mainItem.width
cellWidth: Math.round((50 + 18) * DefaultStyle.dp)
cellWidth: Utils.getSizeWithScreenRatio((50 + 18))
cellHeight: Utils.getSizeWithScreenRatio(80)
// columnCount: Math.floor(width/cellWidth)
model: mainItem.selectedParticipants

View file

@ -6,6 +6,7 @@ import Linphone
import UtilsCpp
import SettingsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
FocusScope {
id: mainItem
@ -16,7 +17,7 @@ FocusScope {
ColumnLayout {
id: formLayout
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
@ -29,14 +30,14 @@ FocusScope {
RowLayout {
visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature
Layout.topMargin: Math.round(20 * DefaultStyle.dp)
Layout.bottomMargin: Math.round(20 * DefaultStyle.dp)
spacing: Math.round(18 * DefaultStyle.dp)
Layout.topMargin: Utils.getSizeWithScreenRatio(20)
Layout.bottomMargin: Utils.getSizeWithScreenRatio(20)
spacing: Utils.getSizeWithScreenRatio(18)
CheckableButton {
Layout.preferredWidth: Math.round(151 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(151)
icon.source: AppIcons.usersThree
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
enabled: false
//: "Réunion"
text: qsTr("meeting_schedule_meeting_label")
@ -45,11 +46,11 @@ FocusScope {
style: ButtonStyle.secondary
}
CheckableButton {
Layout.preferredWidth: Math.round(151 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(151)
enabled: false
icon.source: AppIcons.slide
icon.width: Math.round(24 * DefaultStyle.dp)
icon.height: Math.round(24 * DefaultStyle.dp)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
//: "Webinar"
text: qsTr("meeting_schedule_broadcast_label")
autoExclusive: true
@ -60,14 +61,14 @@ FocusScope {
visible: mainItem.isCreation
spacing: formLayout.spacing
content: RowLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
imageSource: AppIcons.usersThree
colorizationColor: DefaultStyle.main2_600
width: Math.round(24 * DefaultStyle.dp)
height: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
width: Utils.getSizeWithScreenRatio(24)
height: Utils.getSizeWithScreenRatio(24)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
TextInput {
id: confTitle
@ -79,7 +80,7 @@ FocusScope {
text: conferenceInfoGui.core.subject ? conferenceInfoGui.core.subject : ""
color: DefaultStyle.main2_600
font {
pixelSize: Math.round(20 * DefaultStyle.dp)
pixelSize: Utils.getSizeWithScreenRatio(20)
weight: Typography.h3.weight
}
focus: true
@ -100,16 +101,16 @@ FocusScope {
EffectImage {
imageSource: AppIcons.clock
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
CalendarComboBox {
id: startDate
background.visible: mainItem.isCreation
indicator.visible: mainItem.isCreation
contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000)
contentText.font.weight: Math.min(Utils.getSizeWithScreenRatio(isCreation ? 700 : 400), 1000)
Layout.fillWidth: true
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
KeyNavigation.up: confTitle
KeyNavigation.down: startHour
onSelectedDateChanged: {
@ -123,17 +124,17 @@ FocusScope {
},
RowLayout {
Item {
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
RowLayout {
TimeComboBox {
id: startHour
// indicator.visible: mainItem.isCreation
Layout.preferredWidth: Math.round(94 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(94)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
background.visible: mainItem.isCreation
contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000)
contentText.font.weight: Math.min(Utils.getSizeWithScreenRatio(isCreation ? 700 : 400), 1000)
KeyNavigation.up: startDate
KeyNavigation.down: timeZoneCbox
KeyNavigation.left: endHour
@ -150,10 +151,10 @@ FocusScope {
TimeComboBox {
id: endHour
// indicator.visible: mainItem.isCreation
Layout.preferredWidth: Math.round(94 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(94)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
background.visible: mainItem.isCreation
contentText.font.weight: Math.min(Math.round((isCreation ? 700 : 400) * DefaultStyle.dp), 1000)
contentText.font.weight: Math.min(Utils.getSizeWithScreenRatio(isCreation ? 700 : 400), 1000)
onSelectedDateTimeChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime
KeyNavigation.up: startDate
KeyNavigation.down: timeZoneCbox
@ -179,10 +180,10 @@ FocusScope {
ComboBox {
id: timeZoneCbox
Layout.fillWidth: true
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
hoverEnabled: true
oneLine: true
listView.implicitHeight: Math.round(250 * DefaultStyle.dp)
listView.implicitHeight: Utils.getSizeWithScreenRatio(250)
constantImageSource: AppIcons.globe
weight: Typography.p2l.weight
leftMargin: 0
@ -206,20 +207,20 @@ FocusScope {
Section {
spacing: formLayout.spacing
content: RowLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
imageSource: AppIcons.note
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
TextArea {
id: descriptionEdit
Layout.fillWidth: true
Layout.preferredWidth: Math.round(275 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(275)
Layout.preferredHeight: contentHeight
leftPadding: Math.round(8 * DefaultStyle.dp)
rightPadding: Math.round(8 * DefaultStyle.dp)
leftPadding: Utils.getSizeWithScreenRatio(8)
rightPadding: Utils.getSizeWithScreenRatio(8)
//: "Ajouter une description"
placeholderText: qsTr("meeting_schedule_description_hint")
placeholderTextColor: DefaultStyle.main2_600
@ -243,7 +244,7 @@ FocusScope {
background: Rectangle {
anchors.fill: parent
color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent"
radius: Math.round(4 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(4)
}
}
}
@ -254,20 +255,20 @@ FocusScope {
Button {
id: addParticipantsButton
Layout.fillWidth: true
Layout.preferredHeight: Math.round(30 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
leftPadding: 0
background: Rectangle {
anchors.fill: parent
color: addParticipantsButton.hovered || addParticipantsButton.activeFocus ? DefaultStyle.grey_100 : "transparent"
radius: Math.round(4 * DefaultStyle.dp)
radius: Utils.getSizeWithScreenRatio(4)
}
contentItem: RowLayout {
spacing: Math.round(8 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(8)
EffectImage {
imageSource: AppIcons.usersThree
colorizationColor: DefaultStyle.main2_600
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
}
Text {
Layout.fillWidth: true
@ -285,7 +286,7 @@ FocusScope {
id: participantList
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
Layout.maximumHeight: Math.round(250 * DefaultStyle.dp)
Layout.maximumHeight: Utils.getSizeWithScreenRatio(250)
clip: true
model: mainItem.conferenceInfoGui.core.participants
Control.ScrollBar.vertical: ScrollBar {
@ -296,14 +297,14 @@ FocusScope {
visible: participantList.height < participantList.contentHeight
}
delegate: Item {
height: Math.round(56 * DefaultStyle.dp)
height: Utils.getSizeWithScreenRatio(56)
width: participantList.width - participantScrollBar.width
RowLayout {
anchors.fill: parent
spacing: Math.round(16 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(16)
Avatar {
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(45)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(45)
_address: modelData.address
secured: friendSecurityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
shadowEnabled: false
@ -311,18 +312,18 @@ FocusScope {
Text {
property var displayNameObj: UtilsCpp.getDisplayName(modelData.address)
text: displayNameObj?.value || ""
font.pixelSize: Math.round(14 * DefaultStyle.dp)
font.pixelSize: Utils.getSizeWithScreenRatio(14)
font.capitalization: Font.Capitalize
}
Item {
Layout.fillWidth: true
}
Button {
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)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
Layout.rightMargin: Utils.getSizeWithScreenRatio(10)
icon.source: AppIcons.closeX
style: ButtonStyle.noBackgroundOrange
onClicked: mainItem.conferenceInfoGui.core.removeParticipant(index)
@ -341,7 +342,7 @@ FocusScope {
}
Item {
Layout.fillHeight: true
Layout.minimumHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
Layout.minimumHeight: Utils.getSizeWithScreenRatio(1)
}
}
}

View file

@ -4,6 +4,7 @@ import QtQuick.Controls.Basic as Control
import Linphone
import UtilsCpp
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
LoginLayout {
id: mainItem
@ -17,11 +18,11 @@ LoginLayout {
onCtrlIsPressedChanged: console.log("ctrl is pressed", ctrlIsPressed)
titleContent: [
RowLayout {
spacing: Math.round(21 * DefaultStyle.dp)
Layout.leftMargin: Math.round(119 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(21)
Layout.leftMargin: Utils.getSizeWithScreenRatio(119)
Button {
Layout.preferredHeight: Math.round(24 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(24 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
icon.source: AppIcons.leftArrow
style: ButtonStyle.noBackground
onClicked: {
@ -32,8 +33,8 @@ LoginLayout {
EffectImage {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.profile
Layout.preferredHeight: Math.round(34 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(34 * DefaultStyle.dp)
Layout.preferredHeight: Utils.getSizeWithScreenRatio(34)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(34)
colorizationColor: DefaultStyle.main2_600
}
Text {
@ -62,8 +63,8 @@ LoginLayout {
ColumnLayout {
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: Math.round(127 * DefaultStyle.dp)
spacing: Math.round(104 * DefaultStyle.dp)
anchors.leftMargin: Utils.getSizeWithScreenRatio(127)
spacing: Utils.getSizeWithScreenRatio(104)
Text {
font {
bold: true
@ -78,7 +79,7 @@ LoginLayout {
}
}
RowLayout {
spacing: Math.round(45 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(45)
Repeater {
model: 4
id: repeater
@ -143,7 +144,7 @@ LoginLayout {
}
}
RowLayout {
spacing: Math.round(20 * DefaultStyle.dp)
spacing: Utils.getSizeWithScreenRatio(20)
Text {
//: "Vous n'avez pas reçu le code ?"
text: qsTr("assistant_account_creation_confirmation_did_not_receive_code")
@ -164,10 +165,10 @@ LoginLayout {
Image {
anchors.top: parent.top
anchors.right: parent.right
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)
anchors.topMargin: Utils.getSizeWithScreenRatio(140)
anchors.rightMargin: Utils.getSizeWithScreenRatio(97)
width: Utils.getSizeWithScreenRatio(477)
height: Utils.getSizeWithScreenRatio(345)
fillMode: Image.PreserveAspectFit
source: AppIcons.verif_page_image
}

View file

@ -69,7 +69,7 @@ LoginLayout {
},
RowLayout {
spacing: Utils.getSizeWithScreenRatio(20)
Layout.rightMargin: Math.round(Math.max(10 * DefaultStyle.dp,(51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp))
Layout.rightMargin: Math.max(Utils.getSizeWithScreenRatio(10), Utils.getSizeWithScreenRatio(51 - ((51/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))))
Text {
Layout.rightMargin: Utils.getSizeWithScreenRatio(15)
color: DefaultStyle.main2_700
@ -102,7 +102,7 @@ LoginLayout {
Layout.fillWidth: true
id: bar
spacing: Utils.getSizeWithScreenRatio(40)
Layout.rightMargin: Math.round(Math.max(5 * DefaultStyle.dp,(127 - ((127/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))) * DefaultStyle.dp))
Layout.rightMargin: Math.max(Utils.getSizeWithScreenRatio(5), Utils.getSizeWithScreenRatio(127 - ((127/(DefaultStyle.defaultWidth - mainWindow.minimumWidth))*(DefaultStyle.defaultWidth-mainWindow.width))))
// "S'inscrire avec un numéro de téléphone"
model: [qsTr("assistant_account_register_with_phone_number"),
// "S'inscrire avec un email"
@ -122,7 +122,7 @@ LoginLayout {
interactive: true
visible: parent.contentHeight > parent.height
policy: Control.ScrollBar.AsNeeded
anchors.rightMargin: 8 * DefaultStyle.dp
anchors.rightMargin: Utils.getSizeWithScreenRatio(8)
anchors.right: parent.right
}

Some files were not shown because too many files have changed in this diff Show more