diff --git a/scrollbar.go b/scrollbar.go index 1366342..4cb5ed2 100644 --- a/scrollbar.go +++ b/scrollbar.go @@ -335,12 +335,12 @@ func (this scrollbarLayout) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) { } -func (this scrollbarLayout) RecommendedHeight (tomo.LayoutHints, []tomo.Box, int) int { - return 0 +func (this scrollbarLayout) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { + return this.MinimumSize(hints, boxes).X } -func (this scrollbarLayout) RecommendedWidth (tomo.LayoutHints, []tomo.Box, int) int { - return 0 +func (this scrollbarLayout) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { + return this.MinimumSize(hints, boxes).Y } func (this scrollbarLayout) viewportContentRatio () float64 { diff --git a/scrollcontainer.go b/scrollcontainer.go index 9659acc..e4b18e4 100644 --- a/scrollcontainer.go +++ b/scrollcontainer.go @@ -184,12 +184,12 @@ func (this *scrollContainerLayout) Arrange (hints tomo.LayoutHints, boxes []tomo } } -func (this *scrollContainerLayout) RecommendedHeight (tomo.LayoutHints, []tomo.Box, int) int { - return 0 +func (this *scrollContainerLayout) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { + return this.MinimumSize(hints, boxes).X } -func (this *scrollContainerLayout) RecommendedWidth (tomo.LayoutHints, []tomo.Box, int) int { - return 0 +func (this *scrollContainerLayout) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { + return this.MinimumSize(hints, boxes).Y } func max (x, y int) int {