5 Commits

Author SHA1 Message Date
b87f32eac9 TextInput scrolls in the proper direction 2024-07-26 18:11:02 -04:00
793526238a Scrollbar drags on mouse motion 2024-07-26 18:10:48 -04:00
884148f006 Fix ScrollContainer layout again 2024-07-26 17:56:29 -04:00
3e382da688 Fix ScrollContainer layout 2024-07-26 17:54:32 -04:00
18b8898644 Fix dialog alignment 2024-07-26 00:34:05 -04:00
4 changed files with 8 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti
} }
} }
dialog.controlRow = NewInnerContainer(layouts.ContractHorizontal, options...) dialog.controlRow = NewInnerContainer(layouts.ContractHorizontal, options...)
messageText.SetAttr(tomo.AAlign(tomo.AlignEnd, tomo.AlignEnd)) dialog.controlRow.SetAttr(tomo.AAlign(tomo.AlignEnd, tomo.AlignEnd))
dialog.SetRoot(NewOuterContainer ( dialog.SetRoot(NewOuterContainer (
layouts.Column { true, false }, layouts.Column { true, false },

View File

@@ -229,6 +229,7 @@ func (this *Scrollbar) handleButtonUp (button input.Button) bool {
func (this *Scrollbar) handleMouseMove () bool { func (this *Scrollbar) handleMouseMove () bool {
if !this.dragging { return false } if !this.dragging { return false }
this.drag()
return true return true
} }

View File

@@ -73,7 +73,11 @@ func NewScrollContainer (sides ScrollSide) *ScrollContainer {
this.OnKeyUp(this.handleKeyUp) this.OnKeyUp(this.handleKeyUp)
this.SetRole(tomo.R("objects", "ScrollContainer")) this.SetRole(tomo.R("objects", "ScrollContainer"))
this.SetTag(sides.String(), true) this.SetTag(sides.String(), true)
this.SetAttr(tomo.ALayout(layouts.NewGrid(true, false)(true, false))) if sides == ScrollHorizontal {
this.SetAttr(tomo.ALayout(layouts.NewGrid(true)(true, false)))
} else {
this.SetAttr(tomo.ALayout(layouts.NewGrid(true, false)(true, false)))
}
return this return this
} }

View File

@@ -120,6 +120,6 @@ func (this *TextInput) handleKeyUp (key input.Key, numpad bool) bool {
} }
func (this *TextInput) handleScroll (x, y float64) bool { func (this *TextInput) handleScroll (x, y float64) bool {
this.ScrollTo(this.ContentBounds().Min.Add(image.Pt(int(x), int(y)))) this.ScrollTo(this.ContentBounds().Min.Sub(image.Pt(int(x), int(y))))
return true return true
} }