fyne-io / developer.fyne.io

Fyne developer documentation website

Home Page:https://developer.fyne.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Form demo broken, just one column is rendered ( turns out the fg color is white and the default background is white too )

manuel-koch opened this issue · comments

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

I wanted to try out fyne and used the form example from here.

Building and running it gives me this UI, where I can only see the first column of the form, see screenshot.

How to reproduce

  1. build example code
  2. run it
  3. only one column gets rendered
  4. resizing or moving the app window doesn't help
  5. inspecting the code it looks like a bad combination of default background color and label foreground color - both seem to be white, making the rendered values invisible !
  6. Fixing the colors ( color.RGBA{0xff, 0, 0, 0xff} instead of color.White ) in the code still renders odd form layout, rows doesn't seem to get aligned vertically.

Screenshots

With the white background/foreground
form_example_renders_only_one_column

With other foreground, still rendered odd:
form_example_colors_fixed_still_wrong_layout

Example code

Copy from the example page:

package main

import (
	"image/color"

	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Form Layout")

	label1 := canvas.NewText("Label 1", color.Black)
	value1 := canvas.NewText("Value", color.White)
	label2 := canvas.NewText("Label 2", color.Black)
	value2 := canvas.NewText("Something", color.White)
	grid := container.New(layout.NewFormLayout(), label1, value1, label2, value2)
	myWindow.SetContent(grid)
	myWindow.ShowAndRun()
}

Fyne version

fyne.io/fyne/v2 v2.2.3

Go compiler version

go version go1.19.2 darwin/arm64

Operating system

macOS

Operating system version

MacOS Monterey 12.6 (Apple M1 Pro)

Additional Information

No response

Moved to correct repo