Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable dock widget text eliding #1168

Merged
merged 2 commits into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions src/rviz/visualization_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <QLabel>
#include <QToolButton>
#include <QHBoxLayout>
#include <QTabBar>

#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
Expand Down Expand Up @@ -409,7 +410,7 @@ void VisualizationFrame::loadPersistentSettings()
last_config_dir_ = last_config_dir.toStdString();
last_image_dir_ = last_image_dir.toStdString();
}

Config recent_configs_list = config.mapGetChild( "Recent Configs" );
recent_configs_.clear();
int num_recent = recent_configs_list.listLength();
Expand Down Expand Up @@ -599,7 +600,11 @@ void VisualizationFrame::openNewPanelDialog()
manager_->stopUpdate();
if( dialog->exec() == QDialog::Accepted )
{
addPanelByName( display_name, class_id );
QDockWidget *dock = addPanelByName( display_name, class_id );
if ( dock )
{
connect( dock, SIGNAL( dockLocationChanged( Qt::DockWidgetArea )), this, SLOT( onDockPanelChange() ) );
}
}
manager_->startUpdate();
}
Expand Down Expand Up @@ -676,7 +681,7 @@ void VisualizationFrame::loadDisplayConfig( const QString& qpath )
std::string actual_load_path = path;
if( !fs::exists( path ) || fs::is_directory( path ) || fs::is_empty( path ))
{
actual_load_path = (fs::path(package_path_) / "default.rviz").BOOST_FILE_STRING();
actual_load_path = (fs::path(package_path_) / "default.rviz").BOOST_FILE_STRING();
if( !fs::exists( actual_load_path ))
{
ROS_ERROR( "Default display config '%s' not found. RViz will be very empty at first.", actual_load_path.c_str() );
Expand Down Expand Up @@ -808,7 +813,7 @@ void VisualizationFrame::loadWindowGeometry( const Config& config )
config.mapGetInt( "Height", &height ))
{
resize( width, height );
}
}

QString main_window_config;
if( config.mapGetString( "QMainWindow State", &main_window_config ))
Expand Down Expand Up @@ -886,6 +891,7 @@ void VisualizationFrame::loadPanels( const Config& config )
// qobject_cast.
if( dock )
{
connect(dock, SIGNAL( dockLocationChanged( Qt::DockWidgetArea )), this, SLOT( onDockPanelChange() ) );
Panel* panel = qobject_cast<Panel*>( dock->widget() );
if( panel )
{
Expand All @@ -894,6 +900,8 @@ void VisualizationFrame::loadPanels( const Config& config )
}
}
}

onDockPanelChange();
}

void VisualizationFrame::savePanels( Config config )
Expand Down Expand Up @@ -951,7 +959,7 @@ bool VisualizationFrame::prepareToExit()
default:
return false;
}

}
case QMessageBox::Discard:
return true;
Expand Down Expand Up @@ -1195,6 +1203,15 @@ void VisualizationFrame::onHelpAbout()
QMessageBox::about(QApplication::activeWindow(), "About", about_text);
}

void VisualizationFrame::onDockPanelChange()
{
QList<QTabBar *> tab_bars = findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly);
for ( QList<QTabBar *>::iterator it = tab_bars.begin(); it != tab_bars.end(); it++ )
{
(*it)->setElideMode( Qt::ElideNone );
}
}

QWidget* VisualizationFrame::getParentWindow()
{
return this;
Expand Down
5 changes: 3 additions & 2 deletions src/rviz/visualization_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Q_OBJECT
QString getErrorMessage() const { return error_message_; }

/** @brief Load the properties of all subsystems from the given Config.
*
*
* This is called by loadDisplayConfig().
*
* @param config Must have type Config::Map.
Expand Down Expand Up @@ -182,8 +182,9 @@ protected Q_SLOTS:
void openNewPanelDialog();
void openNewToolDialog();
void showHelpPanel();
void onDockPanelChange();

/** @brief Remove a the tool whose name is given by remove_tool_menu_action->text(). */
/** @brief Remove a the tool whose name is given by remove_tool_menu_action->text(). */
void onToolbarRemoveTool( QAction* remove_tool_menu_action );

/** @brief Looks up the Tool for this action and calls
Expand Down