1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #4141

Yuri (1):
      feat(shortcut): Implemented F11 shortcut for toggling fullscreen.
This commit is contained in:
sudden6 2017-02-09 16:35:15 +01:00
commit 1e7fc8cc52
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
3 changed files with 14 additions and 0 deletions

View File

@ -415,6 +415,7 @@ The following shortcuts are currently supported:
| `CTRL` + `TAB` | Switch to the next contact |
| `CTRL` + `SHIFT` + `TAB` | Switch to the previous contact|
| `ALT` + `q` | Quote selected text |
| `F11` | Toggle fullscreen mode |
## Emoji Packs

View File

@ -261,6 +261,7 @@ void Widget::init()
new QShortcut(Qt::CTRL + Qt::Key_Tab, this, SLOT(nextContact()));
new QShortcut(Qt::CTRL + Qt::Key_PageUp, this, SLOT(previousContact()));
new QShortcut(Qt::CTRL + Qt::Key_PageDown, this, SLOT(nextContact()));
new QShortcut(Qt::Key_F11, this, SLOT(toggleFullscreen()));
#ifdef Q_OS_MAC
QMenuBar* globalMenu = Nexus::getInstance().globalMenuBar;
@ -1576,6 +1577,17 @@ void Widget::onGroupDialogShown(Group* g)
onDialogShown(g->getGroupWidget());
}
void Widget::toggleFullscreen() {
if (windowState().testFlag(Qt::WindowFullScreen))
{
setWindowState(windowState() & ~Qt::WindowFullScreen);
}
else
{
setWindowState(windowState() | Qt::WindowFullScreen);
}
}
ContentDialog* Widget::createContentDialog() const
{
ContentDialog* contentDialog = new ContentDialog(settingsWidget);

View File

@ -151,6 +151,7 @@ public slots:
void previousContact();
void onFriendDialogShown(Friend* f);
void onGroupDialogShown(Group* g);
void toggleFullscreen();
signals:
void friendRequestAccepted(const ToxPk& friendPk);