Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
57a091ac
Commit
57a091ac
authored
Jan 19, 2009
by
hjk
Browse files
try to act on system's maximization attempts to toggle fullscreen mode
parent
ed94fcd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/mainwindow.cpp
View file @
57a091ac
...
...
@@ -641,16 +641,18 @@ void MainWindow::registerDefaultActions()
mwindow
->
addAction
(
cmd
,
Constants
::
G_WINDOW_PANES
);
m_toggleSideBarAction
->
setEnabled
(
false
);
#if !defined(Q_OS_MAC)
// Toggle Full Screen
m_toggleFullScreenAction
=
new
QAction
(
tr
(
"Toggle Fullscreen"
),
this
);
m_toggleFullScreenAction
->
setCheckable
(
true
);
m_toggleFullScreenAction
->
setChecked
(
tru
e
);
m_toggleFullScreenAction
->
setChecked
(
fals
e
);
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
(
t
oggl
ed
(
bool
)),
mwindow
->
addAction
(
cmd
,
Constants
::
G_WINDOW_
SIZE
);
connect
(
m_toggleFullScreenAction
,
SIGNAL
(
t
rigger
ed
(
bool
)),
this
,
SLOT
(
setFullScreen
(
bool
)));
#endif
//About IDE Action
#ifdef Q_OS_MAC
...
...
@@ -928,13 +930,18 @@ void MainWindow::changeEvent(QEvent *e)
qDebug
()
<<
"main window activated"
;
emit
windowActivated
();
}
#ifdef Q_OS_MAC
}
else
if
(
e
->
type
()
==
QEvent
::
WindowStateChange
)
{
#ifdef Q_OS_MAC
bool
minimized
=
isMinimized
();
if
(
debugMainWindow
)
qDebug
()
<<
"main window state changed to minimized="
<<
minimized
;
m_minimizeAction
->
setEnabled
(
!
minimized
);
m_zoomAction
->
setEnabled
(
!
minimized
);
#else
QWindowStateChangeEvent
*
ev
=
static_cast
<
QWindowStateChangeEvent
*>
(
e
);
bool
isFullScreen
=
(
ev
->
oldState
()
&
Qt
::
WindowFullScreen
)
!=
0
;
m_toggleFullScreenAction
->
setChecked
(
!
isFullScreen
);
#endif
}
}
...
...
@@ -1127,6 +1134,9 @@ QPrinter *MainWindow::printer() const
void
MainWindow
::
setFullScreen
(
bool
on
)
{
if
(
bool
(
windowState
()
&
Qt
::
WindowFullScreen
)
==
on
)
return
;
if
(
on
)
{
setWindowState
(
windowState
()
|
Qt
::
WindowFullScreen
);
//statusBar()->hide();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment