diff --git a/main.go b/main.go index c7e847c..be3517c 100644 --- a/main.go +++ b/main.go @@ -81,9 +81,11 @@ func main() { batteryLevel = widgets.NewQLineEdit(nil) batteryLevel.SetText(fmt.Sprintf("%+v", chargeStats.BatteryLevel)) batteryLevel.SetReadOnly(true) + batteryLevel.SetFixedWidth(30) batteryRange = widgets.NewQLineEdit(nil) batteryRange.SetText(fmt.Sprintf("%.2f%+v", chargeStats.BatteryRange, strings.Replace(guiSettings.GuiDistanceUnits, "/hr", "", -1))) + batteryRange.SetFixedWidth(10 * len(batteryRange.Text())) batteryRange.SetReadOnly(true) chargingState = widgets.NewQLineEdit(nil) chargingState.SetText(chargeStats.ChargingState) @@ -163,14 +165,21 @@ func main() { doorLockLabel := widgets.NewQLabel(nil, 0) sentryModeLabel := widgets.NewQLabel(nil, 0) + chargingStateLabel := widgets.NewQLabel(nil, 0) doorLockLabel.SetText("Lock Doors: ") sentryModeLabel.SetText("Sentry Mode: ") + chargingStateLabel.SetText("Charging: ") securityHbox := widgets.NewQHBoxLayout() securityHbox.AddWidget(lockedDoors, 0, 0) - securityHbox.AddItem(widgets.NewQSpacerItem(2, 2, widgets.QSizePolicy__Fixed, widgets.QSizePolicy__Fixed)) + securityHbox.AddItem(widgets.NewQSpacerItem(10, 10, widgets.QSizePolicy__Fixed, widgets.QSizePolicy__Fixed)) securityHbox.AddWidget(sentryModeLabel, 0, 0) securityHbox.AddWidget(sentryMode, 0, 0) + if chargeStats.ChargingState != "Disconnected" { + securityHbox.AddItem(widgets.NewQSpacerItem(10, 10, widgets.QSizePolicy__Fixed, widgets.QSizePolicy__Fixed)) + securityHbox.AddWidget(chargingStateLabel, 0, 0) + securityHbox.AddWidget(startStopCharge, 0, 0) + } statusLayout.AddRow2(doorLockLabel, securityHbox) honk = widgets.NewQPushButton(nil)