Compare commits

...

2 Commits

3 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,8 @@ func NewHeading (level int, text string) *Heading {
this.SetRole(tomo.R("objects", "Heading"))
this.SetTag(fmt.Sprint(level), true)
this.SetText(text)
this.SetSelectable(true)
this.SetFocusable(true)
return this
}

View File

@ -13,5 +13,7 @@ func NewLabel (text string) *Label {
this.SetRole(tomo.R("objects", "Label"))
this.SetText(text)
this.SetAttr(tomo.AAlign(tomo.AlignStart, tomo.AlignMiddle))
this.SetSelectable(true)
this.SetFocusable(true)
return this
}

View File

@ -235,6 +235,16 @@ func (this *Scrollbar) handleMouseMove () bool {
func (this *Scrollbar) handleScroll (x, y float64) bool {
if this.layout.linked == nil { return false }
delta := (x + y)
if this.layout.vertical {
x = 0
y = delta
} else {
x = delta
y = 0
}
this.layout.linked.ScrollTo (
this.layout.linked.ContentBounds().Min.
Sub(image.Pt(int(x), int(y))))