Fixed issue Sankore-9. setHidden() doesn't behave as expected on mac

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent 735de5af68
commit 27b93bb24d
  1. 15
      src/core/UBApplication.cpp
  2. 3
      src/core/UBApplication.h

@ -223,7 +223,11 @@ int UBApplication::exec(const QString& pFileToImport)
applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner); applicationController = new UBApplicationController(boardController->controlView(), boardController->displayView(), mainWindow, staticMemoryCleaner);
connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), applicationController, SLOT(showDesktop(bool))); connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), applicationController, SLOT(showDesktop(bool)));
#ifndef Q_WS_MAC
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), mainWindow, SLOT(showMinimized())); connect(mainWindow->actionHideApplication, SIGNAL(triggered()), mainWindow, SLOT(showMinimized()));
#else
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized()));
#endif
mPreferencesController = new UBPreferencesController(mainWindow); mPreferencesController = new UBPreferencesController(mainWindow);
@ -300,7 +304,13 @@ int UBApplication::exec(const QString& pFileToImport)
return QApplication::exec(); return QApplication::exec();
} }
#ifdef Q_WS_MAC
void UBApplication::showMinimized()
{
mainWindow->hide();
}
#endif
void UBApplication::showBoard() void UBApplication::showBoard()
{ {
@ -485,6 +495,11 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event)
boardController->controlView()->forcedTabletRelease(); boardController->controlView()->forcedTabletRelease();
} }
#ifdef Q_WS_MAC
if (event->type() == QEvent::ApplicationActivate){
if (mainWindow->isHidden()) mainWindow->show();
}
#endif
return result; return result;
} }

@ -99,6 +99,9 @@ class UBApplication : public QtSingleApplication
private slots: private slots:
void closing(); void closing();
#ifdef Q_WS_MAC
void showMinimized();
#endif
private: private:

Loading…
Cancel
Save