Browse Source

fixed notification renders

0xdcarns 3 years ago
parent
commit
a9df48b001

+ 2 - 1
netclient/gui/components/text.go

@@ -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,
 	)

+ 1 - 2
netclient/gui/components/views/notification.go

@@ -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

+ 1 - 1
netclient/gui/gui.go

@@ -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))