Skip to content

Commit

Permalink
新增: 主页面UI(大区下拉框, 玩家名字输入框, 确认按钮)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikyanite committed Jul 27, 2023
1 parent be8451a commit e2153ef
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 30 deletions.
1 change: 0 additions & 1 deletion data/model/model.go

This file was deleted.

26 changes: 2 additions & 24 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
package main

import (
"fmt"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"hidden-record-assistant/service/query"
)

func ShowUI() {
a := app.New()
w := a.NewWindow("LOL隐藏战绩查询小助手")

hello := widget.NewLabel("Hello Fyne!")
w.SetContent(container.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),
))

w.ShowAndRun()
}
import "hidden-record-assistant/view"

func main() {
res, err := query.SendQuery("1", "乞力马扎罗的雪丶")
fmt.Printf("%v %v\n", res, err)
view.Show()
}
10 changes: 6 additions & 4 deletions record.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,19 @@ func SendQuery(dq, name string) (res Result, err error) {

### 7.27

ok,经过两天断断续续地施工总算把最简单的代码部分写好啦。接下来就是重头,也就是UI的设计,先上个草稿:

![image-20230727184636742](https://raw.githubusercontent.com/Vikyanite/talks/main/images/2023-07-27-164d5e-image-20230727184636742.png)

那我们就开始编写左边的界面吧~

首先明确需求,我们需要三个框,**一个下拉框****一个输入框****一个按钮**。这些对于fyne来说都是小事~

![image-20230727190509278](https://raw.githubusercontent.com/Vikyanite/talks/main/images/2023-07-27-3d6296-image-20230727190509278.png)







也算是有点雏形了吧!



Expand Down
30 changes: 30 additions & 0 deletions view/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package view

import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)

func Show() {
a := app.New()
w := a.NewWindow("LOL隐藏战绩查询小助手")
w.Resize(fyne.NewSize(400, 300))

hello := container.NewBorder(nil, nil, nil,
container.NewBorder(nil, nil,
widget.NewLabel("大区: "), widget.NewSelect([]string{"艾欧尼亚", "德玛西亚"}, func(s string) {}),
),
)
w.SetContent(container.NewBorder(
hello,
widget.NewButton("Submit", func() {
w.SetContent(container.NewVBox(widget.NewLabel("TODO PAGE...")))
}),
nil, nil,
widget.NewEntry(),
))

w.ShowAndRun()
}
1 change: 0 additions & 1 deletion view/view.go

This file was deleted.

0 comments on commit e2153ef

Please sign in to comment.