mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-18 08:35:26 +08:00
CallMessageDelegate: remove reply/react to
Change-Id: Iddeffd4e2c161ecaf0c9bdb62ed1431d78d0eac5 GitLab: #1493
This commit is contained in:
@@ -64,6 +64,7 @@ Control {
|
|||||||
property real maxMsgWidth: root.width - senderMargin - 2 * hPadding - avatarBlockWidth
|
property real maxMsgWidth: root.width - senderMargin - 2 * hPadding - avatarBlockWidth
|
||||||
property bool bigMsg
|
property bool bigMsg
|
||||||
property bool timeUnderBubble: false
|
property bool timeUnderBubble: false
|
||||||
|
property var type: Type
|
||||||
|
|
||||||
// If the ListView attached properties are not available,
|
// If the ListView attached properties are not available,
|
||||||
// then the root delegate is likely a Loader.
|
// then the root delegate is likely a Loader.
|
||||||
@@ -263,6 +264,7 @@ Control {
|
|||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: more
|
id: more
|
||||||
|
objectName: "more"
|
||||||
|
|
||||||
anchors.rightMargin: isOutgoing ? 10 : 0
|
anchors.rightMargin: isOutgoing ? 10 : 0
|
||||||
anchors.leftMargin: !isOutgoing ? 10 : 0
|
anchors.leftMargin: !isOutgoing ? 10 : 0
|
||||||
@@ -273,7 +275,10 @@ Control {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.right: isOutgoing ? optionButtonItem.right : undefined
|
anchors.right: isOutgoing ? optionButtonItem.right : undefined
|
||||||
anchors.left: !isOutgoing ? optionButtonItem.left : 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
|
source: JamiResources.more_vert_24dp_svg
|
||||||
width: optionButtonItem.width / 2
|
width: optionButtonItem.width / 2
|
||||||
height: optionButtonItem.height
|
height: optionButtonItem.height
|
||||||
@@ -283,7 +288,7 @@ Control {
|
|||||||
|
|
||||||
function bind() {
|
function bind() {
|
||||||
more.isOpen = false;
|
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);
|
imageColor = Qt.binding(() => hovered ? JamiTheme.chatViewFooterImgHoverColor : JamiTheme.chatViewFooterImgColor);
|
||||||
normalColor = Qt.binding(() => JamiTheme.primaryBackgroundColor);
|
normalColor = Qt.binding(() => JamiTheme.primaryBackgroundColor);
|
||||||
}
|
}
|
||||||
@@ -299,7 +304,7 @@ Control {
|
|||||||
"isOutgoing": isOutgoing,
|
"isOutgoing": isOutgoing,
|
||||||
"msgId": Id,
|
"msgId": Id,
|
||||||
"msgBody": Body,
|
"msgBody": Body,
|
||||||
"type": Type,
|
"type": root.type,
|
||||||
"transferName": TransferName,
|
"transferName": TransferName,
|
||||||
"msgBubble": bubble,
|
"msgBubble": bubble,
|
||||||
"listView": listView
|
"listView": listView
|
||||||
@@ -315,6 +320,7 @@ Control {
|
|||||||
|
|
||||||
PushButton {
|
PushButton {
|
||||||
id: reply
|
id: reply
|
||||||
|
objectName: "reply"
|
||||||
|
|
||||||
circled: false
|
circled: false
|
||||||
imageColor: hovered ? JamiTheme.chatViewFooterImgHoverColor : JamiTheme.chatViewFooterImgColor
|
imageColor: hovered ? JamiTheme.chatViewFooterImgHoverColor : JamiTheme.chatViewFooterImgColor
|
||||||
@@ -327,7 +333,10 @@ Control {
|
|||||||
anchors.rightMargin: 5
|
anchors.rightMargin: 5
|
||||||
anchors.right: isOutgoing ? more.left : undefined
|
anchors.right: isOutgoing ? more.left : undefined
|
||||||
anchors.left: !isOutgoing ? more.right : 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: {
|
onClicked: {
|
||||||
MessagesAdapter.editId = "";
|
MessagesAdapter.editId = "";
|
||||||
@@ -355,12 +364,12 @@ Control {
|
|||||||
property bool bubbleHovered
|
property bool bubbleHovered
|
||||||
property string imgSource
|
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)
|
height: innerContent.childrenRect.height + (visible ? root.extraHeight : 0) + (root.bigMsg ? 15 : 0)
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
target: root
|
target: root
|
||||||
enabled: Type === Interaction.Type.DATA_TRANSFER
|
enabled: root.type === Interaction.Type.DATA_TRANSFER
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
root.hoveredLink = enabled && hovered ? bubble.imgSource : ""
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user