拓展类型

This commit is contained in:
2024-09-25 17:45:38 +08:00
parent a0e898e46c
commit 3b69ba93ad
15 changed files with 214 additions and 40 deletions
+3 -2
View File
@@ -1,7 +1,6 @@
package main
import (
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
@@ -12,6 +11,7 @@ import (
"work_cation/views"
)
// 本地缓存 上次打开目录
const preferenceCurrentTutorial = "currentTutorial"
func main() {
@@ -102,13 +102,14 @@ func makeNav(setTutorial func(tutorial views.Tutorial), loadPrevious bool) fyne.
if unsupportedTutorial(t) {
return
}
// 存储默认打开
a.Preferences().SetString(preferenceCurrentTutorial, uid)
fmt.Println(t)
setTutorial(t)
}
},
}
// 读取存储默认打开
if loadPrevious {
currentPref := a.Preferences().StringWithFallback(preferenceCurrentTutorial, "welcome")
tree.Select(currentPref)