Set "ft" as default unit for altitude formatter

See https://discordapp.com/channels/539048679160676382/539486489977946112/692158405145788437
This commit is contained in:
Klaus Basan
2020-03-25 16:18:18 +01:00
committed by Mat Sutcliffe
parent 605ccdbaa8
commit 82f7771882
2 changed files with 17 additions and 3 deletions

View File

@@ -350,10 +350,17 @@ namespace BlackGui
//! Constructor
CAltitudeFormatter(bool flightlevel = false, int alignment = alignRightVCenter(), bool i18n = true) : CDefaultFormatter(alignment, i18n), m_flightLevel(flightlevel) {}
//! Constructor
CAltitudeFormatter(const BlackMisc::PhysicalQuantities::CLengthUnit &unit, bool flightlevel = false, int alignment = alignRightVCenter(), bool i18n = true) : CDefaultFormatter(alignment, i18n), m_unit(unit), m_flightLevel(flightlevel) {}
//! Set the unit, normally ft/m
void setUnit(const BlackMisc::PhysicalQuantities::CLengthUnit &unit);
//! \copydoc CDefaultFormatter::displayRole
virtual BlackMisc::CVariant displayRole(const BlackMisc::CVariant &altitude) const override;
private:
BlackMisc::PhysicalQuantities::CLengthUnit m_unit = BlackMisc::PhysicalQuantities::CLengthUnit::ft();
const bool m_flightLevel = false;
};