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

feat(shortcut): Implemented F11 shortcut for toggling fullscreen.

Allow to make qTox fullscreen, similar to how browsers switch to fullscreen.
This commit is contained in:
Yuri 2017-02-05 00:38:25 -08:00
parent 5a04359901
commit 3a20a4ba43
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);