mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-08 10:11:08 +08:00
fixed notification renders
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
@@ -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
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user