Add Cmd-M shortcut on Mac OS to minimize window (Bug: #2827152)

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@355 b624d157-de02-0410-bad0-e51aec6abb33
master
sniperbeamer 15 years ago
parent 2275b3351b
commit aa807c9f53
  1. 5
      src/forms/MainWindow.ui
  2. 9
      src/mainwindow.cpp

@ -583,6 +583,11 @@
<string>Sort groups</string>
</property>
</action>
<action name="ViewMinimizeAction">
<property name="text">
<string>&amp;Minimize Window</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

@ -185,6 +185,9 @@ void KeepassMainWindow::setupConnections(){
connect(ViewToolButtonSize22Action,SIGNAL(toggled(bool)), this, SLOT(OnViewToolbarIconSize22(bool)));
connect(ViewToolButtonSize28Action,SIGNAL(toggled(bool)), this, SLOT(OnViewToolbarIconSize28(bool)));
connect(ViewShowStatusbarAction,SIGNAL(toggled(bool)),statusBar(),SLOT(setVisible(bool)));
#ifdef Q_WS_MAC
connect(ViewMinimizeAction, SIGNAL(triggered()), SLOT(showMinimized()));
#endif
connect(ExtrasSettingsAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasSettings()));
connect(ExtrasPasswordGenAction,SIGNAL(triggered(bool)),this,SLOT(OnExtrasPasswordGen()));
@ -323,6 +326,11 @@ void KeepassMainWindow::setupMenus(){
case 28: ViewToolButtonSize28Action->setChecked(true); break;
}
#ifdef Q_WS_MAC
ViewMenu->addSeparator();
ViewMenu->addAction(ViewMinimizeAction);
#endif
SysTrayMenu = new QMenu(APP_DISPLAY_NAME,this);
SysTrayMenu->addAction(FileUnLockWorkspaceAction);
SysTrayMenu->addSeparator();
@ -372,6 +380,7 @@ void KeepassMainWindow::setupMenus(){
#ifdef Q_WS_MAC
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
EditGroupSearchAction->setShortcut(tr("Shift+Ctrl+F"));
ViewMinimizeAction->setShortcut(tr("Ctrl+M"));
#endif
//ExtrasTrashCanAction->setVisible(false); //TODO For KP 2.x only