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

Maximizing FixedGridLayout and VScrollContainer causes items to display in a vertical row. #1250

Closed
mondy opened this issue Aug 14, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@mondy
Copy link

mondy commented Aug 14, 2020

Describe the bug:

When FixedGridLayout and VScrollContainer are combined, items are displayed in a vertical row.

To Reproduce:

Steps to reproduce the behaviour:

  1. Run the following code.
  2. Maximize the window.
  3. The items in the FixedGridLayout will be displayed in a single vertical column.
  4. Mouse over the scroll bar on the far right to view it correctly.

Screenshots:

ss2

Example code:

package main

import (
	"strconv"

	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/layout"
	"fyne.io/fyne/theme"
	"fyne.io/fyne/widget"
)

func main() {
	application := app.New()

	window := application.NewWindow("")

	files := files()

	grid := fyne.NewContainerWithLayout(
		layout.NewFixedGridLayout(fyne.NewSize(200, 200)),
		files...,
	)
	window.SetContent(widget.NewVScrollContainer(grid))

	window.ShowAndRun()

}

func files() []fyne.CanvasObject {
	objects := make([]fyne.CanvasObject, 100)
	for i := range objects {
		text := widget.NewLabel(strconv.Itoa(i))
		text.Wrapping = fyne.TextTruncate
		text.Alignment = fyne.TextAlignCenter

		objects[i] = fyne.NewContainerWithLayout(
			layout.NewBorderLayout(nil, text, nil, nil),
			text,
			widget.NewIcon(theme.FileImageIcon()),
		)

	}

	return objects
}

Device :

  • OS: Ubuntu 20.04
  • Go version: go1.15 linux/amd64
  • Fyne version: v1.3.3
@andydotxyz andydotxyz changed the title When FixedGridLayout and VScrollContainer are combined, items are displayed in a vertical row. Maximizing FixedGridLayout and VScrollContainer causes items to display in a vertical row. Aug 14, 2020
@andydotxyz
Copy link
Member

This looks like a duplicate of #1245

@andydotxyz andydotxyz added the duplicate This issue or pull request already exists label Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants