From 27b8b726bdb033d8841518bf000be0888dbcdd6d Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Fri, 6 Feb 2026 13:24:25 +0100 Subject: [PATCH] add visible focus on button to ease key navigation allow call from pressing enter in new call search bar if dialer open fix key navigation in start call popup when several addresses --- Linphone/data/languages/de.ts | 2 +- Linphone/data/languages/en.ts | 2 +- Linphone/data/languages/fr.ts | 2 +- Linphone/tool/Utils.cpp | 4 +++ .../Display/Contact/ContactListView.qml | 7 +++++ Linphone/view/Control/Input/NumericPad.qml | 4 +-- Linphone/view/Control/Input/SearchBar.qml | 2 +- Linphone/view/Page/Main/Call/CallPage.qml | 5 ++++ Linphone/view/Page/Window/AbstractWindow.qml | 30 +++++++++++++++---- Linphone/view/Style/buttonStyle.js | 8 +++++ 10 files changed, 55 insertions(+), 11 deletions(-) diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 23f5dfbb3..d779ee270 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -31,7 +31,7 @@ Telefonnummer oder SIP-Adresse wählen - + fps_counter %1 FPS diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 9a2f50c06..ea9cf54d9 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -31,7 +31,7 @@ Choose a SIP number or address - + fps_counter %1 FPS diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 6c52d79b1..d8439a33d 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -31,7 +31,7 @@ Choisissez un numéro ou adresse SIP - + fps_counter %1 FPS diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index a99161e35..29a0fd3ad 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -445,6 +445,7 @@ VariantObject *Utils::findAvatarByAddress(const QString &address) { VariantObject *data = new VariantObject("findAvatarByAddress", ""); if (!data) return nullptr; data->makeRequest([address]() -> QVariant { + if (CoreModel::getInstance()->getCore()->getGlobalState() != linphone::GlobalState::On) return QVariant(); QString avatar; auto defaultFriendList = ToolModel::getAppFriendList(); if (!defaultFriendList) return QVariant(); @@ -469,6 +470,7 @@ VariantObject *Utils::findFriendByAddress(const QString &address) { VariantObject *data = new VariantObject("findFriendByAddress"); if (!data) return nullptr; data->makeRequest([address]() { + if (CoreModel::getInstance()->getCore()->getGlobalState() != linphone::GlobalState::On) return QVariant(); auto linFriend = ToolModel::findFriendByAddress(address); if (!linFriend) return QVariant(); auto friendCore = FriendCore::create(linFriend); @@ -490,6 +492,7 @@ VariantObject *Utils::getFriendSecurityLevel(const QString &address) { VariantObject *data = new VariantObject("getFriendAddressSecurityLevel"); if (!data) return nullptr; data->makeRequest([address]() { + if (CoreModel::getInstance()->getCore()->getGlobalState() != linphone::GlobalState::On) return QVariant(); auto defaultFriendList = ToolModel::getAppFriendList(); if (!defaultFriendList) return QVariant(); auto linphoneAddr = ToolModel::interpretUrl(address); @@ -509,6 +512,7 @@ VariantObject *Utils::getFriendAddressSecurityLevel(const QString &address) { VariantObject *data = new VariantObject("getFriendAddressSecurityLevel"); if (!data) return nullptr; data->makeRequest([address]() { + if (CoreModel::getInstance()->getCore()->getGlobalState() != linphone::GlobalState::On) return QVariant(); auto defaultFriendList = ToolModel::getAppFriendList(); if (!defaultFriendList) return QVariant(); auto linphoneAddr = ToolModel::interpretUrl(address); diff --git a/Linphone/view/Control/Display/Contact/ContactListView.qml b/Linphone/view/Control/Display/Contact/ContactListView.qml index 92489be1a..ca86cd767 100644 --- a/Linphone/view/Control/Display/Contact/ContactListView.qml +++ b/Linphone/view/Control/Display/Contact/ContactListView.qml @@ -178,6 +178,13 @@ ListView { Layout.rightMargin: mainItem.itemsRightMargin focus: true onClicked: mainItem.expanded = !mainItem.expanded + Rectangle { + anchors.fill: headerExpandButton + radius: headerExpandButton.width/2 + visible: headerExpandButton.activeFocus + opacity: 0.5 + color: DefaultStyle.main2_200 + } Accessible.name: (mainItem.expanded ? //: Shrink %1 qsTr("shrink_accessible_name") : diff --git a/Linphone/view/Control/Input/NumericPad.qml b/Linphone/view/Control/Input/NumericPad.qml index 074c7c3cb..f145c14e1 100644 --- a/Linphone/view/Control/Input/NumericPad.qml +++ b/Linphone/view/Control/Input/NumericPad.qml @@ -90,7 +90,7 @@ FocusScope { mainItem.buttonPressed("+") event.accepted = true } - if (event.key === Qt.Key_Enter) { + if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { mainItem.launchCall() event.accepted = true } @@ -98,7 +98,7 @@ FocusScope { Keys.onPressed: (event) => { event.accepted = false - if (event.modifiers & Qt.KeypadModifier) { + if (event.modifiers & Qt.KeypadModifier || event.key === Qt.Key_Return) { handleKeyPadEvent(event) } if (event.key === Qt.Key_Backspace) { diff --git a/Linphone/view/Control/Input/SearchBar.qml b/Linphone/view/Control/Input/SearchBar.qml index f335db3d0..7a923c294 100644 --- a/Linphone/view/Control/Input/SearchBar.qml +++ b/Linphone/view/Control/Input/SearchBar.qml @@ -106,7 +106,7 @@ FocusScope { } Keys.onPressed: (event) => { event.accepted = false - if (mainItem.numericPadPopup && mainItem.numericPadPopup.opened && (event.modifiers & Qt.KeypadModifier)) { + if (mainItem.numericPadPopup && mainItem.numericPadPopup.opened && (event.modifiers & Qt.KeypadModifier || event.key === Qt.Key_Return)) { mainItem.numericPadPopup.keyPadKeyPressed(event) event.accepted = true } diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 58786d3a1..8ecdf393c 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -219,6 +219,11 @@ AbstractMainPage { when: searchBar.text.length != 0 value: false } + Keys.onPressed: (event) => { + if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { + mainItem.createCallFromSearchBarRequested() + } + } } Rectangle { visible: SettingsCpp.callForwardToAddress.length > 0 diff --git a/Linphone/view/Page/Window/AbstractWindow.qml b/Linphone/view/Page/Window/AbstractWindow.qml index 8ef87fdf2..7d54b0aa6 100644 --- a/Linphone/view/Page/Window/AbstractWindow.qml +++ b/Linphone/view/Page/Window/AbstractWindow.qml @@ -90,8 +90,6 @@ ApplicationWindow { RoundButton { Layout.alignment: Qt.AlignVCenter style: ButtonStyle.noBackground - Layout.preferredWidth: Utils.getSizeWithScreenRatio(24) - Layout.preferredHeight: Utils.getSizeWithScreenRatio(24) icon.source:AppIcons.closeX onClicked: addressChooserPopup.close() } @@ -101,12 +99,25 @@ ApplicationWindow { model: VariantList { model: addressChooserPopup.contact && addressChooserPopup.contact.core.allAddresses || [] } - Layout.fillWidth: true - Layout.preferredHeight: contentHeight spacing: Utils.getSizeWithScreenRatio(10) - delegate: Item { + keyNavigationEnabled: true + Layout.fillWidth: true + activeFocusOnTab: true + onVisibleChanged: if (visible) forceActiveFocus() + onActiveFocusChanged: { + if (activeFocus) currentIndex = 0 + else currentIndex = -1 + } + Keys.onPressed: event => { + if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter || event.key == Qt.Key_Space) { + addressChooserPopup.addressChosen(itemAtIndex(popuplist.currentIndex).address) + } + } + Layout.preferredHeight: contentHeight + delegate: FocusScope { width: popuplist.width height: Utils.getSizeWithScreenRatio(56) + property string address: modelData.address ColumnLayout { width: popuplist.width anchors.verticalCenter: parent.verticalCenter @@ -137,9 +148,18 @@ ApplicationWindow { color: DefaultStyle.main2_200 } } + Rectangle { + anchors.fill: parent + opacity: 0.7 + visible: index === popuplist.currentIndex + color: DefaultStyle.main2_100 + radius: Utils.getSizeWithScreenRatio(8) + } MouseArea { + id: delegateMouseArea anchors.fill: parent hoverEnabled: true + focus: true cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor onClicked: { addressChooserPopup.addressChosen(modelData.address) diff --git a/Linphone/view/Style/buttonStyle.js b/Linphone/view/Style/buttonStyle.js index 19759cb56..eda1dc96b 100644 --- a/Linphone/view/Style/buttonStyle.js +++ b/Linphone/view/Style/buttonStyle.js @@ -168,6 +168,10 @@ pressed: "#00000000", checked: "#00000000" }, + borderColor: { + normal: "#00000000", + keybaordFocused: Linphone.DefaultStyle.main2_900 + }, text: { normal: Linphone.DefaultStyle.main2_200, hovered: Linphone.DefaultStyle.main2_300, @@ -190,6 +194,10 @@ pressed: "#00000000", checked: "#00000000" }, + borderColor: { + normal: "#00000000", + keybaordFocused: Linphone.DefaultStyle.main2_900 + }, text: { normal: Linphone.DefaultStyle.main2_600, hovered: Linphone.DefaultStyle.main2_700,