Remove quick reply feature

Unfortunately I couldn't find any way to make it work while also
making scroll works correctly. The container is now using item delegate
and by testing on my laptop touch pad it seems to scroll well.

Probably worth revising at some point but at least it makes neochat
usable.
This commit is contained in:
Carl Schwan
2021-04-03 15:21:06 +02:00
parent 71d4b8763e
commit 75a2ba86ee
3 changed files with 36 additions and 71 deletions

View File

@@ -40,7 +40,7 @@ a{
}
.user-pill{}
</style>" + (isEmote ? "* <a href='https://matrix.to/#/" + author.id + "' style='color: " + author.color + "'>" + author.displayName + "</a> " : "") + display + (isEdited ? (" <span style=\"color: " + Kirigami.Theme.disabledTextColor + "\">" + i18n("(edited)") + "</span>") : "")
</style>" + (isEmote ? "* <a href='https://matrix.to/#/" + author.id + "' style='color: " + author.color + "'>" + author.displayName + "</a> " : "") + model.display + (isEdited ? (" <span style=\"color: " + Kirigami.Theme.disabledTextColor + "\">" + i18n("(edited)") + "</span>") : "")
color: Kirigami.Theme.textColor
font.pointSize: isEmoji.test(display) ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize
@@ -49,9 +49,7 @@ a{
wrapMode: Text.WordWrap
textFormat: Text.RichText
onLinkActivated: {
applicationWindow().handleLink(link, currentRoom)
}
onLinkActivated: applicationWindow().handleLink(link, currentRoom)
MouseArea {
anchors.fill: parent

View File

@@ -15,7 +15,7 @@ import NeoChat.Setting 1.0
import NeoChat.Component 1.0
import NeoChat.Dialog 1.0
Item {
QQC2.ItemDelegate {
default property alias innerObject : column.children
readonly property bool sentByMe: author.isLocalUser
readonly property bool darkBackground: !sentByMe
@@ -34,10 +34,13 @@ Item {
signal openExternally()
signal replyClicked(string eventID)
property alias hovered: controlContainer.hovered
topPadding: 0
bottomPadding: 0
property alias hoveredBubble: controlContainer.hovered
//height: mainColumn.childrenRect.height + (readMarker ? Kirigami.Units.smallSpacing : 0)
height: mainColumn.implicitHeight + (readMarker ? Kirigami.Units.smallSpacing : 0)
//height: mainColumn.implicitHeight + (readMarker ? Kirigami.Units.smallSpacing : 0)
property int hoverComponentX: column.width - hoverComponent.childWidth + Kirigami.Units.largeSpacing
property int hoverComponentY: -Kirigami.Units.largeSpacing - hoverComponent.childHeight * 1.5
@@ -70,30 +73,8 @@ Item {
};
}
DragHandler {
enabled: Kirigami.Settings.isMobile
yAxis.enabled: false
xAxis.enabled: true
xAxis.maximum: 0
xAxis.minimum: -Kirigami.Units.gridUnit * 4
onActiveChanged: {
applicationWindow().pageStack.interactive = true;
if (!active && parent.x < -Kirigami.Units.gridUnit * 3) {
replyToMessage(author, message, eventId)
}
parent.x = 0;
}
}
onXChanged: if (x !== 0) {
applicationWindow().pageStack.interactive = false;
} else {
applicationWindow().pageStack.interactive = true;
}
ColumnLayout {
contentItem: ColumnLayout {
id: mainColumn
width: parent.width
spacing: 0
SectionDelegate {
@@ -221,28 +202,21 @@ Item {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing * 2
Layout.topMargin: active ? Kirigami.Units.smallSpacing : 0
//Layout.bottomMargin: readMarker ? Kirigami.Units.smallSpacing : 0
active: eventType !== "state" && eventType !== "notice" && reaction != undefined && reaction.length > 0
visible: active
sourceComponent: ReactionDelegate { }
}
}
Kirigami.Icon {
id: replyButton
visible: parent.x < - Kirigami.Units.gridUnit * 1
opacity: -(parent.x + Kirigami.Units.gridUnit) / Kirigami.Units.gridUnit / 3
anchors.left: parent.right
anchors.top: parent.top
source: "mail-replied-symbolic"
}
Rectangle {
width: parent.width * 0.9
x: parent.width * 0.05
height: Kirigami.Units.smallSpacing / 2
anchors.top: mainColumn.bottom
anchors.topMargin: Kirigami.Units.smallSpacing
visible: readMarker
color: Kirigami.Theme.positiveTextColor
background: Item {
Rectangle {
width: parent.width * 0.9
x: parent.width * 0.05
height: Kirigami.Units.smallSpacing / 2
anchors.bottom: parent.bottom
visible: readMarker
color: Kirigami.Theme.positiveTextColor
}
}
}

View File

@@ -355,7 +355,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "emote"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
isLoaded: timelineDelegateChooser.delegateLoaded
isEmote: true
onReplyClicked: goToEvent(eventID)
@@ -370,11 +370,11 @@ Kirigami.ScrollablePage {
Layout.bottomMargin: Kirigami.Units.largeSpacing * 2
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openMessageContext(author, display, eventId, toolTip)
onTapped: openMessageContext(author, model.display, eventId, toolTip)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openMessageContext(author, display, eventId, toolTip)
onLongPressed: openMessageContext(author, model.display, eventId, toolTip)
}
}
}
@@ -383,9 +383,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "message"
delegate: TimelineContainer {
id: timeline
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
isLoaded: timelineDelegateChooser.delegateLoaded
onReplyClicked: goToEvent(eventID)
@@ -398,11 +396,11 @@ Kirigami.ScrollablePage {
Layout.leftMargin: Kirigami.Units.largeSpacing
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openMessageContext(author, display, eventId, toolTip)
onTapped: openMessageContext(author, model.display, eventId, toolTip)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openMessageContext(author, display, eventId, toolTip)
onLongPressed: openMessageContext(author, model.display, eventId, toolTip)
}
}
}
@@ -411,7 +409,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "notice"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
isLoaded: timelineDelegateChooser.delegateLoaded
onReplyClicked: goToEvent(eventID)
@@ -428,8 +426,6 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "image"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
isLoaded: timelineDelegateChooser.delegateLoaded
onReplyClicked: goToEvent(eventID)
@@ -449,9 +445,8 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "sticker"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
isLoaded: timelineDelegateChooser.delegateLoaded
width: messageListView.width
onReplyClicked: goToEvent(eventID)
hoverComponent: hoverActions
@@ -469,8 +464,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "audio"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
hoverComponent: hoverActions
isLoaded: timelineDelegateChooser.delegateLoaded
@@ -480,11 +474,11 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onTapped: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onLongPressed: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
}
}
@@ -493,8 +487,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "video"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
hoverComponent: hoverActions
isLoaded: timelineDelegateChooser.delegateLoaded
@@ -510,11 +503,11 @@ Kirigami.ScrollablePage {
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onTapped: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onLongPressed: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
}
}
@@ -523,7 +516,7 @@ Kirigami.ScrollablePage {
DelegateChoice {
roleValue: "file"
delegate: TimelineContainer {
width: messageListView.width - Kirigami.Units.largeSpacing
width: messageListView.width
hoverComponent: hoverActions
@@ -534,11 +527,11 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true
TapHandler {
acceptedButtons: Qt.RightButton
onTapped: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onTapped: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
TapHandler {
acceptedButtons: Qt.LeftButton
onLongPressed: openFileContext(author, display, eventId, toolTip, progressInfo, parent)
onLongPressed: openFileContext(author, model.display, eventId, toolTip, progressInfo, parent)
}
}
}