mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
open numeric from magic search bar
This commit is contained in:
parent
b2d75517e8
commit
e4d6cb4dfd
3 changed files with 27 additions and 9 deletions
|
|
@ -18,14 +18,15 @@ Item {
|
|||
property var contextualMenuOpenedComponent: undefined
|
||||
|
||||
signal addAccountRequest()
|
||||
signal openNewCall()
|
||||
signal openNewCallRequest()
|
||||
signal openCallHistory()
|
||||
signal openNumPadRequest()
|
||||
signal displayContactRequested(string contactAddress)
|
||||
signal createContactRequested(string name, string address)
|
||||
|
||||
function goToNewCall() {
|
||||
tabbar.currentIndex = 0
|
||||
mainItem.openNewCall()
|
||||
mainItem.openNewCallRequest()
|
||||
}
|
||||
function goToCallHistory() {
|
||||
tabbar.currentIndex = 0
|
||||
|
|
@ -139,6 +140,15 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Rechercher un contact, appeler ou envoyer un message...")
|
||||
focusedBorderColor: DefaultStyle.main1_500_main
|
||||
numericPadButton.visible: text.length === 0
|
||||
numericPadButton.checkable: false
|
||||
Connections {
|
||||
target: magicSearchBar.numericPadButton
|
||||
function onClicked() {
|
||||
mainItem.goToNewCall()
|
||||
mainItem.openNumPadRequest()
|
||||
}
|
||||
}
|
||||
onTextChanged: {
|
||||
if (text.length != 0) listPopup.open()
|
||||
else listPopup.close()
|
||||
|
|
@ -477,8 +487,9 @@ Item {
|
|||
id: callPage
|
||||
Connections {
|
||||
target: mainItem
|
||||
function onOpenNewCall(){ callPage.goToNewCall()}
|
||||
function onOpenNewCallRequest(){ callPage.goToNewCall()}
|
||||
function onOpenCallHistory(){ callPage.goToCallHistory()}
|
||||
function onOpenNumPadRequest(){ callPage.openNumPadRequest()}
|
||||
}
|
||||
onCreateContactRequested: (name, address) => {
|
||||
mainItem.createContact(name, address)
|
||||
|
|
|
|||
|
|
@ -101,10 +101,6 @@ FocusScope {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 15 * DefaultStyle.dp
|
||||
onCheckedChanged: {
|
||||
if (checked) mainItem.numericPad.open()
|
||||
else mainItem.numericPad.close()
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: clearTextButton
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ AbstractMainPage {
|
|||
signal startGroupCallRequested()
|
||||
signal createCallFromSearchBarRequested()
|
||||
signal createContactRequested(string name, string address)
|
||||
signal openNumPadRequest()
|
||||
|
||||
Connections {
|
||||
enabled: confInfoGui
|
||||
|
|
@ -48,10 +49,10 @@ AbstractMainPage {
|
|||
showDefaultItem: listStackView.currentItem.listView && listStackView.currentItem.listView.count === 0 && listStackView.currentItem.listView.model.sourceModel.count === 0 || false
|
||||
|
||||
function goToNewCall() {
|
||||
listStackView.push(newCallItem)
|
||||
if (listStackView.currentItem.objectName != "newCallItem") listStackView.push(newCallItem)
|
||||
}
|
||||
function goToCallHistory() {
|
||||
listStackView.pop()
|
||||
if (listStackView.currentItem.objectName != "historyListItem") listStackView.replace(historyListItem)
|
||||
}
|
||||
|
||||
Dialog {
|
||||
|
|
@ -106,6 +107,7 @@ AbstractMainPage {
|
|||
id: numericPad
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: false
|
||||
onLaunchCall: {
|
||||
mainItem.createCallFromSearchBarRequested()
|
||||
// TODO : auto completion instead of sip linphone
|
||||
|
|
@ -471,6 +473,7 @@ AbstractMainPage {
|
|||
Component {
|
||||
id: newCallItem
|
||||
FocusScope{
|
||||
objectName: "newCallItem"
|
||||
width: parent?.width
|
||||
height: parent?.height
|
||||
Control.StackView.onActivated:{
|
||||
|
|
@ -498,6 +501,14 @@ AbstractMainPage {
|
|||
Connections {
|
||||
target: mainItem
|
||||
function onCreateCallFromSearchBarRequested(){ UtilsCpp.createCall(callContactsList.searchBar.text)}
|
||||
function onOpenNumPadRequest(){ if (!callContactsList.searchBar.numericPadButton.checked) callContactsList.searchBar.numericPadButton.checked = true}
|
||||
}
|
||||
Binding {
|
||||
target: numericPad
|
||||
property: "visible"
|
||||
value: true
|
||||
when: callContactsList.searchBar.numericPadButton.checked
|
||||
restoreMode: Binding.RestoreValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue