func (t *TrayIcon) onSettingsClicked(b bool) {
	if t.SettingsDialog == nil {
		f := core.NewQFile2(":assets/ui/settings.ui")
		l := uitools.NewQUiLoader(t.App)
		w := l.Load(f, nil)
		t.SettingsDialog = ui.NewQDialogFromPointer(w.Pointer())
		t.SettingsDialog.ConnectAccepted(t.onDialogAccepted)
		t.assignWidgets()
	}
	t.SettingsDialog.Show()
	t.setWidgetValuesFromConf()
}
executes when "Settings" is clicked
package tray
import (
	"fmt"
	"os"
	"os/exec"
	"os/signal"
	"sort"
	"sync"
	"syscall"
	"time"
	"github.com/therecipe/qt/uitools"
	"github.com/therecipe/qt/core"
	"github.com/therecipe/qt/gui"
	ui "github.com/therecipe/qt/widgets"
)
var (
	ico, icoNew, icoChecked, icoExit, icoUnchecked *gui.QIcon
)
type SystemTrayIcon struct {
	ui.QSystemTrayIcon
	_ func(Article, bool) `slot:"newArticleSlot"`
	_ func(error)         `slot:"errorSlot"`
	_ func()              `slot:"hideIconSlot"`
}
type TrayIcon struct {
	App             *ui.QApplication
	Icon            *SystemTrayIcon
	Menu            *ui.QMenu
	SettingsDialog  *ui.QDialog
	AboutDialog     *ui.QDialog
	SettingsWidgets *SettingsWidgets
	Conf            *Config
	Articles        []Article
	LastArticle     *Article
	CSettings       ClientSettings
	Mutex           *sync.Mutex
	Delay           bool
}
func NewTrayIcon(delay bool) error {
	var err error
	core.QCoreApplication_SetAttribute(core.Qt__AA_ShareOpenGLContexts, true)
	core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, true)
	t := &TrayIcon{
		App:             ui.NewQApplication(len(os.Args), os.Args),
		Delay:           delay,
		Articles:        []Article{},
		SettingsWidgets: &SettingsWidgets{},
		Mutex:           &sync.Mutex{},
	}
	t.App.SetQuitOnLastWindowClosed(false)
	t.App.SetApplicationName("mntray")
	t.App.SetApplicationVersion(version)
	ico = gui.QIcon_FromTheme2("mntray-regular", gui.NewQIcon5(":assets/images/mntray-regular.png"))
	icoNew = gui.QIcon_FromTheme2("mntray-news", gui.NewQIcon5(":assets/images/mntray-news.png"))
	icoChecked = gui.QIcon_FromTheme2("emblem-checked", gui.QIcon_FromTheme2("emblem-default", gui.QIcon_FromTheme("dialog-yes")))
	icoExit = gui.QIcon_FromTheme("application-exit")
	icoUnchecked = gui.QIcon_FromTheme2("vcs-removed", gui.QIcon_FromTheme("emblem-draft"))
	t.Icon = NewSystemTrayIcon(t.App)
	t.Icon.SetIcon(ico)
	t.Conf, err = NewConfig()
	if err != nil {
		return err
	}
	arts, err := t.Conf.LoadArticles()
	if err != nil {
		fmt.Println("Error loading articles from file:", err)
	}
	t.createMenu()
	t.Icon.ConnectNewArticleSlot(t.onNewArticle)
	t.Icon.ConnectErrorSlot(t.onError)
	t.Icon.ConnectHideIconSlot(t.onHideIcon)
	t.Icon.ConnectMessageClicked(t.onMessageClicked)
	for i := range arts {
		t.gotNewArticle(arts[i], true)
	}
	t.Icon.Show()
	t.setTrayIcon()
	t.waitForNews()
	go t.handleOSSignals()
	t.App.Exec()
	return nil
}
func (t *TrayIcon) createMenu() {
	m := ui.NewQMenu(nil)
	t.Icon.ConnectActivated(t.onActivated)
	m.AddSeparator()
	mr := m.AddAction("Mark all as read")
	mr.ConnectTriggered(t.onMarkAsReadClicked)
	set := m.AddAction("Settings")
	set.SetIcon(gui.QIcon_FromTheme("gtk-preferences"))
	set.ConnectTriggered(t.onSettingsClicked)
	ab := m.AddAction("About")
	ab.SetIcon(gui.QIcon_FromTheme("gtk-about"))
	ab.ConnectTriggered(t.onAboutClicked)
	m.AddSeparator()
	quit := m.AddAction("Quit")
	quit.SetIcon(icoExit)
	quit.ConnectTriggered(t.onQuitClicked)
	t.Menu = m
	t.Icon.SetContextMenu(m)
}
func (t *TrayIcon) onActivated(r ui.QSystemTrayIcon__ActivationReason) {
	if r == ui.QSystemTrayIcon__Trigger {
		t.Menu.Popup(gui.QCursor_Pos(), nil)
	}
}