Skip to content

Commit

Permalink
tweak the layout
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Thienel <[email protected]>
  • Loading branch information
ftl committed Dec 30, 2024
1 parent 42e4859 commit c241f4d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions ui/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func buildLabeledEntry(grid *gtk.Grid, row int, labelText string, handler any) *

entry, _ := gtk.EntryNew()
entry.SetHExpand(true)
entry.SetSizeRequest(200, 0)
grid.Attach(entry, 1, row, 1, 1)

entry.Connect("changed", handler)
Expand All @@ -84,8 +85,6 @@ func buildLabeledTextView(grid *gtk.Grid, row int, labelText string, handler any
scrolledWindow.SetHExpand(true)
scrolledWindow.SetVExpand(true)
scrolledWindow.SetSizeRequest(0, 100)
scrolledWindow.SetMarginStart(5)
scrolledWindow.SetMarginEnd(5)
grid.Attach(scrolledWindow, 0, row+1, 1, 1)

buffer, _ := textView.GetBuffer()
Expand All @@ -97,6 +96,8 @@ func buildLabeledTextView(grid *gtk.Grid, row int, labelText string, handler any
func buildCheckButton(grid *gtk.Grid, row int, labelText string, handler any) *gtk.CheckButton {
checkButton, _ := gtk.CheckButtonNewWithLabel(labelText)
checkButton.SetHExpand(true)
checkButton.SetMarginTop(5)
checkButton.SetMarginBottom(5)
grid.Attach(checkButton, 0, row, 1, 1)

checkButton.Connect("toggled", handler)
Expand Down
14 changes: 9 additions & 5 deletions ui/exportCabrilloView.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ func newExportCabrilloView(controller ExportCabrilloController) *exportCabrilloV
result.root.SetVExpand(true)
result.root.SetColumnSpacing(5)
result.root.SetRowSpacing(5)
result.root.SetMarginStart(5)
result.root.SetMarginEnd(5)

columns, _ := gtk.GridNew()
columns.SetOrientation(gtk.ORIENTATION_HORIZONTAL)
columns.SetHExpand(true)
columns.SetVExpand(false)
columns.SetColumnSpacing(10)
columns.SetColumnSpacing(20)
result.root.Attach(columns, 0, 1, 1, 1)

leftColumn, _ := gtk.GridNew()
Expand Down Expand Up @@ -139,12 +141,14 @@ func newExportCabrilloView(controller ExportCabrilloController) *exportCabrilloV
result.clubEntry = buildLabeledEntry(rightColumn, 11, "Club", result.onClubChanged)
result.specificEntry = buildLabeledEntry(rightColumn, 12, "Specific", result.onSpecificChanged)

result.certificateCheckButton = buildCheckButton(result.root, 2, "Request a certificate", result.onCertificateToggled)
result.soapBoxEntry = buildLabeledTextView(result.root, 3, "Soap Box", result.onSoapBoxChanged)
buildSeparator(result.root, 2, 1)

buildSeparator(result.root, 5, 1)
result.certificateCheckButton = buildCheckButton(result.root, 3, "Request a certificate", result.onCertificateToggled)
result.soapBoxEntry = buildLabeledTextView(result.root, 4, "Soap Box", result.onSoapBoxChanged)

result.openAfterExportCheckButton = buildCheckButton(result.root, 6, "Open the file after export", result.onOpenAfterExportToggled)
buildSeparator(result.root, 6, 1)

result.openAfterExportCheckButton = buildCheckButton(result.root, 7, "Open the file after export", result.onOpenAfterExportToggled)

return result
}
Expand Down

0 comments on commit c241f4d

Please sign in to comment.