Change Settings to singleton and add AutoMouseArea.
Also fixes acceptInvitation issue.
This commit is contained in:
12
qml/component/AutoMouseArea.qml
Normal file
12
qml/component/AutoMouseArea.qml
Normal file
@@ -0,0 +1,12 @@
|
||||
import QtQuick 2.9
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
MouseArea {
|
||||
signal primaryClicked()
|
||||
signal secondaryClicked()
|
||||
|
||||
propagateComposedEvents: true
|
||||
acceptedButtons: MatriqueSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton)
|
||||
onClicked: mouse.button == Qt.RightButton ? secondaryClicked() : primaryClicked()
|
||||
onPressAndHold: MatriqueSettings.pressAndHold ? secondaryClicked() : {}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import Matrique 0.1
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
Item {
|
||||
readonly property bool hidden: marks === EventStatus.Redacted || marks === EventStatus.Hidden
|
||||
@@ -21,15 +22,15 @@ Item {
|
||||
anchors.right: !isState && sentByMe ? parent.right : undefined
|
||||
anchors.horizontalCenter: isState ? parent.horizontalCenter : undefined
|
||||
|
||||
MouseArea {
|
||||
AutoMouseArea {
|
||||
anchors.fill: parent
|
||||
onPressAndHold: Qt.createComponent("MessageContextMenu.qml").createObject(this)
|
||||
onSecondaryClicked: Qt.createComponent("MessageContextMenu.qml").createObject(this)
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: delegateLoader
|
||||
|
||||
asynchronous: setting.asyncMessageDelegate
|
||||
asynchronous: MatriqueSettings.asyncMessageDelegate
|
||||
|
||||
source: {
|
||||
if (eventType == "redaction" || hidden) return ""
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
Rectangle {
|
||||
property bool flat: false
|
||||
@@ -45,7 +46,7 @@ Rectangle {
|
||||
|
||||
wrapMode: Label.Wrap
|
||||
linkColor: darkBackground ? "white" : Material.accent
|
||||
textFormat: setting.richText ? Text.RichText : Text.StyledText
|
||||
textFormat: MatriqueSettings.richText ? Text.RichText : Text.StyledText
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user