Skip to content

Commit 25f5157

Browse files
committed
Update scripts and add new containers and layouts
1 parent b9474f8 commit 25f5157

File tree

14 files changed

+190
-683
lines changed

14 files changed

+190
-683
lines changed

_gen/gendialogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func main() {
8585
c := w.Canvas().(test.WindowlessCanvas)
8686

8787
pwd, _ := os.Getwd()
88-
imgDir = filepath.Join(pwd, "..", "images", "dialogs")
88+
imgDir = filepath.Join(pwd, "..", "static", "images", "dialogs")
8989

9090
fyne.CurrentApp().Settings().SetTheme(theme.LightTheme())
9191
for _, item := range makeDrawList() {

_gen/genicons.sh

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cd "$(dirname "$0")"
66
cd ..
77

88
function srcFromRes() {
9-
echo $1 | sed -e "s/IconRes/.svg/g" | sed --expression 's/\([A-Z]\)/-\L\1/g' --expression 's/^-//' \
9+
echo $1 | sed -e "s/IconRes/.svg/g" | sed -e 's/\([A-Z]\)/-\L\1/g' -e 's/^-//' | sed -e "s/dragcorner/drag-corner-/g" \
1010
| sed -e "s/radiobutton/radio-button-/g" | sed -e "s/search/search-/g" | sed -e "s/color/color-/g" | sed -e "s/content/content-/g" \
1111
| sed -e "s/checkbox/check-box-/g" | sed -e "s/document/document-/g" | sed -e "s/more/more-/g" | sed -e "s/menu/menu-/g" \
1212
| sed -e "s/mail/mail-/g" | sed -e "s/media/media-/g" | sed -e "s/fast/fast-/g" | sed -e "s/skip/skip-/g" \
@@ -24,7 +24,7 @@ function stripDTD() {
2424
LINES=`grep NewThemedResource\( $ROOT/theme/icons.go | grep -v func | awk -F"IconName" '{print $2}'| awk -F":" '{gsub(/^[ \t]+/, "", $1); gsub(/[ \t]+$/, "", $1); gsub(/^[ \t]+/, "", $2); print $1 "|" $2}' | sed -e "s/NewThemedResource(//g" | sed -e "s/),//g"`
2525
SORTED=`echo $LINES | sed -e "s/ /\n/g" | sort`
2626

27-
OUT="layout/_shortcodes/iconlist.html"
27+
OUT="layouts/_shortcodes/iconlist.html"
2828
echo '<ul class="theme-icon-list">' > $OUT
2929
for LINE in $SORTED; do
3030
IFS='|'; parts=($LINE); unset IFS;
@@ -43,3 +43,4 @@ done
4343
echo '</ul>' >> $OUT
4444

4545
sed -i.bak 's/<?xml.*?>//' $OUT
46+
rm $OUT.bak

_gen/genlayouts.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func makeDrawList() []drawItem {
5555
{"gridwrap", fyne.NewContainerWithLayout(layout.NewGridWrapLayout(fyne.NewSize(75, 75)), makeObjs()...)},
5656
{"max", fyne.NewContainerWithLayout(layout.NewMaxLayout(), makeObjs()...)},
5757
{"padded", fyne.NewContainerWithLayout(layout.NewPaddedLayout(), makeObjs()...)},
58+
{"rowwrap", fyne.NewContainerWithLayout(layout.NewRowWrapLayout(), makeMoreObjs()...)},
5859
{"custompadded", fyne.NewContainerWithLayout(layout.NewCustomPaddedLayout(10, 20, 30, 15), makeObjs()...)},
5960
{"combined", combined},
6061
}
@@ -70,6 +71,18 @@ func makeObjs() []fyne.CanvasObject {
7071
return []fyne.CanvasObject{prop1, prop2, prop3}
7172
}
7273

74+
func makeMoreObjs() []fyne.CanvasObject {
75+
prop1 := canvas.NewRectangle(boxColor())
76+
prop1.SetMinSize(fyne.NewSize(50, 50))
77+
prop2 := canvas.NewRectangle(boxColor())
78+
prop2.SetMinSize(fyne.NewSize(100, 25))
79+
prop3 := canvas.NewRectangle(boxColor())
80+
prop3.SetMinSize(fyne.NewSize(50, 75))
81+
prop4 := canvas.NewRectangle(boxColor())
82+
prop4.SetMinSize(fyne.NewSize(75, 75))
83+
return []fyne.CanvasObject{prop1, prop2, prop3, prop4}
84+
}
85+
7386
func draw(scene fyne.CanvasObject, name string, c test.WindowlessCanvas, themeName string) {
7487
fileName := filepath.Join(imgDir, name+"-"+themeName+".png")
7588
file, err := os.Create(fileName)
@@ -98,7 +111,7 @@ func main() {
98111
c := w.Canvas().(test.WindowlessCanvas)
99112

100113
pwd, _ := os.Getwd()
101-
imgDir = filepath.Join(pwd, "..", "images", "layouts")
114+
imgDir = filepath.Join(pwd, "..", "static", "images", "layouts")
102115

103116
fyne.CurrentApp().Settings().SetTheme(transparentBGTheme(theme.LightTheme()))
104117
for _, item := range makeDrawList() {

_gen/genpdf.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

_gen/genwidgets.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ func makeDrawList() []drawItem {
4949
{"button", widget.NewButtonWithIcon("Cancel", theme.CancelIcon(), func() {})},
5050
{"card", &widget.Card{Title: "Card Title", Subtitle: "Subtitle", Image: canvas.NewImageFromResource(theme.FyneLogo())}},
5151
{"check", &widget.Check{Text: "Check", Checked: true}},
52+
{"clip", container.NewGridWithColumns(2, container.NewClip(container.NewStack(
53+
canvas.NewCircle(theme.ButtonColor()),
54+
widget.NewLabel("A long line of text\nLine two is long"))))},
5255
{"entry", &widget.Entry{PlaceHolder: "Entry", Scroll: container.ScrollNone}},
5356
{"entry-invalid", makeInvalidEntry()},
5457
{"entry-valid", &widget.Entry{Validator: func(_ string) error { return nil }, Text: "Valid", Scroll: container.ScrollNone}},
@@ -62,6 +65,7 @@ func makeDrawList() []drawItem {
6265
{"icon", widget.NewIcon(theme.ContentPasteIcon())},
6366
{"label", widget.NewLabel("Text label")},
6467
{"list", makeList()},
68+
{"navigation", container.NewNavigation(widget.NewLabel("Root item"))},
6569
{"table", makeTable()},
6670
{"tree", makeTree()},
6771
{"password", &widget.Entry{PlaceHolder: "Password", Password: true, Scroll: container.ScrollNone}},
@@ -184,11 +188,18 @@ func draw(obj fyne.CanvasObject, name string, c fyne.Canvas, themeName string) {
184188
time.Sleep(time.Second)
185189
} else if name == "separator" {
186190
c.(test.WindowlessCanvas).Resize(obj.MinSize().Add(fyne.NewSize(120+theme.Padding()*2, theme.Padding()*2)))
187-
} else if name == "list" || name == "table" || name == "tree" || name == "gridwrap" || name == "accordion" {
191+
} else if name == "list" || name == "table" || name == "tree" || name == "gridwrap" || name == "accordion" || name == "clip" {
188192
c.(test.WindowlessCanvas).Resize(fyne.NewSize(136, 120))
189193
test.TapCanvas(c, fyne.NewPos(50, 60))
190194
}
191195
img := c.Capture()
196+
197+
if name == "navigation" {
198+
c.Content().(*container.Navigation).PushWithTitle(widget.NewLabel("Child Content"), "Title")
199+
c.(test.WindowlessCanvas).Resize(c.Size().AddWidthHeight(1, 1))
200+
img = c.Capture()
201+
}
202+
192203
err = png.Encode(file, img)
193204
if err != nil {
194205
fyne.LogError("Unable to write image", err)
@@ -200,7 +211,7 @@ func main() {
200211
c := w.Canvas()
201212

202213
pwd, _ := os.Getwd()
203-
imgDir = filepath.Join(pwd, "..", "images", "widgets")
214+
imgDir = filepath.Join(pwd, "..", "static", "images", "widgets")
204215

205216
fyne.CurrentApp().Settings().SetTheme(theme.LightTheme())
206217
for _, item := range makeDrawList() {

_gen/go.mod

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@ module github.com/fyne-io/docs.fyne.io/gen
22

33
go 1.19
44

5-
require fyne.io/fyne/v2 v2.5.0
5+
require fyne.io/fyne/v2 v2.7.0
66

77
require (
88
github.com/davecgh/go-spew v1.1.1 // indirect
9-
github.com/fredbi/uri v1.1.0 // indirect
10-
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
11-
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
12-
github.com/go-text/render v0.1.0 // indirect
13-
github.com/go-text/typesetting v0.1.0 // indirect
9+
github.com/fredbi/uri v1.1.1 // indirect
10+
github.com/fyne-io/gl-js v0.2.0 // indirect
11+
github.com/fyne-io/oksvg v0.2.0 // indirect
12+
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71 // indirect
13+
github.com/go-text/render v0.2.0 // indirect
14+
github.com/go-text/typesetting v0.2.1 // indirect
1415
github.com/godbus/dbus/v5 v5.1.0 // indirect
15-
github.com/gopherjs/gopherjs v1.17.2 // indirect
16-
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49 // indirect
17-
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect
16+
github.com/hack-pad/go-indexeddb v0.3.2 // indirect
17+
github.com/hack-pad/safejs v0.1.0 // indirect
18+
github.com/jeandeaual/go-locale v0.0.0-20250612000132-0ef82f21eade // indirect
19+
github.com/kr/text v0.2.0 // indirect
20+
github.com/nicksnyder/go-i18n/v2 v2.5.1 // indirect
1821
github.com/pmezard/go-difflib v1.0.0 // indirect
19-
github.com/rymdport/portal v0.2.2 // indirect
22+
github.com/rymdport/portal v0.4.2 // indirect
2023
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
2124
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
22-
github.com/stretchr/testify v1.8.4 // indirect
23-
github.com/yuin/goldmark v1.7.1 // indirect
24-
golang.org/x/image v0.18.0 // indirect
25-
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
26-
golang.org/x/net v0.25.0 // indirect
27-
golang.org/x/sys v0.20.0 // indirect
28-
golang.org/x/text v0.16.0 // indirect
25+
github.com/stretchr/testify v1.11.1 // indirect
26+
github.com/yuin/goldmark v1.7.8 // indirect
27+
golang.org/x/image v0.24.0 // indirect
28+
golang.org/x/net v0.35.0 // indirect
29+
golang.org/x/sys v0.30.0 // indirect
30+
golang.org/x/text v0.22.0 // indirect
2931
gopkg.in/yaml.v3 v3.0.1 // indirect
3032
)

0 commit comments

Comments
 (0)