mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 06:59:27 -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->setShortcutContext(Qt::ApplicationShortcut);
|
||||||
actionMinimize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
actionMinimize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
||||||
actionMinimize->setShortcutVisibleInContextMenu(true);
|
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);
|
menuBar = new QMenuBar(this);
|
||||||
QMenu *fileMenu = menuBar->addMenu("");
|
QMenu *fileMenu = menuBar->addMenu("");
|
||||||
fileMenu->addAction(actionMinimize);
|
fileMenu->addAction(actionMinimize);
|
||||||
|
fileMenu->addAction(actionCloseWindow);
|
||||||
|
|
||||||
dockMenu = new QMenu(this);
|
dockMenu = new QMenu(this);
|
||||||
dockMenu->setAsDockMenu();
|
dockMenu->setAsDockMenu();
|
||||||
@ -705,6 +712,14 @@ void MainWindow::minimizeWindow()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
void MainWindow::closeWindow()
|
||||||
|
{
|
||||||
|
// On macOS window close is basically equivalent to window hide.
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void MainWindow::showBandwidthGraph()
|
void MainWindow::showBandwidthGraph()
|
||||||
{
|
{
|
||||||
if(_bandwidthGraph == NULL)
|
if(_bandwidthGraph == NULL)
|
||||||
|
@ -267,6 +267,7 @@ private slots:
|
|||||||
|
|
||||||
#if defined(Q_OS_DARWIN)
|
#if defined(Q_OS_DARWIN)
|
||||||
void minimizeWindow();
|
void minimizeWindow();
|
||||||
|
void closeWindow();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Toolbar fns. */
|
/** Toolbar fns. */
|
||||||
@ -337,6 +338,7 @@ private:
|
|||||||
QMenuBar *menuBar;
|
QMenuBar *menuBar;
|
||||||
QMenu *dockMenu;
|
QMenu *dockMenu;
|
||||||
QAction* actionMinimize;
|
QAction* actionMinimize;
|
||||||
|
QAction* actionCloseWindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QSystemTrayIcon *trayIcon;
|
QSystemTrayIcon *trayIcon;
|
||||||
|
Loading…
Reference in New Issue
Block a user