Skip to content

Add support for widget.Form.Orientation property#11

Merged
andydotxyz merged 2 commits into
fyne-io:mainfrom
sdassow:feature/add-more-properties
May 28, 2026
Merged

Add support for widget.Form.Orientation property#11
andydotxyz merged 2 commits into
fyne-io:mainfrom
sdassow:feature/add-more-properties

Conversation

@sdassow

@sdassow sdassow commented May 28, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks, just a couple of things

Comment thread internal/guidefs/widget.go Outdated
if o := c.Metadata()[obj]["Orientation"]; o != "" && o != "Horizontal" {
switch o {
case "Vertical":
fmt.Fprintf(str, ", Orientation: %v", widget.Vertical)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not print the number, but the developer friendly const.

I don't think this needs to be in a switch because you have ensured only these two could be set. Either that or the form code above could be simplified - I think this is duplicative

Comment thread go_test.go Outdated

return container.NewVBox(
&widget.Form{Items: []*widget.FormItem{widget.NewFormItem("Foo",
widget.NewEntry())}, OnSubmit: func() {}, OnCancel: func() {}, Orientation: 2})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should test for more readable code - not the raw int but the const representation, i.e. widget.Vertical).

@andydotxyz andydotxyz merged commit 7ab3b34 into fyne-io:main May 28, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants