Skip to content

Commit

Permalink
Add fullscreen startup option (#1097)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Erik Frivold <paulerikf@gmail.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
paulerikf and ahcorde authored Nov 29, 2023
1 parent e6475f3 commit d7b56b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
16 changes: 8 additions & 8 deletions rviz_common/include/rviz_common/visualization_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ public Q_SLOTS:
void
setStatus(const QString & message) override;

/// Set full screen mode.
void
setFullScreen(bool full_screen);

/// Exit full screen mode.
void
exitFullScreen();

Q_SIGNALS:
/// Emitted during file-loading and initialization to indicate progress.
void
Expand Down Expand Up @@ -332,14 +340,6 @@ protected Q_SLOTS:
void
onDeletePanel();

/// Set full screen mode.
void
setFullScreen(bool full_screen);

/// Exit full screen mode.
void
exitFullScreen();

/// Indicate that loading is done.
void
markLoadingDone();
Expand Down
12 changes: 11 additions & 1 deletion rviz_common/src/rviz_common/visualizer_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,18 @@ bool VisualizerApp::init(int argc, char ** argv)
"A custom splash-screen image to display", "splash_path");
parser.addOption(splash_screen_option);

QCommandLineOption fullscreen_option(
"fullscreen",
"Start RViz in fullscreen mode.");
parser.addOption(fullscreen_option);

QString display_config, fixed_frame, splash_path, help_path, display_title_format;
bool enable_ogre_log;
bool enable_ogre_log, fullscreen;

if (app_) {parser.process(*app_);}

enable_ogre_log = parser.isSet(ogre_log_option);
fullscreen = parser.isSet(fullscreen_option);

if (parser.isSet(display_config_option)) {
display_config = parser.value(display_config_option);
Expand Down Expand Up @@ -162,6 +168,10 @@ bool VisualizerApp::init(int argc, char ** argv)
frame_->getManager()->setFixedFrame(fixed_frame);
}

if (fullscreen) {
frame_->setFullScreen(true);
}

frame_->show();

return true;
Expand Down

0 comments on commit d7b56b8

Please sign in to comment.