diff options
| author | sam-anthony <samanthony6@protonmail.com> | 2022-03-26 14:51:43 -0230 |
|---|---|---|
| committer | sam-anthony <samanthony6@protonmail.com> | 2022-03-26 14:51:43 -0230 |
| commit | 713b65d414e327db7b530ce0be8403bc0ff4ff3b (patch) | |
| tree | 6e4a32fb43ca3e5b26d9cfb61c693ffd76391796 /ui.go | |
| parent | 16235e23bda445f0bd0b664c3738c77e786a1cbf (diff) | |
| download | volute-713b65d414e327db7b530ce0be8403bc0ff4ff3b.zip | |
engine displacement
Diffstat (limited to 'ui.go')
| -rw-r--r-- | ui.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -2,6 +2,28 @@ package main import g "github.com/AllenDang/giu" +func engineDisplacementRow() *g.RowWidget { + return g.Row( + g.Label("Engine Displacement"), + g.InputFloat(&displacement.val).Format("%.2f"), + g.Combo( + "", + volumeUnitStrings()[selectedVolumeUnit], + volumeUnitStrings(), + &selectedVolumeUnit, + ). + OnChange(func() { + s := volumeUnitStrings()[selectedVolumeUnit] + u, err := volumeUnitFromString(s) + check(err) + displacement = volume{ + displacement.asUnit(u), + u, + } + }), + ) +} + func engineSpeedRow() *g.TableRowWidget { return g.TableRow( g.Label("Engine Speed"), |