Image embedding.

This commit is contained in:
armored-dragon 2025-07-02 00:47:17 -05:00
parent 0002e4f0a1
commit e1a5f328f3
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B
2 changed files with 17 additions and 91 deletions

View file

@ -168,7 +168,6 @@ Rectangle {
}
}
ListModel {
id: localMessages;
}
@ -385,75 +384,14 @@ Rectangle {
}
// Templates
Component {
id: template_notification
Rectangle{
property int index: delegateIndex
property string texttest: delegateText
property string username: delegateUsername
property string date: delegateDate
color: "#171717"
width: parent.width
height: 40
Item {
width: 10
height: parent.height
Rectangle {
height: parent.height
width: 5
color: "#505186"
}
}
Item {
width: parent.width - parent.children[0].width - 5
height: parent.height
anchors.left: parent.children[0].right
TextEdit{
text: texttest
color:"white"
font.pointSize: 12
readOnly: true
width: parent.width * 0.8
selectByMouse: true
selectByKeyboard: true
height: parent.height
wrapMode: Text.Wrap
verticalAlignment: Text.AlignVCenter
font.italic: true
}
Text {
text: date
color:"white"
font.pointSize: 12
anchors.right: parent.right
height: parent.height
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
font.italic: true
}
}
}
}
function scrollToBottom() {
listview.positionViewAtEnd();
}
function addMessage(username, message, date, channel, type){
// Format content
message = formatContent(message);
// message = embedImages(message);
message = embedImages(message);
if (type === "notification"){ }

View file

@ -10,7 +10,7 @@ Item {
property string delegateUsername: "";
property string delegateDate: "";
ColumnLayout {
Column {
width: parent.width - 20;
x: 10;
@ -34,37 +34,25 @@ Item {
}
// Message body
Item {
Text {
text: delegateMessage;
color: "white";
font.pixelSize: 18;
wrapMode: Text.Wrap;
textFormat: TextEdit.RichText;
width: parent.width;
height: children[0].height;
Text {
text: delegateMessage;
color: "white";
font.pixelSize: 18;
wrapMode: Text.Wrap;
textFormat: TextEdit.RichText;
width: parent.parent.width;
onLinkActivated: {
if (link.includes("?noOpen=true")) {
// Don't open this in external browser
link = link.replace("?noOpen=true", "");
Window.openWebBrowser(link);
return;
} else {
Qt.openUrlExternally(link);
}
onLinkActivated: {
if (link.includes("?noOpen=true")) {
// Don't open this in external browser
link = link.replace("?noOpen=true", "");
Window.openWebBrowser(link);
return;
} else {
Qt.openUrlExternally(link);
}
}
}
// Embed area
// ColumnLayout {
// width: parent.width;
// }
}
Rectangle {