This commit is contained in:
2026-05-23 06:45:18 +01:00
parent af0ec78eae
commit 9ad48ff310
5 changed files with 52 additions and 31 deletions
+12 -12
View File
@@ -98,7 +98,7 @@ func switchToTab(jid string, w *gtk.Window) {
m, ok := mucmembers.Load(jid)
if !ok {
box := gtk.NewBox(gtk.OrientationVertical, 10)
failed_icon := gtk.NewImageFromPaintable(clientAssets["fail"])
failed_icon := gtk.NewImageFromPaintable(clientAssetsLoad("fail"))
failed_icon.SetPixelSize(100)
box.Append(failed_icon)
label := gtk.NewLabel("There was an error loading the members of this room. Maybe the MUC does not give user presence, it does not exist, you have been banned from it, or you have to fill a CAPTCHA to access it. Try joining the room again or check if the room exists.")
@@ -110,7 +110,7 @@ func switchToTab(jid string, w *gtk.Window) {
ma, ok := m.(mucUnit)
if !ok {
box := gtk.NewBox(gtk.OrientationVertical, 10)
failed_icon := gtk.NewImageFromPaintable(clientAssets["fail"])
failed_icon := gtk.NewImageFromPaintable(clientAssetsLoad("fail"))
failed_icon.SetPixelSize(100)
box.Append(failed_icon)
label := gtk.NewLabel("There was an error loading the members of this room. Maybe the MUC does not give user presence, it does not exist, you have been banned from it, or you have to fill a CAPTCHA to access it. Try joining the room again or check if the room exists.")
@@ -196,7 +196,7 @@ func switchToTab(jid string, w *gtk.Window) {
}
}
status := gtk.NewImageFromPaintable(clientAssets["status_"+string(u.Show)])
status := gtk.NewImageFromPaintable(clientAssetsLoad("status_"+string(u.Show)))
status.SetTooltipText(string(u.Show))
status.SetHAlign(gtk.AlignEnd)
@@ -204,13 +204,13 @@ func switchToTab(jid string, w *gtk.Window) {
userbox.Prepend(status)
if u.Status != "" {
status_message := gtk.NewImageFromPaintable(clientAssets["comment"])
status_message := gtk.NewImageFromPaintable(clientAssetsLoad("comment"))
status_message.SetTooltipText(u.Status)
status_message.SetHAlign(gtk.AlignEnd)
userbox.Append(status_message)
}
medal := gtk.NewImageFromPaintable(clientAssets[mu.MucUserItem.Affiliation])
medal := gtk.NewImageFromPaintable(clientAssetsLoad(mu.MucUserItem.Affiliation))
medal.SetTooltipText(mu.MucUserItem.Affiliation)
medal.SetHAlign(gtk.AlignEnd)
@@ -560,11 +560,11 @@ func switchToTab(jid string, w *gtk.Window) {
headerBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
if i >= 500 {
headerBox.Append(gtk.NewImageFromPaintable(clientAssets["world"]))
headerBox.Append(gtk.NewImageFromPaintable(clientAssetsLoad("world")))
} else if i >= 50 {
headerBox.Append(gtk.NewImageFromPaintable(clientAssets["large_group"]))
headerBox.Append(gtk.NewImageFromPaintable(clientAssetsLoad("large_group")))
} else {
headerBox.Append(gtk.NewImageFromPaintable(clientAssets["group"]))
headerBox.Append(gtk.NewImageFromPaintable(clientAssetsLoad("group")))
}
headerBox.Append(gtk.NewLabel(fmt.Sprintf("%d %s", i, loadedLocale["participants"])))
gen.Prepend(headerBox)
@@ -614,9 +614,7 @@ func showErrorDialog(err error, w *gtk.Window) {
func createIdenticon(word string, always_create bool) *gtk.Image { // This function generates an identicon
if !loadedConfig.Identicons && !always_create {
i := gtk.NewImageFromPaintable(clientAssets["DefaultAvatar"])
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
return i
return gtk.NewImageFromPaintable(clientAssetsLoad("DefaultAvatar"))
}
identicon.SetBackgroundColorFunction(func([]byte, color.Color) color.Color {
@@ -636,7 +634,9 @@ func createIdenticon(word string, always_create bool) *gtk.Image { // This funct
loader := gdkpixbuf.NewPixbufLoader()
loader.Write(buf.Bytes())
loader.Close()
i := gtk.NewImageFromPaintable(gdk.NewTextureForPixbuf(loader.Pixbuf()))
p := loader.Pixbuf()
gt := gdk.NewTextureForPixbuf(p)
i := gtk.NewImageFromPaintable(gt)
i.AddCSSClass(loadedConfig.CVD.String() + "_CVD")
return i