Skip to content

Commit

Permalink
Fix some missing uses of labelWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed May 1, 2024
1 parent dc53e33 commit e26a12c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions layout/formlayout.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ func (f *formLayout) tableCellsSize(objects []fyne.CanvasObject, containerWidth
}

contentCellMaxWidth = fyne.Max(contentCellMaxWidth, containerWidth-labelCellMaxWidth-padding)
for row := 0; row < rows; row++ {
table[row][0].Width = labelCellMaxWidth
table[row][1].Width = contentCellMaxWidth
}

return labelCellMaxWidth, contentCellMaxWidth, table
}

Expand Down Expand Up @@ -111,10 +106,10 @@ func (f *formLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {

if i+1 < len(objects) {
if _, ok := objects[i+1].(*canvas.Text); ok {
objects[i+1].Move(fyne.NewPos(padding+tableRow[0].Width+innerPadding, y+innerPadding))
objects[i+1].Move(fyne.NewPos(padding+labelWidth+innerPadding, y+innerPadding))
objects[i+1].Resize(fyne.NewSize(contentWidth-innerPadding*2, objects[i+1].MinSize().Height))
} else {
objects[i+1].Move(fyne.NewPos(padding+tableRow[0].Width, y))
objects[i+1].Move(fyne.NewPos(padding+labelWidth, y))
objects[i+1].Resize(fyne.NewSize(contentWidth, tableRow[0].Height))
}
}
Expand Down

0 comments on commit e26a12c

Please sign in to comment.