47 lines
1.4 KiB
Go
47 lines
1.4 KiB
Go
package views
|
|
|
|
import (
|
|
"fyne.io/fyne/v2"
|
|
"work_cation/models"
|
|
"work_cation/views/createView"
|
|
)
|
|
|
|
// Tutorial 定义教程的数据结构
|
|
type Tutorial struct {
|
|
Title, Intro string
|
|
View func(w fyne.Window) fyne.CanvasObject
|
|
SupportWeb bool
|
|
}
|
|
|
|
var (
|
|
// Tutorials 定义每个教程的元数据
|
|
Tutorials = map[string]Tutorial{
|
|
"welcome": {"主页", "", UserViews, true},
|
|
"canvas": {"我的", "", myCardsViews, true},
|
|
"create": {"新建", "", CreateCards, true},
|
|
}
|
|
|
|
// TutorialIndex 定义我们的教程应该如何在索引树中布局
|
|
TutorialIndex = map[string][]string{
|
|
"": {"welcome", "canvas", "create"},
|
|
//"collections": {"list", "table", "tree"},
|
|
//"containers": {"apptabs", "border", "box", "center", "doctabs", "grid", "scroll", "split"},
|
|
//"widgets": {"accordion", "button", "card", "entry", "form", "input", "progress", "text", "toolbar"},
|
|
}
|
|
)
|
|
|
|
type cardInfo struct {
|
|
Name string
|
|
createView func(w fyne.Window) fyne.CanvasObject
|
|
createSize fyne.Size
|
|
}
|
|
|
|
var (
|
|
CardTypeMap = map[string]cardInfo{
|
|
models.ToolTypeErlang: {"erlang代码脚本1", createView.CreateErlangCard, fyne.NewSize(600, 400)},
|
|
"2": {"erlang代码脚本2", createView.CreateErlangCard, fyne.NewSize(600, 400)},
|
|
"3": {"erlang代码脚本3", createView.CreateErlangCard, fyne.NewSize(600, 400)},
|
|
"4": {"erlang代码脚本4", createView.CreateErlangCard, fyne.NewSize(600, 400)},
|
|
}
|
|
)
|