mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-29 19:32:19 +08:00
added library and initial commit for gui
This commit is contained in:
22
netclient/gui/components/text.go
Normal file
22
netclient/gui/components/text.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package components
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
// ColoredText - renders a colored label
|
||||
func ColoredText(text string, color color.Color) *fyne.Container {
|
||||
btn := widget.NewLabel(text)
|
||||
bgColor := canvas.NewRectangle(color)
|
||||
return container.New(
|
||||
layout.NewMaxLayout(),
|
||||
bgColor,
|
||||
btn,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user