MCPcopy Create free account
hub / github.com/MITK/MITK / onFullScreen

Method onFullScreen

Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp:1276–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1274}
1275
1276void QmitkExtWorkbenchWindowAdvisorHack::onFullScreen()
1277{
1278 auto window = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow();
1279 auto* mainWindow = qobject_cast<QMainWindow*>(window->GetShell()->GetControl());
1280 if (nullptr == mainWindow)
1281 return;
1282
1283#ifdef __APPLE__
1284 mainWindow->isFullScreen() ? mainWindow->showNormal() : mainWindow->showFullScreen();
1285#else
1286 // Toggle borderless full-screen. See SetBorderlessFullScreen for why true
1287 // full-screen is avoided off macOS. The original flags are saved so the
1288 // decorations can be restored on exit.
1289 if (mainWindow->property("mitkBorderlessFullScreen").toBool())
1290 {
1291 mainWindow->setProperty("mitkBorderlessFullScreen", false);
1292 mainWindow->setWindowFlags(Qt::WindowFlags(mainWindow->property("mitkWindowedFlags").toInt()));
1293 mainWindow->setGeometry(mainWindow->property("mitkWindowedGeometry").toRect());
1294 }
1295 else
1296 {
1297 mainWindow->setProperty("mitkBorderlessFullScreen", true);
1298 mainWindow->setProperty("mitkWindowedFlags", static_cast<int>(mainWindow->windowFlags()));
1299 mainWindow->setProperty("mitkWindowedGeometry", mainWindow->geometry());
1300 SetBorderlessFullScreen(mainWindow);
1301 }
1302
1303 mainWindow->show(); // setWindowFlags() hides the window
1304#endif
1305}
1306
1307void QmitkExtWorkbenchWindowAdvisorHack::onIntro()
1308{

Callers

nothing calls this directly

Calls 6

SetBorderlessFullScreenFunction · 0.85
setPropertyMethod · 0.80
showMethod · 0.80
GetControlMethod · 0.45
GetShellMethod · 0.45

Tested by

no test coverage detected