From 1f8a63af7e43d28acaf410ea3df5c06f5dd9f76e Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 22 Jun 2021 13:24:11 +0200 Subject: [PATCH] nav: give word wrapped widgets a fixed width old-commit-hash: a5112bfb2e40749e467a405128b7305110e4344c --- selfdrive/ui/qt/maps/map.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index 20f7031c76..d74e753d90 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -483,8 +483,6 @@ MapInstructions::MapInstructions(QWidget * parent) : QWidget(parent) { lane_layout = new QHBoxLayout; layout->addLayout(lane_layout); - layout->addStretch(); // Make sure the word-wrapped labels are as small as possible - main_layout->addWidget(w); } @@ -551,6 +549,10 @@ void MapInstructions::updateInstructions(QMap banner, bool fu // the size can only be changed afterwards adjustSize(); + // Word wrap widgets neet fixed width + primary->setFixedWidth(width() - 250); + secondary->setFixedWidth(width() - 250); + if (banner == last_banner) return; QString primary_str, secondary_str;