mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 22:49:37 -05:00
Added close window shortcut
This commit is contained in:
parent
79977a0c37
commit
75ef4dceb5
@ -673,11 +673,18 @@ void MainWindow::createMenuBar()
|
||||
actionMinimize->setShortcutContext(Qt::ApplicationShortcut);
|
||||
actionMinimize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
||||
actionMinimize->setShortcutVisibleInContextMenu(true);
|
||||
connect(actionMinimize,SIGNAL(triggered()),this,SLOT(minimizeWindow())) ;
|
||||
connect(actionMinimize,SIGNAL(triggered()),this,SLOT(minimizeWindow())) ;
|
||||
|
||||
actionCloseWindow = new QAction(tr("Close window"),this);
|
||||
actionCloseWindow->setShortcutContext(Qt::ApplicationShortcut);
|
||||
actionCloseWindow->setShortcut(QKeySequence::Close);
|
||||
actionCloseWindow->setShortcutVisibleInContextMenu(true);
|
||||
connect(actionCloseWindow,SIGNAL(triggered()),this,SLOT(closeWindow())) ;
|
||||
|
||||
menuBar = new QMenuBar(this);
|
||||
QMenu *fileMenu = menuBar->addMenu("");
|
||||
fileMenu->addAction(actionMinimize);
|
||||
fileMenu->addAction(actionCloseWindow);
|
||||
|
||||
dockMenu = new QMenu(this);
|
||||
dockMenu->setAsDockMenu();
|
||||
@ -705,6 +712,14 @@ void MainWindow::minimizeWindow()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_DARWIN)
|
||||
void MainWindow::closeWindow()
|
||||
{
|
||||
// On macOS window close is basically equivalent to window hide.
|
||||
close();
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::showBandwidthGraph()
|
||||
{
|
||||
if(_bandwidthGraph == NULL)
|
||||
|
@ -267,6 +267,7 @@ private slots:
|
||||
|
||||
#if defined(Q_OS_DARWIN)
|
||||
void minimizeWindow();
|
||||
void closeWindow();
|
||||
#endif
|
||||
|
||||
/** Toolbar fns. */
|
||||
@ -337,6 +338,7 @@ private:
|
||||
QMenuBar *menuBar;
|
||||
QMenu *dockMenu;
|
||||
QAction* actionMinimize;
|
||||
QAction* actionCloseWindow;
|
||||
#endif
|
||||
|
||||
QSystemTrayIcon *trayIcon;
|
||||
|
Loading…
Reference in New Issue
Block a user