mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix #LINQT-1878 emoji picker popup closing
This commit is contained in:
parent
c24cfe135a
commit
80d6a75377
6 changed files with 63 additions and 55 deletions
|
|
@ -103,13 +103,13 @@ Control.TabBar {
|
|||
bottomInset: Math.round(32 * DefaultStyle.dp)
|
||||
topInset: Math.round(32 * DefaultStyle.dp)
|
||||
hoverEnabled: true
|
||||
visible: modelData?.visible != undefined ? modelData?.visible : true
|
||||
visible: modelData?.visible != undefined ? modelData.visible : true
|
||||
UnreadNotification {
|
||||
unread: !defaultAccount
|
||||
? -1
|
||||
: index == 0
|
||||
: index === 0
|
||||
? defaultAccount.core?.unreadCallNotifications || -1
|
||||
: index == 2
|
||||
: index === 2
|
||||
? defaultAccount.core?.unreadMessageNotifications || -1
|
||||
: 0
|
||||
anchors.right: parent.right
|
||||
|
|
|
|||
|
|
@ -177,10 +177,14 @@ ListView {
|
|||
spacing: Math.round(10 * DefaultStyle.dp)
|
||||
Avatar {
|
||||
id: historyAvatar
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.peerAddress)
|
||||
property var contactObj: modelData ? UtilsCpp.findFriendByAddress(modelData.core.peerAddress) : null
|
||||
contact: contactObj?.value || null
|
||||
displayNameVal: contact ? undefined : modelData.core.avatarUri
|
||||
secured: modelData.core.isSecured
|
||||
displayNameVal: contact
|
||||
? undefined
|
||||
: modelData
|
||||
? modelData.core.avatarUri
|
||||
: null
|
||||
secured: modelData?.core.isSecured || false
|
||||
Layout.preferredWidth: Math.round(45 * DefaultStyle.dp)
|
||||
Layout.preferredHeight: Math.round(45 * DefaultStyle.dp)
|
||||
// isConference: modelData.core.isConference
|
||||
|
|
@ -195,7 +199,7 @@ ListView {
|
|||
id: friendAddress
|
||||
Layout.fillWidth: true
|
||||
maximumLineCount: 1
|
||||
text: modelData.core.title
|
||||
text: modelData? modelData.core.title : ""
|
||||
color: DefaultStyle.main2_800
|
||||
font {
|
||||
pixelSize: Typography.p1.pixelSize
|
||||
|
|
@ -258,7 +262,7 @@ ListView {
|
|||
Layout.fillWidth: true
|
||||
maximumLineCount: 1
|
||||
visible: !remoteComposingInfo.visible
|
||||
text: modelData.core.lastMessageText
|
||||
text: modelData ? modelData.core.lastMessageText : ""
|
||||
color: DefaultStyle.main2_400
|
||||
font {
|
||||
pixelSize: Typography.p1.pixelSize
|
||||
|
|
@ -267,19 +271,21 @@ ListView {
|
|||
}
|
||||
Text {
|
||||
id: remoteComposingInfo
|
||||
visible: (modelData.core.composingName !== "" || modelData.core.sendingText !== "")
|
||||
visible: modelData ? (modelData.core.composingName !== "" || modelData.core.sendingText !== "") : false
|
||||
Layout.fillWidth: true
|
||||
maximumLineCount: 1
|
||||
font {
|
||||
pixelSize: Typography.p3.pixelSize
|
||||
weight: Typography.p3.weight
|
||||
italic: modelData.core.sendingText !== ""
|
||||
italic: modelData?.core.sendingText !== ""
|
||||
}
|
||||
//: %1 is writing…
|
||||
text: modelData.core.composingName !== ""
|
||||
text: modelData
|
||||
? modelData.core.composingName !== ""
|
||||
? qsTr("chat_message_is_writing_info").arg(modelData.core.composingName)
|
||||
: modelData.core.sendingText !== ""
|
||||
? qsTr("chat_message_draft_sending_text").arg(modelData.core.sendingText)
|
||||
: ""
|
||||
: ""
|
||||
}
|
||||
}
|
||||
|
|
@ -290,7 +296,7 @@ ListView {
|
|||
Item{Layout.fillWidth: true}
|
||||
Text {
|
||||
color: DefaultStyle.main2_500main
|
||||
text: UtilsCpp.formatDate(modelData.core.lastUpdatedTime, true, false)
|
||||
text: modelData ? UtilsCpp.formatDate(modelData.core.lastUpdatedTime, true, false) : ""
|
||||
font {
|
||||
pixelSize: Typography.p3.pixelSize
|
||||
weight: Typography.p3.weight
|
||||
|
|
@ -303,7 +309,7 @@ ListView {
|
|||
spacing: Math.round(10 * DefaultStyle.dp)
|
||||
Item {Layout.fillWidth: true}
|
||||
EffectImage {
|
||||
visible: modelData?.core.ephemeralEnabled
|
||||
visible: modelData?.core.ephemeralEnabled || false
|
||||
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
|
||||
Layout.preferredHeight: 14 * DefaultStyle.dp
|
||||
colorizationColor: DefaultStyle.main2_400
|
||||
|
|
@ -318,15 +324,16 @@ ListView {
|
|||
}
|
||||
UnreadNotification {
|
||||
id: unreadCount
|
||||
unread: modelData.core.unreadMessagesCount
|
||||
unread: modelData?.core.unreadMessagesCount || false
|
||||
}
|
||||
EffectImage {
|
||||
visible: modelData?.core.lastMessage && modelData?.core.lastMessageState !== LinphoneEnums.ChatMessageState.StateIdle
|
||||
visible: modelData?.core.lastMessage && modelData?.core.lastMessageState !== LinphoneEnums.ChatMessageState.StateIdle || false
|
||||
&& !modelData.core.lastMessage.core.isRemoteMessage
|
||||
Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0
|
||||
Layout.preferredHeight: 14 * DefaultStyle.dp
|
||||
colorizationColor: DefaultStyle.main1_500_main
|
||||
imageSource: modelData.core.lastMessageState === LinphoneEnums.ChatMessageState.StateDelivered
|
||||
imageSource: modelData
|
||||
? modelData.core.lastMessageState === LinphoneEnums.ChatMessageState.StateDelivered
|
||||
? AppIcons.envelope
|
||||
: modelData.core.lastMessageState === LinphoneEnums.ChatMessageState.StateDeliveredToUser
|
||||
? AppIcons.check
|
||||
|
|
@ -335,6 +342,7 @@ ListView {
|
|||
: modelData.core.lastMessageState === LinphoneEnums.ChatMessageState.StateDisplayed
|
||||
? AppIcons.checks
|
||||
: ""
|
||||
: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -348,8 +356,12 @@ ListView {
|
|||
popup.contentItem: ColumnLayout {
|
||||
IconLabelButton {
|
||||
//: "Mute"
|
||||
text: modelData.core.muted ? qsTr("chat_room_unmute") : qsTr("chat_room_mute")
|
||||
icon.source: modelData.core.muted ? AppIcons.bell : AppIcons.bellSlash
|
||||
text: modelData
|
||||
? modelData.core.muted
|
||||
? qsTr("chat_room_unmute")
|
||||
: qsTr("chat_room_mute")
|
||||
: ""
|
||||
icon.source: modelData ? modelData.core.muted ? AppIcons.bell : AppIcons.bellSlash : ""
|
||||
spacing: Math.round(10 * DefaultStyle.dp)
|
||||
Layout.fillWidth: true
|
||||
onClicked: {
|
||||
|
|
@ -378,7 +390,7 @@ ListView {
|
|||
id: leaveButton
|
||||
//: "leave"
|
||||
text: qsTr("chat_room_leave")
|
||||
visible: !modelData.core.isReadOnly && modelData.core.isGroupChat
|
||||
visible: modelData ? !modelData.core.isReadOnly && modelData.core.isGroupChat : false
|
||||
icon.source: AppIcons.trashCan
|
||||
spacing: Math.round(10 * DefaultStyle.dp)
|
||||
Layout.fillWidth: true
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Control.Control {
|
|||
property var textArea
|
||||
property int selectedFilesCount: 0
|
||||
// property alias cursorPosition: sendingTextArea.cursorPosition
|
||||
property bool emojiPickerButtonChecked
|
||||
property Popup emojiPicker
|
||||
|
||||
property bool dropEnabled: true
|
||||
property bool isEphemeral : false
|
||||
|
|
@ -82,14 +82,11 @@ Control.Control {
|
|||
BigButton {
|
||||
id: emojiPickerButton
|
||||
style: ButtonStyle.noBackground
|
||||
checkable: true
|
||||
checked: mainItem.emojiPicker?.visible || false
|
||||
icon.source: checked ? AppIcons.closeX : AppIcons.smiley
|
||||
onCheckedChanged: mainItem.emojiPickerButtonChecked = checked
|
||||
Connections {
|
||||
target: mainItem
|
||||
function onEmojiPickerButtonCheckedChanged() {
|
||||
emojiPickerButton.checked = mainItem.emojiPickerButtonChecked
|
||||
}
|
||||
onPressed: {
|
||||
if (!checked) mainItem.emojiPicker.open()
|
||||
else mainItem.emojiPicker.close()
|
||||
}
|
||||
}
|
||||
BigButton {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ FocusScope {
|
|||
checked: numericPadPopup?.visible || false
|
||||
style: ButtonStyle.noBackground
|
||||
icon.source: AppIcons.dialer
|
||||
contentImageColor: dialerButton.checked ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
|
||||
contentImageColor: checked ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
|
||||
hoveredImageColor: contentImageColor
|
||||
width: Math.round(24 * DefaultStyle.dp)
|
||||
height: Math.round(24 * DefaultStyle.dp)
|
||||
|
|
|
|||
|
|
@ -275,9 +275,10 @@ FocusScope {
|
|||
x: Math.round(chatMessagesListView.x + 8*DefaultStyle.dp)
|
||||
width: Math.round(393 * DefaultStyle.dp)
|
||||
height: Math.round(291 * DefaultStyle.dp)
|
||||
visible: messageSender.emojiPickerButtonChecked
|
||||
closePolicy: Popup.CloseOnPressOutside
|
||||
onClosed: messageSender.emojiPickerButtonChecked = false
|
||||
visible: false
|
||||
modal: true
|
||||
dim: false
|
||||
closePolicy: Popup.CloseOnReleaseOutside
|
||||
padding: 10 * DefaultStyle.dp
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
|
|
@ -484,6 +485,7 @@ FocusScope {
|
|||
Control.SplitView.minimumHeight: mainItem.chat?.core.isReadOnly ? 0 : Math.round(79 * DefaultStyle.dp)
|
||||
chat: mainItem.chat
|
||||
selectedFilesCount: contents.count
|
||||
emojiPicker: emojiPickerPopup
|
||||
onChatChanged: {
|
||||
if (chat) messageSender.text = mainItem.chat.core.sendingText
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,9 +75,7 @@ Item {
|
|||
}
|
||||
|
||||
function openAccountSettings(account) {
|
||||
var page = accountSettingsPageComponent.createObject(parent, {
|
||||
"account": account
|
||||
})
|
||||
var page = accountSettingsPageComponent.createObject(parent, {"account": account})
|
||||
openContextualMenuComponent(page)
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +127,7 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: Math.round(82 * DefaultStyle.dp)
|
||||
defaultAccount: accountProxy.defaultAccount
|
||||
currentIndex: 0
|
||||
Binding on currentIndex {
|
||||
when: mainItem.contextualMenuOpenedComponent != undefined
|
||||
value: -1
|
||||
|
|
@ -157,7 +156,7 @@ Item {
|
|||
"visible": !SettingsCpp.disableMeetingsFeature
|
||||
}]
|
||||
onCurrentIndexChanged: {
|
||||
if (currentIndex == -1)
|
||||
if (currentIndex === -1)
|
||||
return
|
||||
if (currentIndex === 0 && accountProxy.defaultAccount)
|
||||
accountProxy.defaultAccount.core?.lResetMissedCalls()
|
||||
|
|
@ -429,8 +428,9 @@ Item {
|
|||
//: Mon compte
|
||||
text: qsTr("drawer_menu_manage_account")
|
||||
icon.source: AppIcons.manageProfile
|
||||
onClicked: openAccountSettings(
|
||||
accountProxy.defaultAccount ? accountProxy.defaultAccount : accountProxy.firstAccount())
|
||||
onClicked: openAccountSettings(accountProxy.defaultAccount
|
||||
? accountProxy.defaultAccount
|
||||
: accountProxy.firstAccount())
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
0) : null
|
||||
|
|
@ -575,14 +575,11 @@ Item {
|
|||
children[currentIndex].forceActiveFocus()
|
||||
on_CurrentIndexChanged: {
|
||||
if (count > 0) {
|
||||
if (_currentIndex >= count
|
||||
&& tabbar.model[_currentIndex].link) {
|
||||
Qt.openUrlExternally(
|
||||
tabbar.model[_currentIndex].link)
|
||||
if (_currentIndex >= count && tabbar.model[_currentIndex].link) {
|
||||
Qt.openUrlExternally(tabbar.model[_currentIndex].link)
|
||||
} else if (_currentIndex >= 0) {
|
||||
currentIndex = _currentIndex
|
||||
SettingsCpp.setLastActiveTabIndex(
|
||||
currentIndex)
|
||||
SettingsCpp.setLastActiveTabIndex(currentIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue