A lot of improvements.
Fix laggish RoomListView when dragging. Remove per-room timer and add timer in RoomForm. Remove singleton module and use file as singleton. Minor UI tweak in RoomListView. Pass room to RoomListView via "currentRoom" delegate property and remove RoomListForm-wide currentRoom. Put menu files in a separate folder. Show initial image in ImageStatus when avatar is not loaded. Add about page. Merge all setting pages into Setting.qml. Add option to rearrange rooms by activity. Add option to use RichText parser. Add document url.
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import QtQuick 2.9
|
||||
import MatriqueSettings 0.1
|
||||
import Matrique.Settings 0.1
|
||||
|
||||
MouseArea {
|
||||
signal primaryClicked()
|
||||
signal secondaryClicked()
|
||||
|
||||
propagateComposedEvents: true
|
||||
acceptedButtons: MatriqueSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton)
|
||||
acceptedButtons: MSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton)
|
||||
onClicked: mouse.button == Qt.RightButton ? secondaryClicked() : primaryClicked()
|
||||
onPressAndHold: MatriqueSettings.pressAndHold ? secondaryClicked() : {}
|
||||
onPressAndHold: MSettings.pressAndHold ? secondaryClicked() : {}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ Item {
|
||||
property string source: ""
|
||||
property string displayText: ""
|
||||
readonly property bool showImage: source
|
||||
readonly property bool showInitial: !showImage && displayText
|
||||
readonly property bool showInitial: !showImage && displayText || avatar.status != Image.Ready
|
||||
|
||||
id: item
|
||||
|
||||
@@ -55,6 +55,7 @@ Item {
|
||||
}
|
||||
|
||||
function getInitials(text) {
|
||||
if (!text) return "N"
|
||||
return text.toUpperCase().replace(/[^a-zA-Z- ]/g, "").match(/\b\w/g);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import Matrique.Settings 0.1
|
||||
|
||||
Item {
|
||||
property alias icon: iconText.text
|
||||
property var color: Material.theme == Material.Light ? "black" : "white"
|
||||
property var color: MSettings.darkTheme ? "white" : "black"
|
||||
|
||||
id: item
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
Menu {
|
||||
readonly property bool isFile: eventType === "video" || eventType === "audio" || eventType === "file" || eventType === "image"
|
||||
|
||||
id: messageContextMenu
|
||||
|
||||
MenuItem {
|
||||
text: "Copy"
|
||||
onTriggered: matriqueController.copyToClipboard(plainText)
|
||||
}
|
||||
MenuItem {
|
||||
text: "Copy Source"
|
||||
onTriggered: matriqueController.copyToClipboard(toolTip)
|
||||
}
|
||||
MenuItem {
|
||||
visible: isFile
|
||||
height: visible ? undefined : 0
|
||||
text: "Open Externally"
|
||||
onTriggered: delegateLoader.item.downloadAndOpen()
|
||||
}
|
||||
MenuItem {
|
||||
visible: isFile
|
||||
height: visible ? undefined : 0
|
||||
text: "Save As"
|
||||
onTriggered: delegateLoader.item.saveFileAs()
|
||||
}
|
||||
MenuItem {
|
||||
visible: sentByMe
|
||||
height: visible ? undefined : 0
|
||||
text: "Redact"
|
||||
onTriggered: currentRoom.redactEvent(eventId)
|
||||
}
|
||||
|
||||
Component.onCompleted: popup()
|
||||
onClosed: messageContextMenu.destroy()
|
||||
}
|
||||
@@ -2,14 +2,11 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import Matrique 0.1
|
||||
import MatriqueSettings 0.1
|
||||
import Matrique.Settings 0.1
|
||||
|
||||
Item {
|
||||
readonly property bool hidden: marks === EventStatus.Redacted || marks === EventStatus.Hidden
|
||||
|
||||
readonly property bool darkTheme: Material.theme == Material.Dark
|
||||
readonly property color background: darkTheme ? "#242424" : "lightgrey"
|
||||
|
||||
readonly property color background: MSettings.darkTheme ? "#242424" : "lightgrey"
|
||||
readonly property bool sentByMe: author === currentRoom.localUser
|
||||
readonly property bool isState: eventType === "state" || eventType === "emote"
|
||||
|
||||
@@ -24,13 +21,15 @@ Item {
|
||||
|
||||
AutoMouseArea {
|
||||
anchors.fill: parent
|
||||
onSecondaryClicked: Qt.createComponent("MessageContextMenu.qml").createObject(this)
|
||||
|
||||
propagateComposedEvents: true
|
||||
onSecondaryClicked: Qt.createComponent("qrc:/qml/menu/MessageContextMenu.qml").createObject(this)
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: delegateLoader
|
||||
|
||||
asynchronous: MatriqueSettings.asyncMessageDelegate
|
||||
asynchronous: MSettings.asyncMessageDelegate
|
||||
|
||||
source: {
|
||||
if (eventType == "redaction" || hidden) return ""
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls.Material 2.2
|
||||
|
||||
Rectangle {
|
||||
color: Material.accent
|
||||
}
|
||||
@@ -2,7 +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
|
||||
import Matrique.Settings 0.1
|
||||
|
||||
Rectangle {
|
||||
property bool flat: false
|
||||
@@ -46,7 +46,7 @@ Rectangle {
|
||||
|
||||
wrapMode: Label.Wrap
|
||||
linkColor: darkBackground ? "white" : Material.accent
|
||||
textFormat: MatriqueSettings.richText ? Text.RichText : Text.StyledText
|
||||
textFormat: MSettings.richText ? Text.RichText : Text.StyledText
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user