From 20d904412271307405cbc337c54ac39d3c5e4b98 Mon Sep 17 00:00:00 2001 From: PRP Date: Wed, 7 Feb 2024 08:33:29 +0100 Subject: [PATCH] updating to 2x2 version Signed-off-by: PRP --- .../include/nav2_rviz_plugins/selector.hpp | 4 +++- nav2_rviz_plugins/src/selector.cpp | 23 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/nav2_rviz_plugins/include/nav2_rviz_plugins/selector.hpp b/nav2_rviz_plugins/include/nav2_rviz_plugins/selector.hpp index a67f8bc16cf..19e93d77ccc 100644 --- a/nav2_rviz_plugins/include/nav2_rviz_plugins/selector.hpp +++ b/nav2_rviz_plugins/include/nav2_rviz_plugins/selector.hpp @@ -56,7 +56,9 @@ class Selector : public rviz_common::Panel bool plugins_loaded_ = false; QBasicTimer timer_; - QVBoxLayout * main_layout_; + QHBoxLayout * main_layout_; + QVBoxLayout * left_layout_; + QVBoxLayout * right_layout_; QComboBox * controller_; QComboBox * planner_; QComboBox * goal_checker_; diff --git a/nav2_rviz_plugins/src/selector.cpp b/nav2_rviz_plugins/src/selector.cpp index 613ee1aef19..deb3d011f8c 100644 --- a/nav2_rviz_plugins/src/selector.cpp +++ b/nav2_rviz_plugins/src/selector.cpp @@ -33,7 +33,9 @@ Selector::Selector(QWidget * parent) client_node_->create_publisher("goal_checker_selector", qos); pub_smoother_ = client_node_->create_publisher("smoother_selector", qos); - main_layout_ = new QVBoxLayout; + main_layout_ = new QHBoxLayout; + left_layout_ = new QVBoxLayout; + right_layout_ = new QVBoxLayout; controller_ = new QComboBox; planner_ = new QComboBox; goal_checker_ = new QComboBox; @@ -41,14 +43,17 @@ Selector::Selector(QWidget * parent) main_layout_->setContentsMargins(10, 10, 10, 10); - main_layout_->addWidget(new QLabel("Controller")); - main_layout_->addWidget(controller_); - main_layout_->addWidget(new QLabel("Planner")); - main_layout_->addWidget(planner_); - main_layout_->addWidget(new QLabel("Goal Checker")); - main_layout_->addWidget(goal_checker_); - main_layout_->addWidget(new QLabel("Smoother")); - main_layout_->addWidget(smoother_); + left_layout_->addWidget(new QLabel("Controller")); + left_layout_->addWidget(controller_); + left_layout_->addWidget(new QLabel("Planner")); + left_layout_->addWidget(planner_); + right_layout_->addWidget(new QLabel("Goal Checker")); + right_layout_->addWidget(goal_checker_); + right_layout_->addWidget(new QLabel("Smoother")); + right_layout_->addWidget(smoother_); + + main_layout_->addLayout(left_layout_); + main_layout_->addLayout(right_layout_); setLayout(main_layout_); timer_.start(200, this);