From 23fb28ce5c41908fe9285b5e69cfebf05b4f38e1 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Sat, 15 Jun 2024 09:27:35 -0400 Subject: [PATCH] Some internal layouts return recommended sizes --- scrollbar.go | 8 ++++---- scrollcontainer.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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 {