mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 12:11:31 +02:00
Image embedding.
This commit is contained in:
parent
0002e4f0a1
commit
e1a5f328f3
2 changed files with 17 additions and 91 deletions
|
@ -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"){ }
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue