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) { ...@@ -131,26 +131,26 @@ void MapApp::refreshVehicleLabels(const DrawableVehicle &vehicle) {
laneLabel->set_text(vehicle.getLaneName()); laneLabel->set_text(vehicle.getLaneName());
std::ostringstream lanePisitionPercentageBuffer; std::ostringstream lanePisitionPercentageBuffer;
lanePisitionPercentageBuffer << std::setfill('0') << std::setw(2) lanePisitionPercentageBuffer
<< std::round(vehicle.getPositionOnLane() * 100); << std::setw(3) << std::round(vehicle.getPositionOnLane() * 100) << " %";
lanePositionPercentageLabel->set_text(lanePisitionPercentageBuffer.str()); lanePositionPercentageLabel->set_text(lanePisitionPercentageBuffer.str());
std::ostringstream speedBuffer; std::ostringstream speedBuffer;
speedBuffer << std::setprecision(3) << vehicle.getSpeed(); speedBuffer << std::fixed << std::setprecision(1) << vehicle.getSpeed()
<< " km/h";
speedLabel->set_text(speedBuffer.str()); speedLabel->set_text(speedBuffer.str());
std::ostringstream remainingFuelBuffer; std::ostringstream remainingFuelBuffer;
remainingFuelBuffer << std::showpoint << std::setprecision(3) remainingFuelBuffer << std::fixed << std::setprecision(1)
<< vehicle.getRemainingFuel(); << vehicle.getRemainingFuel() << " l";
remainingFuelLabel->set_text(remainingFuelBuffer.str()); remainingFuelLabel->set_text(remainingFuelBuffer.str());
} }
void MapApp::setTimeLabel(const std::chrono::minutes minutes) { void MapApp::setTimeLabel(const std::chrono::minutes minutes) {
std::ostringstream timeBuffer; std::ostringstream timeBuffer;
timeBuffer timeBuffer << std::setfill('0') << std::setw(2)
<< std::setfill('0') << std::setw(2) << std::chrono::duration_cast<std::chrono::hours>(minutes).count()
<< std::chrono::duration_cast<std::chrono::hours>(minutes).count() << ':' << ':' << std::setw(2) << minutes.count() % 60;
<< std::setw(2) << minutes.count() % 60;
Glib::signal_idle().connect_once( Glib::signal_idle().connect_once(
[this, timeString = timeBuffer.str()]() mutable { [this, timeString = timeBuffer.str()]() mutable {
timeLabel->set_text(std::move(timeString)); 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