aboutsummaryrefslogtreecommitdiffstats
path: root/ui.go
diff options
context:
space:
mode:
authorsam-anthony <samanthony6@protonmail.com>2022-03-26 14:51:43 -0230
committersam-anthony <samanthony6@protonmail.com>2022-03-26 14:51:43 -0230
commit713b65d414e327db7b530ce0be8403bc0ff4ff3b (patch)
tree6e4a32fb43ca3e5b26d9cfb61c693ffd76391796 /ui.go
parent16235e23bda445f0bd0b664c3738c77e786a1cbf (diff)
downloadvolute-713b65d414e327db7b530ce0be8403bc0ff4ff3b.zip
engine displacement
Diffstat (limited to 'ui.go')
-rw-r--r--ui.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/ui.go b/ui.go
index 67f31ca..dd12b06 100644
--- a/ui.go
+++ b/ui.go
@@ -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"),