mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-09 02:30:49 +08:00
fixed notification renders
This commit is contained in:
@@ -13,9 +13,10 @@ import (
|
|||||||
// ColoredText - renders a colored label
|
// ColoredText - renders a colored label
|
||||||
func ColoredText(text string, color color.Color) *fyne.Container {
|
func ColoredText(text string, color color.Color) *fyne.Container {
|
||||||
btn := widget.NewLabel(text)
|
btn := widget.NewLabel(text)
|
||||||
|
btn.Wrapping = fyne.TextWrapWord
|
||||||
bgColor := canvas.NewRectangle(color)
|
bgColor := canvas.NewRectangle(color)
|
||||||
return container.New(
|
return container.New(
|
||||||
layout.NewGridWrapLayout(fyne.NewSize(400, 100)),
|
layout.NewMaxLayout(),
|
||||||
bgColor,
|
bgColor,
|
||||||
btn,
|
btn,
|
||||||
)
|
)
|
||||||
|
@@ -4,13 +4,12 @@ import (
|
|||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
|
||||||
"github.com/gravitl/netmaker/netclient/gui/components"
|
"github.com/gravitl/netmaker/netclient/gui/components"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenerateNotification - generates a notification
|
// GenerateNotification - generates a notification
|
||||||
func GenerateNotification(text string, c color.Color) fyne.CanvasObject {
|
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
|
// 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.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 := container.NewVScroll(views.GetNetworksView(networks))
|
||||||
networkView.SetMinSize(fyne.NewSize(400, 300))
|
networkView.SetMinSize(fyne.NewSize(400, 300))
|
||||||
|
Reference in New Issue
Block a user