mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 20:08:28 +00:00
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
This commit is contained in:
parent
bbb60d884a
commit
27b8b726bd
10 changed files with 55 additions and 11 deletions
|
|
@ -31,7 +31,7 @@
|
|||
<translation>Telefonnummer oder SIP-Adresse wählen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="309"/>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="331"/>
|
||||
<source>fps_counter</source>
|
||||
<translation>%1 FPS</translation>
|
||||
</message>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<translation>Choose a SIP number or address</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="309"/>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="331"/>
|
||||
<source>fps_counter</source>
|
||||
<translation>%1 FPS</translation>
|
||||
</message>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<translation>Choisissez un numéro ou adresse SIP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="309"/>
|
||||
<location filename="../../view/Page/Window/AbstractWindow.qml" line="331"/>
|
||||
<source>fps_counter</source>
|
||||
<translation>%1 FPS</translation>
|
||||
</message>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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") :
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue