github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/client/GUI/basic/icons.go (about)

     1  package basic
     2  
     3  import (
     4  	"path/filepath"
     5  
     6  	"github.com/therecipe/qt/gui"
     7  )
     8  
     9  var (
    10  	Icons      icons
    11  	BoldFont   *gui.QFont
    12  	ItalicFont *gui.QFont
    13  )
    14  
    15  type icons struct {
    16  	App       *gui.QIcon
    17  	Download  *gui.QIcon
    18  	Upload    *gui.QIcon
    19  	Refresh   *gui.QIcon
    20  	Add       *gui.QIcon
    21  	Delete    *gui.QIcon
    22  	Edit      *gui.QIcon
    23  	Reset     *gui.QIcon
    24  	Preview   *gui.QIcon
    25  	History   *gui.QIcon
    26  	Export    *gui.QIcon
    27  	Search    *gui.QIcon
    28  	FromTo    *gui.QIcon
    29  	Tasks     *gui.QIcon
    30  	Mails     *gui.QIcon
    31  	Cleanup   *gui.QIcon
    32  	Identifie *gui.QIcon
    33  	Documents *gui.QIcon
    34  	Star      *gui.QIcon
    35  
    36  	Cafs   *gui.QIcon
    37  	Joomeo *gui.QIcon
    38  
    39  	User *gui.QIcon
    40  }
    41  
    42  func InitIcons(ressourcesPath string) {
    43  	p := func(s string) string {
    44  		return filepath.Join(ressourcesPath, "images", s)
    45  	}
    46  	Icons.App = gui.NewQIcon5(p("app.png"))
    47  	Icons.Download = gui.NewQIcon5(p("download.png"))
    48  	Icons.Upload = gui.NewQIcon5(p("upload.png"))
    49  	Icons.Refresh = gui.NewQIcon5(p("refresh.png"))
    50  	Icons.Add = gui.NewQIcon5(p("add.png"))
    51  	Icons.Delete = gui.NewQIcon5(p("delete.png"))
    52  	Icons.Edit = gui.NewQIcon5(p("edit.png"))
    53  	Icons.Reset = gui.NewQIcon5(p("reset.png"))
    54  	Icons.Preview = gui.NewQIcon5(p("preview.png"))
    55  	Icons.History = gui.NewQIcon5(p("history.png"))
    56  	Icons.Export = gui.NewQIcon5(p("export.png"))
    57  	Icons.Search = gui.NewQIcon5(p("search.png"))
    58  	Icons.FromTo = gui.NewQIcon5(p("fromTo.png"))
    59  	Icons.Tasks = gui.NewQIcon5(p("tasks.png"))
    60  	Icons.Mails = gui.NewQIcon5(p("mails.png"))
    61  	Icons.Cleanup = gui.NewQIcon5(p("cleanup.png"))
    62  	Icons.Identifie = gui.NewQIcon5(p("identifie.png"))
    63  	Icons.Documents = gui.NewQIcon5(p("documents.png"))
    64  	Icons.Star = gui.NewQIcon5(p("star.png"))
    65  	Icons.Cafs = gui.NewQIcon5(p("cafs.png"))
    66  	Icons.Joomeo = gui.NewQIcon5(p("joomeo.png"))
    67  	Icons.User = gui.NewQIcon5(p("user.png"))
    68  }
    69  
    70  func InitFont() {
    71  	BoldFont = gui.NewQFont()
    72  	BoldFont.SetBold(true)
    73  	ItalicFont = gui.NewQFont()
    74  	ItalicFont.SetItalic(true)
    75  }