diff --git a/Linphone/view/Control/Button/PopupButton.qml b/Linphone/view/Control/Button/PopupButton.qml index 38d4724bd..285dd80ad 100644 --- a/Linphone/view/Control/Button/PopupButton.qml +++ b/Linphone/view/Control/Button/PopupButton.qml @@ -12,6 +12,7 @@ Button { property alias popupBackgroundColor: popupBackground.color property color backgroundColor: checked ? pressedColor : hovered || mainItem.activeFocus ? hoveredColor : color property string popUpTitle: "" + property int popupY: height Accessible.name: popup.visible ? //: "Close %1 popup" qsTr("close_popup_panel_accessible_name").arg(popUpTitle) : @@ -135,7 +136,7 @@ Button { Control.Popup { id: popup x: 0 - y: mainItem.height + y: mainItem.popupY visible: false closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside | Popup.CloseOnEscape padding: Utils.getSizeWithScreenRatio(10) @@ -150,7 +151,7 @@ Button { "y": 0 }; // Stay inside main window - y = Math.max(Math.min(winPosition.y + mainItem.Window.height - popupHeight, mainItem.height), winPosition.y); + y = Math.max(Math.min(winPosition.y + mainItem.Window.height - popupHeight, mainItem.popupY), winPosition.y); x = Math.max(Math.min(winPosition.x + mainItem.Window.width - popupWidth, 0), winPosition.x); // Avoid overlapping with popup button by going to the right (todo: check if left is better?) if (y < mainItem.height && y + popupHeight > 0) { diff --git a/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml b/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml index 16566de16..ea2b32f32 100644 --- a/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml +++ b/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml @@ -62,6 +62,21 @@ ColumnLayout { searchModel.append({path: searchResult[i]}) } } + function clearSearchField() { + mainItem.searchMode = false + searchField.widthSize = 0 + list.model = mainItem.categories + searchField.clear() + } + Keys.onPressed: event => { + if (event.text && (mainItem.activeFocus || mainItem.focus)) { + mainItem.searchMode = true + searchField.widthSize = categoriesRow.width - Utils.getSizeWithScreenRatio(25) + list.model = 1 + searchField.focus = true + searchField.text = event.text + } + } RowLayout { id: categoriesRow Layout.preferredWidth: parent.width - Utils.getSizeWithScreenRatio(15) @@ -95,10 +110,7 @@ ColumnLayout { anchors.fill: parent cursorShape: Qt.PointingHandCursor onClicked: { - mainItem.searchMode = false - searchField.widthSize = 0 - list.model = mainItem.categories - searchField.clear() + mainItem.clearSearchField() } } } diff --git a/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml b/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml index ff8bf46d6..9711e5f04 100644 --- a/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml +++ b/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml @@ -85,11 +85,23 @@ Control.Control { visible: !mainItem.isEditing style: ButtonStyle.noBackground icon.source: checked ? AppIcons.closeX : AppIcons.smiley + popupY: - popup.height popup.width: Utils.getSizeWithScreenRatio(393) popup.height: Utils.getSizeWithScreenRatio(291) popup.contentItem: EmojiPicker { + id: emojiPicker editor: sendingTextArea } + Connections { + target: emojiPickerButton.popup + function onOpened() { + emojiPicker.forceActiveFocus() + } + function onClosed() { + emojiPicker.clearSearchField() + } + + } } BigButton { style: ButtonStyle.noBackground