Browse Source

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

Allow to make qTox fullscreen, similar to how browsers switch to fullscreen.
reviewable/pr4141/r3
Yuri 9 years ago
parent
commit
3a20a4ba43
  1. 1
      doc/user_manual_en.md
  2. 12
      src/widget/widget.cpp
  3. 1
      src/widget/widget.h

1
doc/user_manual_en.md

@ -415,6 +415,7 @@ The following shortcuts are currently supported: @@ -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

12
src/widget/widget.cpp

@ -261,6 +261,7 @@ void Widget::init() @@ -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) @@ -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);

1
src/widget/widget.h

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

Loading…
Cancel
Save