Scrollbar, ScrollContainer use ContentObject now
This commit is contained in:
@@ -68,7 +68,7 @@ func NewScrollContainer (sides ScrollSide) *ScrollContainer {
|
||||
// SetRoot sets the root child of the ScrollContainer. There can only be one at
|
||||
// a time, and setting it will remove and unlink the current child if there is
|
||||
// one.
|
||||
func (this *ScrollContainer) SetRoot (root tomo.ContentBox) {
|
||||
func (this *ScrollContainer) SetRoot (root tomo.ContentObject) {
|
||||
if this.layout.root != nil {
|
||||
// remove root and close cookies
|
||||
this.Remove(this.layout.root)
|
||||
@@ -134,14 +134,14 @@ func (this *ScrollContainer) handleScroll (x, y float64) {
|
||||
}
|
||||
|
||||
type scrollContainerLayout struct {
|
||||
root tomo.ContentBox
|
||||
root tomo.ContentObject
|
||||
horizontal *Scrollbar
|
||||
vertical *Scrollbar
|
||||
}
|
||||
|
||||
func (this *scrollContainerLayout) MinimumSize (hints tomo.LayoutHints, boxes []tomo.Box) image.Point {
|
||||
var minimum image.Point; if this.root != nil {
|
||||
minimum = this.root.MinimumSize()
|
||||
minimum = this.root.GetBox().MinimumSize()
|
||||
}
|
||||
if this.horizontal != nil {
|
||||
minimum.Y += this.horizontal.MinimumSize().Y
|
||||
@@ -165,7 +165,7 @@ func (this *scrollContainerLayout) Arrange (hints tomo.LayoutHints, boxes []tomo
|
||||
rootBounds.Max.X -= this.vertical.MinimumSize().X
|
||||
}
|
||||
if this.root != nil {
|
||||
this.root.SetBounds(rootBounds)
|
||||
this.root.GetBox().SetBounds(rootBounds)
|
||||
}
|
||||
if this.horizontal != nil {
|
||||
this.horizontal.SetBounds(image.Rect (
|
||||
|
||||
Reference in New Issue
Block a user