fixed notification renders

This commit is contained in:
0xdcarns
2022-05-06 12:31:43 -04:00
parent 73991ce3a2
commit a9df48b001
3 changed files with 4 additions and 4 deletions

View File

@@ -13,9 +13,10 @@ import (
// ColoredText - renders a colored label
func ColoredText(text string, color color.Color) *fyne.Container {
btn := widget.NewLabel(text)
btn.Wrapping = fyne.TextWrapWord
bgColor := canvas.NewRectangle(color)
return container.New(
layout.NewGridWrapLayout(fyne.NewSize(400, 100)),
layout.NewMaxLayout(),
bgColor,
btn,
)

View File

@@ -4,13 +4,12 @@ import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"github.com/gravitl/netmaker/netclient/gui/components"
)
// GenerateNotification - generates a notification
func GenerateNotification(text string, c color.Color) fyne.CanvasObject {
return container.NewCenter(components.ColoredText(text, c))
return components.ColoredText(text, c)
}
// ChangeNotification - changes the current notification in the view

View File

@@ -37,7 +37,7 @@ func Run(networks []string) error {
}
window.SetIcon(&fyne.StaticResource{StaticName: "Netmaker logo", StaticContent: img})
window.Resize(fyne.NewSize(600, 400))
window.Resize(fyne.NewSize(600, 500))
networkView := container.NewVScroll(views.GetNetworksView(networks))
networkView.SetMinSize(fyne.NewSize(400, 300))