mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
CallMessageDelegate: remove reply/react to
Change-Id: Iddeffd4e2c161ecaf0c9bdb62ed1431d78d0eac5 GitLab: #1493
This commit is contained in:
parent
5b6ab48037
commit
7c3eab9107
2 changed files with 59 additions and 6 deletions
|
@ -64,6 +64,7 @@ Control {
|
|||
property real maxMsgWidth: root.width - senderMargin - 2 * hPadding - avatarBlockWidth
|
||||
property bool bigMsg
|
||||
property bool timeUnderBubble: false
|
||||
property var type: Type
|
||||
|
||||
// If the ListView attached properties are not available,
|
||||
// then the root delegate is likely a Loader.
|
||||
|
@ -263,6 +264,7 @@ Control {
|
|||
|
||||
PushButton {
|
||||
id: more
|
||||
objectName: "more"
|
||||
|
||||
anchors.rightMargin: isOutgoing ? 10 : 0
|
||||
anchors.leftMargin: !isOutgoing ? 10 : 0
|
||||
|
@ -273,7 +275,10 @@ Control {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: isOutgoing ? optionButtonItem.right : undefined
|
||||
anchors.left: !isOutgoing ? optionButtonItem.left : undefined
|
||||
visible: CurrentAccount.type !== Profile.Type.SIP && Body !== "" && (bubbleArea.bubbleHovered || hovered || reply.hovered || bgHandler.hovered)
|
||||
visible: CurrentAccount.type !== Profile.Type.SIP
|
||||
&& root.type !== Interaction.Type.CALL
|
||||
&& Body !== ""
|
||||
&& (bubbleArea.bubbleHovered || hovered || reply.hovered || bgHandler.hovered)
|
||||
source: JamiResources.more_vert_24dp_svg
|
||||
width: optionButtonItem.width / 2
|
||||
height: optionButtonItem.height
|
||||
|
@ -283,7 +288,7 @@ Control {
|
|||
|
||||
function bind() {
|
||||
more.isOpen = false;
|
||||
visible = Qt.binding(() => CurrentAccount.type !== Profile.Type.SIP && Body !== "" && (bubbleArea.bubbleHovered || hovered || reply.hovered || bgHandler.hovered));
|
||||
visible = Qt.binding(() => CurrentAccount.type !== Profile.Type.SIP && root.type !== Interaction.Type.CALL && Body !== "" && (bubbleArea.bubbleHovered || hovered || reply.hovered || bgHandler.hovered));
|
||||
imageColor = Qt.binding(() => hovered ? JamiTheme.chatViewFooterImgHoverColor : JamiTheme.chatViewFooterImgColor);
|
||||
normalColor = Qt.binding(() => JamiTheme.primaryBackgroundColor);
|
||||
}
|
||||
|
@ -299,7 +304,7 @@ Control {
|
|||
"isOutgoing": isOutgoing,
|
||||
"msgId": Id,
|
||||
"msgBody": Body,
|
||||
"type": Type,
|
||||
"type": root.type,
|
||||
"transferName": TransferName,
|
||||
"msgBubble": bubble,
|
||||
"listView": listView
|
||||
|
@ -315,6 +320,7 @@ Control {
|
|||
|
||||
PushButton {
|
||||
id: reply
|
||||
objectName: "reply"
|
||||
|
||||
circled: false
|
||||
imageColor: hovered ? JamiTheme.chatViewFooterImgHoverColor : JamiTheme.chatViewFooterImgColor
|
||||
|
@ -327,7 +333,10 @@ Control {
|
|||
anchors.rightMargin: 5
|
||||
anchors.right: isOutgoing ? more.left : undefined
|
||||
anchors.left: !isOutgoing ? more.right : undefined
|
||||
visible: CurrentAccount.type !== Profile.Type.SIP && Body !== "" && (bubbleArea.bubbleHovered || hovered || more.hovered || bgHandler.hovered)
|
||||
visible: CurrentAccount.type !== Profile.Type.SIP
|
||||
&& root.type !== Interaction.Type.CALL
|
||||
&& Body !== ""
|
||||
&& (bubbleArea.bubbleHovered || hovered || more.hovered || bgHandler.hovered)
|
||||
|
||||
onClicked: {
|
||||
MessagesAdapter.editId = "";
|
||||
|
@ -355,12 +364,12 @@ Control {
|
|||
property bool bubbleHovered
|
||||
property string imgSource
|
||||
|
||||
width: (Type === Interaction.Type.TEXT ? root.textContentWidth : innerContent.childrenRect.width)
|
||||
width: (root.type === Interaction.Type.TEXT ? root.textContentWidth : innerContent.childrenRect.width)
|
||||
height: innerContent.childrenRect.height + (visible ? root.extraHeight : 0) + (root.bigMsg ? 15 : 0)
|
||||
|
||||
HoverHandler {
|
||||
target: root
|
||||
enabled: Type === Interaction.Type.DATA_TRANSFER
|
||||
enabled: root.type === Interaction.Type.DATA_TRANSFER
|
||||
onHoveredChanged: {
|
||||
root.hoveredLink = enabled && hovered ? bubble.imgSource : ""
|
||||
}
|
||||
|
|
44
tests/qml/src/tst_CallMessageDelegate.qml
Normal file
44
tests/qml/src/tst_CallMessageDelegate.qml
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (C) 2024 Savoir-faire Linux Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtTest
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Enums 1.1
|
||||
|
||||
import "../../../src/app/"
|
||||
import "../../../src/app/mainview"
|
||||
import "../../../src/app/mainview/components"
|
||||
import "../../../src/app/commoncomponents"
|
||||
|
||||
CallMessageDelegate {
|
||||
id: uut
|
||||
type: Interaction.Type.CALL
|
||||
|
||||
TestCase {
|
||||
name: "Check basic visibility for header buttons"
|
||||
function test_checkBasicVisibility() {
|
||||
var moreButton = findChild(uut, "more")
|
||||
var replyButton = findChild(uut, "reply")
|
||||
compare(moreButton.visible, false)
|
||||
compare(replyButton.visible, false)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue