linphone-desktop/Linphone/view/Control/Input/PhoneNumberInput.qml
Gaelle Braud 97b1d11adb Fixes:
improve unencrypted conversations warning indicator #LINQT-2061

allow user to choose an address for sending message when multiple addresses in contact #LINQT-2054

verify friend has a core to avoid crash in liblinphone #LINQT-1933

wait for window to be active before calling markAsRead (fix #LINQT-2048)

fix button text color (fix #LINQT-1832)

change format for mkv #LINQT-2056

Registration : check phone number format #LINQT-2044

fix window closing even if a new call is started #LINQT-2055

display popup to delete meetings on right click in meeting list item (allow to delete canceled meetings which cannot be displayed in the right panel)
2025-10-15 17:25:00 +02:00

96 lines
3 KiB
QML

import QtQuick
import QtQuick.Controls.Basic as Control
import QtQuick.Layouts
import Linphone
import CustomControls 1.0
ColumnLayout {
id: mainItem
property string label: ""
property alias errorMessage: errorText.text
property string placeholderText : ""
property bool mandatory: false
property bool enableErrorText: true
property real textInputWidth: width
property string initialPhoneNumber
readonly property string phoneNumber: textField.text
readonly property string countryCode: combobox.text
property string defaultCallingCode
property bool keyboardFocus: FocusHelper.keyboardFocus
spacing: Math.round(5 * DefaultStyle.dp)
Text {
visible: label.length > 0
verticalAlignment: Text.AlignVCenter
text: mainItem.label + (mainItem.mandatory ? "*" : "")
color: (combobox.hasActiveFocus || textField.hasActiveFocus) ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
font {
pixelSize: Typography.p2.pixelSize
weight: Typography.p2.weight
}
}
Control.Control {
Layout.preferredWidth: mainItem.width
Layout.preferredHeight: Math.round(49 * DefaultStyle.dp)
leftPadding: Math.round(16 * DefaultStyle.dp)
background: Rectangle {
id: contentBackground
anchors.fill: parent
radius: Math.round(63 * DefaultStyle.dp)
color: DefaultStyle.grey_100
border.color: mainItem.errorMessage.length > 0
? DefaultStyle.danger_500_main
: (textField.hasActiveFocus || combobox.hasActiveFocus)
? DefaultStyle.main1_500_main
: DefaultStyle.grey_200
}
contentItem: RowLayout {
CountryIndicatorCombobox {
id: combobox
implicitWidth: Math.round(110 * DefaultStyle.dp)
Layout.fillHeight: true
defaultCallingCode: mainItem.defaultCallingCode
property bool keyboardFocus: FocusHelper.keyboardFocus
//: %1 prefix
Accessible.name: qsTr("prefix_phone_number_accessible_name").arg(mainItem.Accessible.name)
}
Rectangle {
Layout.preferredWidth: Math.max(Math.round(1 * DefaultStyle.dp), 1)
Layout.fillHeight: true
Layout.topMargin: Math.round(10 * DefaultStyle.dp)
Layout.bottomMargin: Math.round(10 * DefaultStyle.dp)
color: DefaultStyle.main2_600
}
TextField {
id: textField
Layout.fillWidth: true
placeholderText: mainItem.placeholderText
background: Item{}
initialText: initialPhoneNumber
validator: RegularExpressionValidator{ regularExpression: /[0-9]+/}
property bool keyboardFocus: FocusHelper.keyboardFocus
//: %1 number
Accessible.name: qsTr("number_phone_number_accessible_name").arg(mainItem.Accessible.name)
}
}
}
TemporaryText {
id: errorText
Layout.fillWidth: true
Layout.topMargin: Math.round(-3 * DefaultStyle.dp)
// visible: mainItem.enableErrorText
text: mainItem.errorMessage
color: DefaultStyle.danger_500_main
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
wrapMode: Text.Wrap
font {
pixelSize: Math.round(13 * DefaultStyle.dp)
family: DefaultStyle.defaultFont
bold: true
}
}
}