/
footer.go
55 lines (50 loc) · 1.57 KB
/
footer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package calc
import (
"predmer-api/OLD/app/gel/container"
"predmer-api/OLD/app/helper"
"gioui.org/layout"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
"github.com/w-ingsolutions/c/pkg/lyt"
)
func footer(w *WingCal) func(gtx C) D {
return func(gtx C) D {
return container.DuoUIcontainer(w.UI.Tema, 4, w.UI.Tema.Colors["DarkGrayI"]).Layout(gtx, layout.Center, func(gtx C) D {
gtx.Constraints.Min.X = gtx.Constraints.Max.X
return lyt.Format(gtx, "hflexb(middle,r(_),r(_),r(_))",
w.iconLink(podesavanjeDugme, "podesavanja", "settingsIcon"),
w.iconLink(pomocDugme, "pomoc", "settingsIcon"),
w.footerMenu())
})
}
}
func (w *WingCal) footerMenu() func(gtx C) D {
return func(gtx C) D {
return lyt.Format(gtx, "hflexb(middle,r(_),r(_),r(_))",
w.stranaDugme(projekatDugme, w.ProjekatRacunica(), w.text("PROJEKAT"), "projekat"),
helper.DuoUIline(true, 0, 2, 2, w.UI.Tema.Colors["DarkGrayI"]),
w.stranaDugme(materijalDugme, func() {}, w.text("MATERIJAL"), "materijal"),
)
}
}
func (w *WingCal) iconLink(b *widget.Clickable, s, i string) func(gtx C) D {
return func(gtx C) D {
return layout.Center.Layout(gtx, func(gtx C) D {
btn := material.IconButton(w.UI.Tema.T, b, w.UI.Tema.Icons[i])
btn.Color = helper.HexARGB(w.UI.Tema.Colors["Danger"])
btn.Size = unit.Dp(16)
btn.Inset = layout.Inset{
Top: unit.Dp(4),
Right: unit.Dp(4),
Bottom: unit.Dp(4),
Left: unit.Dp(4),
}
btn.Background = helper.HexARGB(w.UI.Tema.Colors["White"])
for b.Clicked() {
w.Strana = s
}
return btn.Layout(gtx)
})
}
}