Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

widget.List in widget.AccordionItem not all are displayed #4126

Closed
2 tasks done
linauror opened this issue Aug 3, 2023 · 7 comments
Closed
2 tasks done

widget.List in widget.AccordionItem not all are displayed #4126

linauror opened this issue Aug 3, 2023 · 7 comments

Comments

@linauror
Copy link

linauror commented Aug 3, 2023

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

widget.List in widget.AccordionItem, when AccordionItem open, only one item with scroll bar is displayed, not all are displayed

How to reproduce

1, go run code
2, clike item1

Screenshots

Now:
image

Want:
image

Example code

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("all items will display")

	items := []string{"a", "b", "c"}
	item1 := widget.NewList(func() int {
		return len(items)
	}, func() fyne.CanvasObject {
		return widget.NewLabel("key")
	}, func(id widget.ListItemID, o fyne.CanvasObject) {
		o.(*widget.Label).SetText(items[id])
	})

	itemLayout := widget.NewAccordion(widget.NewAccordionItem("item1", item1))
	content := container.NewMax(itemLayout)

	myWindow.SetContent(content)
	myWindow.Resize(fyne.NewSize(300, 300))
	myWindow.ShowAndRun()
}

Fyne version

v2.3.5

Go compiler version

1.19.9

Operating system and version

Windows 10

Additional Information

No response

@linauror linauror added the unverified A bug that has been reported but not verified label Aug 3, 2023
@andydotxyz
Copy link
Member

Accordion is currently set up to display items at min height. We could consider altering it to stretch, though that might be peculiar for smaller content. Interested in peoples opinions on this, I'm pretty sure it's one or the other not much option between.

@linauror
Copy link
Author

linauror commented Aug 3, 2023

I also agree that stretch is a good way

@linauror linauror closed this as completed Aug 3, 2023
@andydotxyz andydotxyz reopened this Aug 3, 2023
@matwachich
Copy link
Contributor

Why not a boolean option ExpandContent bool. Default value false will not change anything, and if set true, the content will expand full height

@andydotxyz
Copy link
Member

Could do, but looking at consistency the way it works feels like a mistake. You can return to this behaviour by putting the whole container into a VBox if I see things correctly.

Mostly I'm nervous about the president set by having components decide how much of the container to use ...

@dweymouth
Copy link
Contributor

What about adding a SetMinRowsVisible function on the List, similar to Entry which already has it. The only "gotcha" is that it would have to be based on the template row's height, and if you have some custom-height items with SetItemHeight, then the minrowsvisible may not apply to them

@andydotxyz
Copy link
Member

You'd need to add the same to Tree and Table and GridWrap as well I would think. And even then it's still not making use of the available space. The Entry is really a special case as in some instances the input could require or expect a certain length of content.

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Aug 11, 2023
@andydotxyz andydotxyz removed the unverified A bug that has been reported but not verified label Aug 11, 2023
@andydotxyz
Copy link
Member

This is resolved on develop for v2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants