dialer in call

This commit is contained in:
Gaelle Braud 2023-11-22 13:25:28 +01:00
parent 3e06e3c55d
commit f82f3cf189
4 changed files with 32 additions and 34 deletions

View file

@ -433,39 +433,34 @@ Window {
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
SearchBar { SearchBar {
id: dialerTextInput id: dialerTextInput
Layout.fillWidth: true Layout.fillWidth: true
// Layout.maximumWidth: mainItem.width Layout.leftMargin: 10 * DefaultStyle.dp
Layout.rightMargin: 10 * DefaultStyle.dp
magnifierVisible: false
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
borderColor: DefaultStyle.grey_200 borderColor: DefaultStyle.grey_200
placeholderText: "" placeholderText: ""
numericPad: numPad numericPad: numPad
Component.onCompleted: numericPad.visible = true
numericPadButton.visible: false numericPadButton.visible: false
} }
Item { Item {
Component.onCompleted: console.log("num pad", x, y, width, height)
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: numPad.height Layout.preferredHeight: numPad.height
Layout.fillHeight: numPad.height Layout.topMargin: 10 * DefaultStyle.dp
Layout.alignment: Qt.AlignBottom
visible: false
onVisibleChanged: {
console.log("visible cvhanged", visible)
if (visible) numPad.open()
else numPad.close()
}
NumericPad { NumericPad {
id: numPad id: numPad
width: parent.width width: parent.width
visible: parent.visible visible: parent.visible
closeButtonVisible: false closeButtonVisible: false
onVisibleChanged: { onLaunchCall: {
console.log("visible numpad", visible, parent.visible) var callVarObject = UtilsCpp.createCall(dialerTextInput.text + "@sip.linphone.org")
} }
onOpened: console.log("open")
onClosed: console.log("close")
} }
} }
} }
@ -577,9 +572,8 @@ Window {
enabledIcon: AppIcons.verticalDots enabledIcon: AppIcons.verticalDots
Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
onCheckedChanged: { onPressed: {
if (checked) moreOptionsMenu.open() moreOptionsMenu.visible = !moreOptionsMenu.visible
else moreOptionsMenu.close()
} }
} }
Popup { Popup {
@ -588,14 +582,8 @@ Window {
y: moreOptionsButton.y - height y: moreOptionsButton.y - height
padding: 20 * DefaultStyle.dp padding: 20 * DefaultStyle.dp
closePolicy: Control.Popup.CloseOnEscape // closePolicy: Control.Popup.CloseOnEscape
onClosed: moreOptionsButton.checked = false onAboutToHide: moreOptionsButton.checked = false
Connections {
target: rightPanel
onVisibleChanged: if (!rightPanel.visible) moreOptionsMenu.close()
}
contentItem: ColumnLayout { contentItem: ColumnLayout {
id: optionsList id: optionsList
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
@ -604,7 +592,7 @@ Window {
id: dialerButton id: dialerButton
// width: 150 // width: 150
Layout.fillWidth: true Layout.fillWidth: true
height: 32 * DefaultStyle.dp // height: 32 * DefaultStyle.dp
background: Item { background: Item {
visible: false visible: false
} }
@ -627,7 +615,7 @@ Window {
Control.Button { Control.Button {
id: speakerButton id: speakerButton
Layout.fillWidth: true Layout.fillWidth: true
height: 32 * DefaultStyle.dp // height: 32 * DefaultStyle.dp
checkable: true checkable: true
background: Item { background: Item {
visible: false visible: false

View file

@ -30,9 +30,16 @@ Control.Popup {
source: numPadBackground source: numPadBackground
shadowEnabled: true shadowEnabled: true
shadowColor: DefaultStyle.grey_1000 shadowColor: DefaultStyle.grey_1000
shadowOpacity: 0.1 shadowOpacity: 0.8
shadowHorizontalOffset: 10 * DefaultStyle.dp
shadowBlur: 1 shadowBlur: 1
} }
Rectangle {
width: parent.width
height: parent.height / 2
anchors.bottom: parent.bottom
color: DefaultStyle.grey_100
}
Button { Button {
id: closeButton id: closeButton
visible: mainItem.closeButtonVisible visible: mainItem.closeButtonVisible

View file

@ -10,6 +10,7 @@ Rectangle {
property int textInputWidth: 350 * DefaultStyle.dp property int textInputWidth: 350 * DefaultStyle.dp
property color borderColor: "transparent" property color borderColor: "transparent"
property string text: textField.text property string text: textField.text
property bool magnifierVisible: true
property var validator: RegularExpressionValidator{} property var validator: RegularExpressionValidator{}
property Control.Popup numericPad property Control.Popup numericPad
property alias numericPadButton: dialerButton property alias numericPadButton: dialerButton
@ -36,6 +37,7 @@ Rectangle {
border.color: textField.activeFocus ? DefaultStyle.main2_500main : mainItem.borderColor border.color: textField.activeFocus ? DefaultStyle.main2_500main : mainItem.borderColor
Image { Image {
id: magnifier id: magnifier
visible: mainItem.magnifierVisible
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 10 * DefaultStyle.dp anchors.leftMargin: 10 * DefaultStyle.dp
@ -45,7 +47,8 @@ Rectangle {
} }
Control.TextField { Control.TextField {
id: textField id: textField
anchors.left: magnifier.right anchors.left: magnifier.visible ? magnifier.right : parent.left
anchors.leftMargin: magnifier.visible ? 0 : 10 * DefaultStyle.dp
anchors.right: clearTextButton.left anchors.right: clearTextButton.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
placeholderText: mainItem.placeholderText placeholderText: mainItem.placeholderText
@ -63,9 +66,9 @@ Rectangle {
opacity: 0. opacity: 0.
} }
cursorDelegate: Rectangle { cursorDelegate: Rectangle {
visible: textField.activeFocus visible: textField.cursorVisible
color: DefaultStyle.main1_500_main color: DefaultStyle.main2_500main
width: 2 * DefaultStyle.dp width: 1 * DefaultStyle.dp
} }
} }
Control.Button { Control.Button {

View file

@ -19,4 +19,4 @@ Control.ToolTip {
wrapMode: Text.Wrap wrapMode: Text.Wrap
elide: Text.ElideRight elide: Text.ElideRight
} }
} }