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
+10 -11
View File
@@ -76,7 +76,6 @@ var userdevices sync.Map
var pingTimes = [][]float64{}
var clientAssets map[string]gdk.Paintabler = make(map[string]gdk.Paintabler)
var xmlLog *os.File
@@ -420,7 +419,7 @@ func main() {
c, err := xmpp.NewClient(&config, router, func(err error) {
connectionStatus.SetText(fmt.Sprintf("%s%s", loadedLocale["disconnected"], err.Error()))
connectionIcon.SetFromPaintable(clientAssets["disconnect"])
connectionIcon.SetFromPaintable(clientAssetsLoad("disconnect"))
})
if err != nil {
@@ -497,7 +496,7 @@ func main() {
glib.IdleAdd(func() {
connectionStatus.SetText(fmt.Sprintf("%s%s", loadedLocale["connectedAs"], JidMustParse(clientroot.Session.BindJid).Bare()))
connectionStatus.SetTooltipText(fmt.Sprintf("%s%s\n%s%t", loadedLocale["bindedJid"], clientroot.Session.BindJid, loadedLocale["usingTLS"], clientroot.Session.TlsEnabled))
connectionIcon.SetFromPaintable(clientAssets["connect"])
connectionIcon.SetFromPaintable(clientAssetsLoad("connect"))
})
// Enable carbons
client.SendRaw(fmt.Sprintf(
@@ -662,13 +661,13 @@ func main() {
conc := func() {
// time.Sleep(3 * time.Second)
connectionStatus.SetText(loadedLocale["connecting"])
connectionIcon.SetFromPaintable(clientAssets["hourglass"])
connectionIcon.SetFromPaintable(clientAssetsLoad("hourglass"))
err = cm.Run()
if err != nil {
fmt.Println(err.Error())
connectionStatus.SetText(fmt.Sprintf("%s%s", loadedLocale["disconnected"], err.Error()))
connectionIcon.SetFromPaintable(clientAssets["disconnect"])
connectionIcon.SetFromPaintable(clientAssetsLoad("disconnect"))
}
}
@@ -831,7 +830,7 @@ func activate(app *gtk.Application) {
nick_entry.SetText(loadedConfig.Nick)
create_jid := gtk.NewImageFromPaintable(clientAssets["jabber"])
create_jid := gtk.NewImageFromPaintable(clientAssetsLoad("jabber"))
gesture := gtk.NewGestureClick()
gesture.SetButton(1)
gesture.Connect("pressed", func() {
@@ -990,7 +989,7 @@ func activate(app *gtk.Application) {
warning_box.Append(header)
addFeature := func(icon string, description string) {
box := gtk.NewBox(gtk.OrientationHorizontal, 10)
box.Append(gtk.NewImageFromPaintable(clientAssets[icon]))
box.Append(gtk.NewImageFromPaintable(clientAssetsLoad(icon)))
box.Append(gtk.NewLabel(description))
warning_box.Append(box)
}
@@ -1072,7 +1071,7 @@ func activate(app *gtk.Application) {
window.Window.SetDefaultSize(500, 500)
menu = gtk.NewBox(gtk.OrientationVertical, 0)
empty_dialog = gtk.NewImageFromPaintable(clientAssets["disabled_logo"])
empty_dialog = gtk.NewImageFromPaintable(clientAssetsLoad("disabled_logo"))
empty_dialog.SetPixelSize(100)
empty_dialog.SetVExpand(true)
@@ -1088,7 +1087,7 @@ func activate(app *gtk.Application) {
statBar := gtk.NewBox(gtk.OrientationHorizontal, 0)
cBox := gtk.NewBox(gtk.OrientationHorizontal, 0)
connectionIcon = gtk.NewImageFromPaintable((clientAssets["disconnect"]))
connectionIcon = gtk.NewImageFromPaintable((clientAssetsLoad("disconnect")))
connectionIcon.AddCSSClass("icon")
connectionStatus = gtk.NewLabel(loadedLocale["disconnected"])
@@ -1106,7 +1105,7 @@ func activate(app *gtk.Application) {
switchToTab(current, &window.Window)
})
mIcon = gtk.NewImageFromPaintable((clientAssets["comment"]))
mIcon = gtk.NewImageFromPaintable((clientAssetsLoad("comment")))
mIcon.AddCSSClass("icon")
mStatus = gtk.NewLabel("-")
mStatus.AddController(gesture1)
@@ -1167,7 +1166,7 @@ func activate(app *gtk.Application) {
})
pBox.AddController(gesture)
i := (gtk.NewImageFromPaintable(clientAssets["chart_bar"]))
i := (gtk.NewImageFromPaintable(clientAssetsLoad("chart_bar")))
i.AddCSSClass("icon")
pBox.Append(i)