somehow sunglocto returned
This commit is contained in:
@@ -248,6 +248,30 @@ func generateMessageWidget(p stanza.Packet) gtk.Widgetter {
|
||||
mainBox.Append(subjectlabel)
|
||||
}
|
||||
|
||||
link_preview := LinkPreview{}
|
||||
ok = m.Get(&link_preview)
|
||||
if ok {
|
||||
lp_box := gtk.NewBox(gtk.OrientationVertical, 10)
|
||||
lp_box.AddCSSClass("link_preview")
|
||||
lp_title := gtk.NewLabel(link_preview.Title)
|
||||
lp_title.SetSelectable(true)
|
||||
lp_title.SetWrap(true)
|
||||
lp_title.SetHAlign(gtk.AlignFill)
|
||||
lp_desc := gtk.NewLabel(link_preview.URL + "\n" + link_preview.Description)
|
||||
lp_desc.SetSelectable(true)
|
||||
lp_desc.SetWrap(true)
|
||||
lp_desc.SetHAlign(gtk.AlignFill)
|
||||
|
||||
lp_box.Append(lp_title)
|
||||
lp_box.Append(lp_desc)
|
||||
|
||||
warning := gtk.NewLabel("⚠️")
|
||||
warning.SetTooltipText("This link preview was generated by the client sending it and may not be accurate of the actual website content")
|
||||
lp_box.Append(warning)
|
||||
|
||||
mainBox.Append(lp_box)
|
||||
}
|
||||
|
||||
return mainBox
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user