forked from qt-creator/qt-creator
implement "real" full screen mode
This commit is contained in:
@@ -120,6 +120,7 @@ const char * const EXIT = "QtCreator.Exit";
|
||||
|
||||
const char * const OPTIONS = "QtCreator.Options";
|
||||
const char * const TOGGLE_SIDEBAR = "QtCreator.ToggleSidebar";
|
||||
const char * const TOGGLE_FULLSCREEN = "QtCreator.ToggleFullScreen";
|
||||
|
||||
const char * const MINIMIZE_WINDOW = "QtCreator.MinimizeWindow";
|
||||
const char * const ZOOM_WINDOW = "QtCreator.ZoomWindow";
|
||||
@@ -187,6 +188,7 @@ const char * const G_WINDOW_NAVIGATE = "QtCreator.Group.Window.Navigate";
|
||||
const char * const G_WINDOW_NAVIGATE_GROUPS = "QtCreator.Group.Window.Navigate.Groups";
|
||||
const char * const G_WINDOW_OTHER = "QtCreator.Group.Window.Other";
|
||||
const char * const G_WINDOW_LIST = "QtCreator.Group.Window.List";
|
||||
const char * const G_WINDOW_FULLSCREEN = "QtCreator.Group.Window.Fullscreen";
|
||||
|
||||
// help groups (global)
|
||||
const char * const G_HELP_HELP = "QtCreator.Group.Help.Help";
|
||||
|
||||
@@ -143,6 +143,7 @@ MainWindow::MainWindow() :
|
||||
m_exitAction(0),
|
||||
m_optionsAction(0),
|
||||
m_toggleSideBarAction(0),
|
||||
m_toggleFullScreenAction(0),
|
||||
#ifdef Q_OS_MAC
|
||||
m_minimizeAction(0),
|
||||
m_zoomAction(0),
|
||||
@@ -448,7 +449,6 @@ void MainWindow::registerDefaultActions()
|
||||
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
|
||||
ActionContainer *mtools = am->actionContainer(Constants::M_TOOLS);
|
||||
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
|
||||
Q_UNUSED(mwindow)
|
||||
ActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
|
||||
|
||||
// File menu separators
|
||||
@@ -641,6 +641,17 @@ void MainWindow::registerDefaultActions()
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_PANES);
|
||||
m_toggleSideBarAction->setEnabled(false);
|
||||
|
||||
// Toggle Full Screen
|
||||
m_toggleFullScreenAction = new QAction(tr("Toggle Fullscreen"), this);
|
||||
m_toggleFullScreenAction->setCheckable(true);
|
||||
m_toggleFullScreenAction->setChecked(true);
|
||||
cmd = am->registerAction(m_toggleFullScreenAction,
|
||||
Constants::TOGGLE_FULLSCREEN, m_globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+Shift+F11"));
|
||||
mwindow->addAction(cmd, Constants::G_WINDOW_FULLSCREEN);
|
||||
connect(m_toggleFullScreenAction, SIGNAL(toggled(bool)),
|
||||
this, SLOT(setFullScreen(bool)));
|
||||
|
||||
//About IDE Action
|
||||
#ifdef Q_OS_MAC
|
||||
tmpaction = new QAction(tr("About &Qt Creator"), this); // it's convention not to add dots to the about menu
|
||||
@@ -1113,3 +1124,16 @@ QPrinter *MainWindow::printer() const
|
||||
m_printer = new QPrinter(QPrinter::HighResolution);
|
||||
return m_printer;
|
||||
}
|
||||
|
||||
void MainWindow::setFullScreen(bool on)
|
||||
{
|
||||
if (on) {
|
||||
setWindowState(windowState() | Qt::WindowFullScreen);
|
||||
//statusBar()->hide();
|
||||
//menuBar()->hide();
|
||||
} else {
|
||||
setWindowState(windowState() & ~Qt::WindowFullScreen);
|
||||
//menuBar()->show();
|
||||
//statusBar()->show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ public slots:
|
||||
void newFile();
|
||||
void openFileWith();
|
||||
void exit();
|
||||
void setFullScreen(bool on);
|
||||
|
||||
QStringList showNewItemDialog(const QString &title,
|
||||
const QList<IWizard *> &wizards,
|
||||
@@ -213,6 +214,7 @@ private:
|
||||
QAction *m_exitAction;
|
||||
QAction *m_optionsAction;
|
||||
QAction *m_toggleSideBarAction;
|
||||
QAction *m_toggleFullScreenAction;
|
||||
#ifdef Q_OS_MAC
|
||||
QAction *m_minimizeAction;
|
||||
QAction *m_zoomAction;
|
||||
|
||||
Reference in New Issue
Block a user