mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Ctrl-Cmd-F *toggles* fullscreen
Previous commit only cancelled fullscreen mode when Ctrl-Cmd-F is pressed, but the common usage is for the key sequence to toggle fullscreen on and off.
This commit is contained in:
@@ -36,16 +36,24 @@ LionFullScreen::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj != main) return false;
|
||||
|
||||
// Ctrl-Cmd-F toggles
|
||||
if (event->type() == QEvent::KeyPress &&
|
||||
(static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape ||
|
||||
(static_cast<QKeyEvent *>(event)->key() == Qt::Key_F &&
|
||||
static_cast<QKeyEvent *>(event)->modifiers() == (Qt::MetaModifier|Qt::ControlModifier)))) {
|
||||
static_cast<QKeyEvent *>(event)->key() == Qt::Key_F &&
|
||||
static_cast<QKeyEvent *>(event)->modifiers() == (Qt::MetaModifier|Qt::ControlModifier)) {
|
||||
toggle();
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
// ESC cancels fullscreen
|
||||
if (event->type() == QEvent::KeyPress && static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) {
|
||||
|
||||
// if in full screen then toggle, otherwise do nothing
|
||||
NSView *nsview = (NSView *) main->winId();
|
||||
NSWindow *nswindow = [nsview window];
|
||||
NSUInteger masks = [nswindow styleMask];
|
||||
if (masks & NSFullScreenWindowMask) toggle();
|
||||
return false;
|
||||
}
|
||||
|
||||
return false; // always pass thru, just in case
|
||||
|
||||
Reference in New Issue
Block a user