修正基本架构逻辑,基本实现离线功能
This commit is contained in:
+22
-7
@@ -4,6 +4,7 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
"work_cation/models"
|
||||
"work_cation/views/createView"
|
||||
"work_cation/views/showView"
|
||||
)
|
||||
|
||||
// Tutorial 定义教程的数据结构
|
||||
@@ -16,9 +17,9 @@ type Tutorial struct {
|
||||
var (
|
||||
// Tutorials 定义每个教程的元数据
|
||||
Tutorials = map[string]Tutorial{
|
||||
"welcome": {"主页", "", UserViews, true},
|
||||
"canvas": {"我的", "", myCardsViews, true},
|
||||
"create": {"新建", "", CreateCards, true},
|
||||
"welcome": {"主页", "", mainUserViews, true},
|
||||
"canvas": {"我的", "", allCardsViews, true},
|
||||
"create": {"新建", "", allCreateCards, true},
|
||||
}
|
||||
|
||||
// TutorialIndex 定义我们的教程应该如何在索引树中布局
|
||||
@@ -26,7 +27,7 @@ var (
|
||||
"": {"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"},
|
||||
//"widgets": {"accordion", "button", "card", "entry", "form", "input", "progress", "text", "toolbar"}, 58 * 3 + 106 = 280
|
||||
}
|
||||
)
|
||||
|
||||
@@ -34,11 +35,25 @@ type cardInfo struct {
|
||||
Name string
|
||||
createView func(w fyne.Window) fyne.CanvasObject
|
||||
createSize fyne.Size
|
||||
showView func(fyne.Window, *models.BaseCard) (fyne.CanvasObject, error)
|
||||
}
|
||||
|
||||
var (
|
||||
CardTypeMap = map[string]cardInfo{
|
||||
models.ToolTypeErlang: {"Erlang代码脚本模版", createView.CreateErlangCard, fyne.NewSize(600, 400)},
|
||||
models.ToolTypeExecFiles: {"自定义可执行工具", createView.CreateExecFile, fyne.NewSize(600, 520)},
|
||||
cardTypeMap = map[string]cardInfo{
|
||||
models.ToolTypeNoVarErlang: {
|
||||
"Erlang代码脚本",
|
||||
nil,
|
||||
fyne.NewSize(0, 0),
|
||||
showView.ErlangCardNoVarView},
|
||||
models.ToolTypeErlang: {
|
||||
"Erlang代码脚本模版",
|
||||
createView.CreateErlangCard,
|
||||
fyne.NewSize(600, 400),
|
||||
showView.ErlangCardView},
|
||||
models.ToolTypeExecFiles: {
|
||||
"自定义可执行工具",
|
||||
createView.CreateExecFile,
|
||||
fyne.NewSize(600, 520),
|
||||
showView.ExecFileCardView},
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user