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

layout.formLayout render canvas.Text as labels and values outside/off minSize area #5163

Open
2 tasks done
chran554 opened this issue Sep 26, 2024 · 2 comments
Open
2 tasks done
Labels
good first issue Good for newcomers Hacktoberfest Issues that count towards Hacktoberfest scores.

Comments

@chran554
Copy link

chran554 commented Sep 26, 2024

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

When adding canvas.Text to a layout.formLayout as both label and value.
The texts seem to be rendered outside/off min size area or the form layout do not report minSize properly according to the text content with padding.

How to reproduce

  1. Add canvas.Text to a layout.formLayout as both labels and values for two rows
  2. Add the form layout in a container so it is minimized in size (to minSize).
  3. Observe that formlayout text seem to be rendered oustide/off min size area or do not report minSize properly according to text content.

Screenshots

image

Example code

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
	"image/color"
)

func main() {
	application := app.New()
	window := application.NewWindow("Test FormLayout with Text")
	window.Resize(fyne.NewSize(400, 200))

	form := container.New(layout.NewFormLayout(),
		canvas.NewText("Label 1", color.White), canvas.NewText("Value 1", color.White),
		canvas.NewText("Label 2", color.White), canvas.NewText("Value 2", color.White),
	)

	background := canvas.NewRectangle(color.NRGBA{255, 128, 128, 128})
	background.StrokeWidth = 1
	background.StrokeColor = color.White

	content := container.NewStack(background, form)
	window.SetContent(container.NewBorder(nil, nil, container.NewBorder(content, nil, nil, nil), nil))
	window.ShowAndRun()
}

Fyne version

fyne cli version: v2.4.4, fyne.io/fyne/v2 v2.5.1

Go compiler version

go version go1.22.5 darwin/arm64

Operating system and version

macOS Sonoma 14.6.1 (23G93)

Additional Information

No response

@chran554 chran554 added the unverified A bug that has been reported but not verified label Sep 26, 2024
@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Sep 30, 2024
@andydotxyz andydotxyz added good first issue Good for newcomers Hacktoberfest Issues that count towards Hacktoberfest scores. and removed unverified A bug that has been reported but not verified labels Sep 30, 2024
@ApoorvaLandge
Copy link

@andydotxyz can i work on this?

@andydotxyz
Copy link
Member

andydotxyz commented Oct 5, 2024

Yes of course - when there is no person already assigned you should just feel free to dig in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Hacktoberfest Issues that count towards Hacktoberfest scores.
Projects
None yet
Development

No branches or pull requests

3 participants