void App::toggleFullScreen() { showFullScreen = !showFullScreen; setFullScreen (showFullScreen); }
void App::resizeEvent(QResizeEvent *) { if (showFullScreen && (size() != qApp->desktop()->size())) setFullScreen (true); }
//slot to receive full screen toggle command void MainWindow::toggleFullScreen() { setFullScreen(!isFullScreen()); }
void MainWindow::escapeFullScreen() { if (isFullScreen()) setFullScreen(false); }
bool ResizableWindow::restoreWindowStateFromString (const String& s) { StringArray tokens; tokens.addTokens (s, false); tokens.removeEmptyStrings(); tokens.trim(); const bool fs = tokens[0].startsWithIgnoreCase ("fs"); const int firstCoord = fs ? 1 : 0; if (tokens.size() != firstCoord + 4) return false; Rectangle<int> newPos (tokens[firstCoord].getIntValue(), tokens[firstCoord + 1].getIntValue(), tokens[firstCoord + 2].getIntValue(), tokens[firstCoord + 3].getIntValue()); if (newPos.isEmpty()) return false; ComponentPeer* const peer = isOnDesktop() ? getPeer() : nullptr; if (peer != nullptr) peer->getFrameSize().addTo (newPos); { Desktop& desktop = Desktop::getInstance(); RectangleList<int> allMonitors (desktop.getDisplays().getRectangleList (true)); allMonitors.clipTo (newPos); const Rectangle<int> onScreenArea (allMonitors.getBounds()); if (onScreenArea.getWidth() * onScreenArea.getHeight() < 32 * 32) { const Rectangle<int> screen (desktop.getDisplays().getDisplayContaining (newPos.getCentre()).userArea); newPos.setSize (jmin (newPos.getWidth(), screen.getWidth()), jmin (newPos.getHeight(), screen.getHeight())); newPos.setPosition (jlimit (screen.getX(), screen.getRight() - newPos.getWidth(), newPos.getX()), jlimit (screen.getY(), screen.getBottom() - newPos.getHeight(), newPos.getY())); } } if (peer != nullptr) { peer->getFrameSize().subtractFrom (newPos); peer->setNonFullScreenBounds (newPos); } updateLastPosIfNotFullScreen(); if (fs) setBoundsConstrained (newPos); setFullScreen (fs); if (! fs) setBoundsConstrained (newPos); return true; }
Screen::~Screen() { //Make sure to disable fullscreen if we're in that mode. setFullScreen(false); delete mRecorder; }
void mouseDoubleClickEvent(QMouseEvent *e) { Phonon::VideoWidget::mouseDoubleClickEvent(e); setFullScreen(!isFullScreen()); }
void VideoWidget::exitFullScreen() { setFullScreen(false); }
void DocumentWindow::maximiseButtonPressed() { setFullScreen (! isFullScreen()); }
void SoulNote::on_action_Fullscreen_triggered(bool checked) { setFullScreen(checked); }
void VideoWidget::mouseDoubleClickEvent(QMouseEvent *event) { setFullScreen(!isFullScreen()); event->accept(); }
Player::Player(QWidget *parent) : QWidget(parent), ui(new Ui::Player) { std::cout << "Initialize player..." << std::endl; ui->setupUi(this); //Add MPlayer frame mplayer = new MPlayer; ui->playerLayout->setMargin(0); ui->playerLayout->addWidget(mplayer, 1); //enable autohiding toolbar mplayer->installEventFilter(this); mplayer->setMouseTracking(true); mplayer->getLayer()->installEventFilter(this); mplayer->getLayer()->setMouseTracking(true); ui->toolBar->installEventFilter(this); //move window ui->titleBar->installEventFilter(this); //Add Playlist playlist = new Playlist; ui->playerLayout->addWidget(playlist); playlist->installEventFilter(this); //Add Border topLeftBorder = new Border(this, Border::LEFT); topLeftBorder->setObjectName("topLeftBorder"); topRightBorder = new Border(this, Border::RIGHT); topRightBorder->setObjectName("topRightBorder"); ui->titleBarLayout->insertWidget(0, topLeftBorder); ui->titleBarLayout->addWidget(topRightBorder); leftBorder = new Border(this, Border::LEFT); leftBorder->setObjectName("leftBorder"); rightBorder = new Border(this, Border::RIGHT); rightBorder->setObjectName("rightBorder"); bottomBorder = new Border(this, Border::BOTTOM); bottomBorder->setObjectName("bottomBorder"); ui->playerLayout->insertWidget(0, leftBorder); ui->playerLayout->addWidget(rightBorder); ui->mainLayout->addWidget(bottomBorder); ui->pauseButton->hide(); ui->progressBar->hide(); playlist->hide(); //Add Cutterbar cutterbar = new CutterBar; int insertPos = ui->mainLayout->indexOf(ui->toolBar); ui->mainLayout->insertWidget(insertPos, cutterbar); cutterbar->hide(); mplayer->menu->addAction(tr("Cut video"), this, SLOT(showCutterbar()), QKeySequence("C")); //Add WebVideo webvideo = new WebVideo; reslibrary = new ResLibrary; webvideo->insertTab(0, reslibrary, tr("Resources")); webvideo->setCurrentIndex(0); //add downloader downloader = new Downloader; webvideo->addTab(downloader, tr("Downloader")); //add transformer transformer = new Transformer; //Settings Dialog settingsDialog = new SettingsDialog(this); //Add menu menu = new QMenu(tr("Player"), this); menu->addAction(tr("Online video"), webvideo, SLOT(show())); menu->addAction(tr("Transform video"), transformer, SLOT(show())); menu->addAction(tr("Settings"), this, SLOT(onSetButton())); menu->addSeparator(); menu->addAction(tr("Ext. for browser"), this, SLOT(openExtPage())); menu->addAction(tr("Homepage"), this, SLOT(openHomepage())); //Add time show timeShow = new QLabel(mplayer); timeShow->move(0, 0); timeShow->hide(); //Connect connect(ui->playButton, SIGNAL(clicked()), mplayer, SLOT(changeState())); connect(ui->pauseButton, SIGNAL(clicked()), mplayer, SLOT(changeState())); connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(onStopButton())); connect(ui->progressBar, SIGNAL(valueChanged(int)), this, SLOT(onPBarChanged(int))); connect(ui->progressBar, SIGNAL(sliderPressed()), this, SLOT(onPBarPressed())); connect(ui->progressBar, SIGNAL(sliderReleased()), this, SLOT(onPBarReleased())); connect(ui->volumeSlider, SIGNAL(valueChanged(int)), mplayer, SLOT(setVolume(int))); connect(ui->volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(onSaveVolume(int))); connect(ui->netButton, SIGNAL(clicked()), webvideo, SLOT(show())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); connect(ui->minButton, SIGNAL(clicked()), this, SLOT(showMinimized())); connect(ui->maxButton, SIGNAL(clicked()), this, SLOT(setMaxNormal())); connect(ui->menuButton, SIGNAL(clicked()), this, SLOT(showMenu())); connect(mplayer, SIGNAL(played()), this, SLOT(setIconToPause())); connect(mplayer, SIGNAL(paused()), this, SLOT(setIconToPlay())); connect(mplayer, SIGNAL(stopped()), this, SLOT(onStopped())); connect(mplayer, SIGNAL(timeChanged(int)), this, SLOT(onProgressChanged(int))); connect(mplayer, SIGNAL(lengthChanged(int)), this, SLOT(onLengthChanged(int))); connect(mplayer, SIGNAL(fullScreen()), this, SLOT(setFullScreen())); connect(mplayer, SIGNAL(sizeChanged(QSize&)), this, SLOT(onSizeChanged(QSize&))); connect(playlist, &Playlist::fileSelected, mplayer, &MPlayer::openFile); connect(playlist, SIGNAL(needPause(bool)), this, SLOT(onNeedPause(bool))); connect(downloader, SIGNAL(newPlay(const QString&,const QString&)), playlist, SLOT(addFileAndPlay(const QString&,const QString&))); connect(downloader, SIGNAL(newFile(const QString&,const QString&)), playlist, SLOT(addFile(const QString&,const QString&))); connect(cutterbar, SIGNAL(newFrame(int)), mplayer, SLOT(jumpTo(int))); connect(cutterbar, SIGNAL(finished()), cutterbar, SLOT(hide())); connect(cutterbar, SIGNAL(finished()), ui->toolBar, SLOT(show())); //Set skin setSkin(Settings::skinList[Settings::currentSkin]); //Set default volume ui->volumeSlider->setValue(Settings::volume); no_play_next = false; is_fullscreen = false; toolbar_visible = true; mouse_in_toolbar = false; progressbar_pressed = false; }
bool Player::eventFilter(QObject *obj, QEvent *e) { static QPoint windowPos, mousePos, dPos; static bool ctrl_pressed = false; //Move window if (obj == ui->titleBar) { QMouseEvent* me = static_cast<QMouseEvent*>(e); if (e->type() == QEvent::MouseButtonPress) { windowPos = pos(); mousePos = me->globalPos(); dPos = mousePos - windowPos; } else if (e->type() == QEvent::MouseMove) move(me->globalPos() - dPos); return false; } // Hide or show progressbar, toolbar and playlist else if (e->type() == QEvent::Enter && obj == ui->toolBar) { mouse_in_toolbar = true; ui->progressBar->show(); return true; } else if (e->type() == QEvent::Leave && obj == ui->toolBar) { mouse_in_toolbar = false; if (!progressbar_pressed) ui->progressBar->hide(); if (is_fullscreen) { ui->toolBar->hide(); toolbar_visible = false; } return true; } else if (e->type() == QEvent::Leave && obj == playlist) { playlist->hide(); return true; } else if (e->type() == QEvent::MouseMove) { QMouseEvent* me = static_cast<QMouseEvent*>(e); if (is_fullscreen && me->y() > toolbar_pos_y && !toolbar_visible) //mouse enters toolbar { ui->toolBar->show(); toolbar_visible = true; } else if (!is_fullscreen && me->x() > width() - 100) playlist->show(); return true; } //key pressed else if (e->type() == QEvent::KeyRelease) { QKeyEvent *ke = static_cast<QKeyEvent*>(e); if (ke->key() == Qt::Key_Control) { ctrl_pressed = false; return true; } return false; } else if (e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent*>(e); switch (ke->key()) { case Qt::Key_Control: ctrl_pressed = true; return true; case Qt::Key_S: mplayer->screenShot(); return true; case Qt::Key_C: showCutterbar(); return true; case Qt::Key_Return: setFullScreen(); return true; case Qt::Key_F3: if (!is_fullscreen) hidePlaylist(); return true; case Qt::Key_Space: mplayer->changeState(); return true; case Qt::Key_R: mplayer->speedSetToDefault(); return true; case Qt::Key_Left: if (ctrl_pressed) mplayer->speedDown(); else ui->progressBar->setValue(ui->progressBar->value() - 1); return true; case Qt::Key_Right: if (ctrl_pressed) mplayer->speedUp(); else ui->progressBar->setValue(ui->progressBar->value() + 1); return true; case Qt::Key_Up: ui->volumeSlider->setValue(ui->volumeSlider->value() + 1); return true; case Qt::Key_Down: ui->volumeSlider->setValue(ui->volumeSlider->value() - 1); return true; default:return false; } } return false; }
void App::focusInEvent (QFocusEvent *) { if (showFullScreen) setFullScreen(true); }
void GrlMedia::mouseDoubleClickEvent(QMouseEvent *event) { setFullScreen(!m_fullScreen); event->accept(); }
void GraphicsManager::toggleFullScreen() { setFullScreen(!_fullScreen); }
Player::Player(QWidget *parent) : QWidget(parent), ui(new Ui::Player) { std::cout << "Initialize player..." << std::endl; ui->setupUi(this); //Add MPlayer frame mplayer = new MPlayer; ui->playerLayout->setMargin(0); ui->playerLayout->addWidget(mplayer, 1); //enable autohiding toolbar mplayer->installEventFilter(this); mplayer->setMouseTracking(true); mplayer->getLayer()->installEventFilter(this); mplayer->getLayer()->setMouseTracking(true); ui->toolBar->installEventFilter(this); //move window ui->titleBar->installEventFilter(this); //Add Playlist playlist = new Playlist; ui->playerLayout->addWidget(playlist); //Add Border topLeftBorder = new Border(this, Border::LEFT); topLeftBorder->setObjectName("topLeftBorder"); topRightBorder = new Border(this, Border::RIGHT); topRightBorder->setObjectName("topRightBorder"); ui->titleBarLayout->insertWidget(0, topLeftBorder); ui->titleBarLayout->addWidget(topRightBorder); leftBorder = new Border(this, Border::LEFT); leftBorder->setObjectName("leftBorder"); rightBorder = new Border(this, Border::RIGHT); rightBorder->setObjectName("rightBorder"); bottomBorder = new Border(this, Border::BOTTOM); bottomBorder->setObjectName("bottomBorder"); ui->playerLayout->insertWidget(0, leftBorder); ui->playerLayout->addWidget(rightBorder); ui->mainLayout->addWidget(bottomBorder); //Add WebVideo webvideo = new WebVideo; //add downloader downloader = new Downloader; webvideo->addTab(downloader, tr("Downloader")); //add transformer transformer = new Transformer; //Add menu menubar = new QMenuBar; menu = menubar->addMenu(tr("Player")); menu->addAction(tr("Online video"), webvideo, SLOT(show())); menu->addAction(tr("Transform video"), transformer, SLOT(show())); menu->addAction(tr("Settings"), this, SLOT(onSetButton())); menu->addSeparator(); menu->addAction(tr("Homepage"), this, SLOT(openHomepage())); ui->mainLayout->insertWidget(0, menubar); //Add time show timeShow = new QLabel(mplayer); timeShow->move(0, 0); timeShow->hide(); //Connect connect(ui->playButton, SIGNAL(clicked()), mplayer, SLOT(changeState())); connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(onStopButton())); connect(ui->progressBar, SIGNAL(valueChanged(int)), this, SLOT(onPBarChanged(int))); connect(ui->progressBar, SIGNAL(sliderPressed()), this, SLOT(onPBarPressed())); connect(ui->progressBar, SIGNAL(sliderReleased()), this, SLOT(onPBarReleased())); connect(ui->volumeSlider, SIGNAL(valueChanged(int)), mplayer, SLOT(setVolume(int))); connect(ui->hideButton, SIGNAL(clicked()), this, SLOT(hidePlaylist())); connect(ui->netButton, SIGNAL(clicked()), webvideo, SLOT(show())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); connect(ui->minButton, SIGNAL(clicked()), this, SLOT(showMinimized())); connect(ui->maxButton, SIGNAL(clicked()), this, SLOT(setMaxNormal())); connect(ui->menuButton, SIGNAL(clicked()), this, SLOT(showMenu())); connect(mplayer, SIGNAL(played()), this, SLOT(setIconToPause())); connect(mplayer, SIGNAL(paused()), this, SLOT(setIconToPlay())); connect(mplayer, SIGNAL(stopped()), this, SLOT(onStopped())); connect(mplayer, SIGNAL(timeChanged(int)), this, SLOT(onProgressChanged(int))); connect(mplayer, SIGNAL(lengthChanged(int)), this, SLOT(onLengthChanged(int))); connect(mplayer, SIGNAL(fullScreen()), this, SLOT(setFullScreen())); connect(mplayer, SIGNAL(sizeChanged(QSize&)), this, SLOT(onSizeChanged(QSize&))); connect(playlist, SIGNAL(fileSelected(const QString&)), mplayer, SLOT(openFile(const QString&))); connect(playlist, SIGNAL(needPause(bool)), this, SLOT(onNeedPause(bool))); connect(downloader, SIGNAL(newPlay(const QString&,const QString&)), playlist, SLOT(addFileAndPlay(const QString&,const QString&))); connect(downloader, SIGNAL(newFile(const QString&,const QString&)), playlist, SLOT(addFile(const QString&,const QString&))); //Set skin if (Settings::useSkin) setSkin(Settings::skinList[Settings::currentSkin]); else setNoSkin(); no_play_next = false; is_fullscreen = false; }
void VideoWidget::enterFullScreen() { setFullScreen(true); }
void StelMainView::init(QSettings* conf) { gui = new StelGui(); #if STEL_USE_NEW_OPENGL_WIDGETS //glWidget->initializeGL(); // protected... //Q_ASSERT(glWidget->isValid()); #else Q_ASSERT(glWidget->isValid()); glWidget->makeCurrent(); #endif // Should be check of requirements disabled? if (conf->value("main/check_requirements", true).toBool()) { // Find out lots of debug info about supported version of OpenGL and vendor/renderer. processOpenGLdiagnosticsAndWarnings(conf, glWidget); } stelApp= new StelApp(); stelApp->setGui(gui); stelApp->init(conf); StelActionMgr *actionMgr = stelApp->getStelActionManager(); actionMgr->addAction("actionSave_Screenshot_Global", N_("Miscellaneous"), N_("Save screenshot"), this, "saveScreenShot()", "Ctrl+S"); actionMgr->addAction("actionSet_Full_Screen_Global", N_("Display Options"), N_("Full-screen mode"), this, "fullScreen", "F11"); StelPainter::initGLShaders(); skyItem = new StelSkyItem(); guiItem = new StelGuiItem(); QGraphicsAnchorLayout* l = new QGraphicsAnchorLayout(rootItem); l->setSpacing(0); l->setContentsMargins(0,0,0,0); l->addCornerAnchors(skyItem, Qt::TopLeftCorner, l, Qt::TopLeftCorner); l->addCornerAnchors(skyItem, Qt::BottomRightCorner, l, Qt::BottomRightCorner); l->addCornerAnchors(guiItem, Qt::BottomLeftCorner, l, Qt::BottomLeftCorner); l->addCornerAnchors(guiItem, Qt::TopRightCorner, l, Qt::TopRightCorner); rootItem->setLayout(l); scene()->addItem(rootItem); nightModeEffect = new NightModeGraphicsEffect(this); updateNightModeProperty(); rootItem->setGraphicsEffect(nightModeEffect); QSize size = glWidget->windowHandle()->screen()->size(); size = QSize(conf->value("video/screen_w", size.width()).toInt(), conf->value("video/screen_h", size.height()).toInt()); bool fullscreen = conf->value("video/fullscreen", true).toBool(); // Without this, the screen is not shown on a Mac + we should use resize() for correct work of fullscreen/windowed mode switch. --AW WTF??? resize(size); QDesktopWidget *desktop = QApplication::desktop(); int screen = conf->value("video/screen_number", 0).toInt(); if (screen < 0 || screen >= desktop->screenCount()) { qWarning() << "WARNING: screen" << screen << "not found"; screen = 0; } QRect screenGeom = desktop->screenGeometry(screen); if (fullscreen) { // The "+1" below is to work around Linux/Gnome problem with mouse focus. move(screenGeom.x()+1, screenGeom.y()+1); // The fullscreen window appears on screen where is the majority of // the normal window. Therefore we crop the normal window to the // screen area to ensure that the majority is not on another screen. setGeometry(geometry() & screenGeom); setFullScreen(true); } else { setFullScreen(false); int x = conf->value("video/screen_x", 0).toInt(); int y = conf->value("video/screen_y", 0).toInt(); move(x + screenGeom.x(), y + screenGeom.y()); } flagInvertScreenShotColors = conf->value("main/invert_screenshots_colors", false).toBool(); setFlagCursorTimeout(conf->value("gui/flag_mouse_cursor_timeout", false).toBool()); setCursorTimeout(conf->value("gui/mouse_cursor_timeout", 10.f).toFloat()); maxfps = conf->value("video/maximum_fps",10000.f).toFloat(); minfps = conf->value("video/minimum_fps",10000.f).toFloat(); flagMaxFpsUpdatePending = false; // XXX: This should be done in StelApp::init(), unfortunately for the moment we need init the gui before the // plugins, because the gui create the QActions needed by some plugins. StelApp::getInstance().initPlugIns(); // activate DE430/431 StelApp::getInstance().getCore()->initEphemeridesFunctions(); // The script manager can only be fully initialized after the plugins have loaded. StelApp::getInstance().initScriptMgr(); // Set the global stylesheet, this is only useful for the tooltips. StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui!=NULL) setStyleSheet(gui->getStelStyle().qtStyleSheet); connect(&StelApp::getInstance(), SIGNAL(visionNightModeChanged(bool)), this, SLOT(updateNightModeProperty())); QThread::currentThread()->setPriority(QThread::HighestPriority); startMainLoop(); }
void WindowsManager::toggleFullScreen() { m_fullScreen = ! m_fullScreen; setFullScreen(m_fullScreen); }
bool MainWindow::toggleFullScreen() { setFullScreen(!fsc->mb_fullscreen); return fsc->mb_fullscreen; }