feat: initial project commit
commit to push first working snapshot to codeberg
This commit is contained in:
commit
09b1054588
25 changed files with 1405 additions and 0 deletions
91
internal/gui/project_screen.go
Normal file
91
internal/gui/project_screen.go
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
package gui
|
||||
|
||||
import (
|
||||
"jws/internal/project"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
// ShowProjectScreen displays the project selection screen
|
||||
func ShowProjectScreen() {
|
||||
title := widget.NewLabel("Project-Selection")
|
||||
title.TextStyle = fyne.TextStyle{Bold: true}
|
||||
title.Alignment = fyne.TextAlignCenter
|
||||
|
||||
description := widget.NewLabel("Choose a Starter-Project to deploy:")
|
||||
description.Wrapping = fyne.TextWrapWord
|
||||
description.Alignment = fyne.TextAlignCenter
|
||||
|
||||
projectsList := container.NewVBox()
|
||||
|
||||
for i, proj := range projects {
|
||||
projTitle := widget.NewLabel(proj.Name)
|
||||
projTitle.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
projDesc := widget.NewLabel(proj.Description)
|
||||
projDesc.Wrapping = fyne.TextWrapWord
|
||||
|
||||
deployBtn := widget.NewButton("deploy", func(i int) func() {
|
||||
return func() {
|
||||
project.DeployProject(i, projects, projectsFS, mainWindow)
|
||||
}
|
||||
}(i))
|
||||
deployBtn.Importance = widget.HighImportance
|
||||
|
||||
projectContent := container.NewBorder(
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
container.NewCenter(deployBtn),
|
||||
container.NewVBox(projTitle, projDesc),
|
||||
)
|
||||
|
||||
projectCard := container.NewBorder(
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
container.NewPadded(projectContent),
|
||||
)
|
||||
|
||||
bg := canvas.NewRectangle(theme.Color(theme.ColorNameBackground))
|
||||
|
||||
borderedContainer := container.NewStack(
|
||||
bg,
|
||||
projectCard,
|
||||
)
|
||||
|
||||
spacedContainer := container.NewVBox(
|
||||
borderedContainer,
|
||||
widget.NewSeparator(),
|
||||
)
|
||||
|
||||
projectsList.Add(spacedContainer)
|
||||
}
|
||||
|
||||
backBtn := widget.NewButton("Check Dependecies", func() {
|
||||
ShowDependencyScreen()
|
||||
})
|
||||
|
||||
scrollContainer := container.NewVScroll(projectsList)
|
||||
|
||||
header := container.NewVBox(
|
||||
title,
|
||||
description,
|
||||
widget.NewSeparator(),
|
||||
)
|
||||
|
||||
content := container.NewBorder(
|
||||
header,
|
||||
backBtn, // footer,
|
||||
nil,
|
||||
nil,
|
||||
scrollContainer,
|
||||
)
|
||||
|
||||
mainWindow.SetContent(content)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue