Skip to content

Commit 5501540

Browse files
David Gossowhershwg
David Gossow
authored andcommitted
Save hide left/right dock state from VisFrame
1 parent 87ebc6a commit 5501540

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/rviz/panel_dock_widget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ PanelDockWidget::PanelDockWidget( const QString& name )
5959
connect( close_button, SIGNAL( clicked() ), this, SLOT(close()) );
6060

6161
QLabel *title_label = new QLabel( name, this );
62-
icon_label_ = new QLabel( name, this );
62+
icon_label_ = new QLabel( "", this );
6363

6464
QHBoxLayout *title_layout = new QHBoxLayout();
6565
title_layout->setContentsMargins(2,2,2,2);

src/rviz/visualization_frame.cpp

+12-3
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ void VisualizationFrame::initialize(const QString& display_config_file )
289289

290290
manager_->initialize();
291291

292+
hideLeftDock(false);
293+
hideRightDock(false);
294+
292295
if( display_config_file != "" )
293296
{
294297
loadDisplayConfig( display_config_file );
@@ -311,9 +314,6 @@ void VisualizationFrame::initialize(const QString& display_config_file )
311314
setCorner( Qt::TopRightCorner, Qt::RightDockWidgetArea );
312315
setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
313316
setCorner( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
314-
315-
hideLeftDock(false);
316-
hideRightDock(false);
317317
}
318318

319319
void VisualizationFrame::initConfigs()
@@ -726,6 +726,12 @@ void VisualizationFrame::loadWindowGeometry( const Config& config )
726726
{
727727
restoreState( QByteArray::fromHex( qPrintable( main_window_config )));
728728
}
729+
730+
bool b;
731+
config.mapGetBool( "Hide Left Dock", &b );
732+
hide_left_dock_button_->setChecked( b );
733+
config.mapGetBool( "Hide Right Dock", &b );
734+
hide_right_dock_button_->setChecked( b );
729735
}
730736

731737
void VisualizationFrame::saveWindowGeometry( Config config )
@@ -738,6 +744,9 @@ void VisualizationFrame::saveWindowGeometry( Config config )
738744

739745
QByteArray window_state = saveState().toHex();
740746
config.mapSetValue( "QMainWindow State", window_state.constData() );
747+
748+
config.mapSetValue( "Hide Left Dock", hide_left_dock_button_->isChecked() );
749+
config.mapSetValue( "Hide Right Dock", hide_right_dock_button_->isChecked() );
741750
}
742751

743752
void VisualizationFrame::loadPanels( const Config& config )

0 commit comments

Comments
 (0)