Hidding Menubar with ALT key

Asked by Martin

Hello,

I have a suggestions, which is quit easy but usefull. A shortcut to hide and show the menubar for small displays. Is there a possibility to take into the offical code?

Mainwindow.ccp:
void MainWindow::on_hideMenuBar_activated()
{
    if(menuBar()->isHidden())
    {
        menuBar()->show();
        return;
    }
    menuBar()->hide();
}

mainwindow.h:
void on_hideMenuBar_activated();
QShortcut* m_hideMenuBarShortcut;

mainwindow.cpp: (in createToolbars() ):
m_hideMenuBarShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::ALT+Qt::Key_R), this, SLOT(on_hideMenuBar_activated()));

for me it does not work only with Qt::ALT but I don't know why.

Martin

Question information

Language:
English Edit question
Status:
Solved
For:
qpdfview Edit question
Assignee:
No assignee Edit question
Solved by:
Martin
Solved:
Last query:
Last reply:
Revision history for this message
Adam Reichold (adamreichold) said :
#1

Hello Martin,

I am not sure which version of qpdfview you are using, but such a function should be present since version 0.4.11: There is a configurable keyboard shortcut called "toggle menu bar" (and related one to toggle the visibility of the tool bars). There is also an option to do that automatically upon entering fullscreen mode in the interface settings. Could you try the latest stable version and determine if this already solves this? Thanks.

Best regards, Adam.

P.S.: Only pressing the Alt modifier not working is possibly your window manager intercepting this since it is often used to drag windows around.

Revision history for this message
Martin (martin-marmsoler) said :
#2

Hi Adam,

thank you for your answear. I didn't see that. Thank you!