goland
#862
Replies: 1 comment 4 replies
-
package main
import (
"cogentcore.org/core/gi"
"cogentcore.org/core/giv"
"cogentcore.org/core/icons"
"cogentcore.org/core/styles"
"cogentcore.org/core/texteditor"
_ "embed"
"github.com/ddkwork/golibrary/widget"
)
//go:generate core install
//go:generate core build -v -t android/arm64
//go:generate core build -v -t windows/amd64
//go:generate go build .
//go:generate go install .
//go:generate svg embed-image 1.png
//go:embed fleet.svg
var icon []byte
// https://faststone-photo-resizer.en.lo4d.com/windows
func main() {
//icons.AddFS()
gi.TheApp.SetIconBytes(icon)
b := gi.NewBody("fleet")
b.AddAppBar(func(tb *gi.Toolbar) {
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
gi.NewButton(tb).SetTooltip("open").SetIcon(icons.Add)
})
tabs := gi.NewTabs(b)
tabs.SetType(gi.NavigationRail) //left
projecttab := tabs.NewTab("project")
projecttab.Style(func(s *styles.Style) {}) //s.Text.Direction
//todo tab widget单机显示与隐藏,标题文本方向为垂直
//左侧tab,第一页为工程page,左树两个节点,右侧动态创建tab
//问题tab窗口应该垂直布局,不要使用拆分布
topFrame := gi.NewFrame(projecttab)
hSplits := widget.NewHSplits(topFrame)
treeView := giv.NewTreeView(hSplits)
treeView.AddChild(giv.NewFileView(treeView)) //todo mgr source file
treeView.AddChild(giv.NewFileView(treeView)) //todo mgr library file
editor := texteditor.NewEditor(hSplits)
editor.SetBuf(nil)
hSplits.SetSplits(.2, .8)
bottomFrame := gi.NewFrame(projecttab)
newTabs := gi.NewTabs(bottomFrame)
newTabs.SetType(gi.NavigationBar)
newTabs.NewTab("git")
newTabs.NewTab("todo")
issueTab := gi.NewTabs(newTabs.NewTab("issue"))
issueTab.NewTab("file") //todo tree view
issueTab.NewTab("project") //todo tree view
newTabs.NewTab("terminal")
newTabs.NewTab("service")
tabs.NewTab("bookMark").Style(func(s *styles.Style) {})
tabs.NewTab("commit").Style(func(s *styles.Style) {})
tabs.NewTab("mergePr").Style(func(s *styles.Style) {})
tabs.NewTab("struct").Style(func(s *styles.Style) {})
widget.NewWindowRunAndWait(b, func(names []string) {
})
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, when I use the core mock goland interface, I found that there are three places that are very confusing: the first is that the tab widget is in the case of vertical layout, I don't know how to automatically arrange it at the bottom of the main window, although I set the type of the tab widget to NavigationBar, but compared to the bottom area of goland, the issue tab page, obviously my layout is not working as expected. The second is the label text direction of the tab widget, can the text direction be set vertically? Looking at the left panel of the goland, the vertical will free up a lot of space. The last point is the behavior of the mock issue tab, when we click the first time, the tab will pop up, and the second click will shrink the area to make room for the code editor.
Beta Was this translation helpful? Give feedback.
All reactions