Commit 4fd021f2 authored by Martin Kröning's avatar Martin Kröning

Rework interface

Move the infoBox to the left
parent a0e73151
This diff is collapsed.
......@@ -131,26 +131,26 @@ void MapApp::refreshVehicleLabels(const DrawableVehicle &vehicle) {
laneLabel->set_text(vehicle.getLaneName());
std::ostringstream lanePisitionPercentageBuffer;
lanePisitionPercentageBuffer << std::setfill('0') << std::setw(2)
<< std::round(vehicle.getPositionOnLane() * 100);
lanePisitionPercentageBuffer
<< std::setw(3) << std::round(vehicle.getPositionOnLane() * 100) << " %";
lanePositionPercentageLabel->set_text(lanePisitionPercentageBuffer.str());
std::ostringstream speedBuffer;
speedBuffer << std::setprecision(3) << vehicle.getSpeed();
speedBuffer << std::fixed << std::setprecision(1) << vehicle.getSpeed()
<< " km/h";
speedLabel->set_text(speedBuffer.str());
std::ostringstream remainingFuelBuffer;
remainingFuelBuffer << std::showpoint << std::setprecision(3)
<< vehicle.getRemainingFuel();
remainingFuelBuffer << std::fixed << std::setprecision(1)
<< vehicle.getRemainingFuel() << " l";
remainingFuelLabel->set_text(remainingFuelBuffer.str());
}
void MapApp::setTimeLabel(const std::chrono::minutes minutes) {
std::ostringstream timeBuffer;
timeBuffer
<< std::setfill('0') << std::setw(2)
<< std::chrono::duration_cast<std::chrono::hours>(minutes).count() << ':'
<< std::setw(2) << minutes.count() % 60;
timeBuffer << std::setfill('0') << std::setw(2)
<< std::chrono::duration_cast<std::chrono::hours>(minutes).count()
<< ':' << std::setw(2) << minutes.count() % 60;
Glib::signal_idle().connect_once(
[this, timeString = timeBuffer.str()]() mutable {
timeLabel->set_text(std::move(timeString));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment