move HSpace to util package
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"golang.org/x/net/html"
|
||||
)
|
||||
@@ -53,3 +55,23 @@ func RichTextSegsFromHTMLString(s string) []widget.RichTextSegment {
|
||||
|
||||
return segs
|
||||
}
|
||||
|
||||
type HSpace struct {
|
||||
widget.BaseWidget
|
||||
|
||||
Width float32
|
||||
}
|
||||
|
||||
func NewHSpace(w float32) *HSpace {
|
||||
h := &HSpace{Width: w}
|
||||
h.ExtendBaseWidget(h)
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *HSpace) MinSize() fyne.Size {
|
||||
return fyne.NewSize(h.Width, 0)
|
||||
}
|
||||
|
||||
func (h *HSpace) CreateRenderer() fyne.WidgetRenderer {
|
||||
return widget.NewSimpleRenderer(layout.NewSpacer())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user