Fixed minimize on macOS with CTRL + M shortcut

This commit is contained in:
defnax 2023-12-29 21:34:54 +01:00
parent 3615ebf05e
commit 79977a0c37
2 changed files with 12 additions and 1 deletions

View File

@ -673,7 +673,7 @@ void MainWindow::createMenuBar()
actionMinimize->setShortcutContext(Qt::ApplicationShortcut);
actionMinimize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
actionMinimize->setShortcutVisibleInContextMenu(true);
connect(actionMinimize,SIGNAL(triggered()),this,SLOT(showMinimized())) ;
connect(actionMinimize,SIGNAL(triggered()),this,SLOT(minimizeWindow())) ;
menuBar = new QMenuBar(this);
QMenu *fileMenu = menuBar->addMenu("");
@ -698,6 +698,13 @@ void MainWindow::createMenuBar()
}
#endif
#if defined(Q_OS_DARWIN)
void MainWindow::minimizeWindow()
{
setWindowState(windowState() | Qt::WindowMinimized);
}
#endif
void MainWindow::showBandwidthGraph()
{
if(_bandwidthGraph == NULL)

View File

@ -265,6 +265,10 @@ private slots:
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
void toggleVisibilitycontextmenu();
#if defined(Q_OS_DARWIN)
void minimizeWindow();
#endif
/** Toolbar fns. */
void addFriend();
//void newRsCollection();