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

Add fullscreen startup option #1097

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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);
paulerikf marked this conversation as resolved.
Show resolved Hide resolved

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