fix mac issue

This commit is contained in:
Dante Ruiz 2019-01-25 15:10:53 -08:00
parent 2c22fb82b1
commit db58173977
4 changed files with 35 additions and 2 deletions

View file

@ -8107,8 +8107,18 @@ void Application::toggleLogDialog() {
return;
}
if (! _logDialog) {
bool shouldSetParent = _keepLogWindowOnTop.get();
_logDialog = new LogDialog(shouldSetParent ? qApp->getWindow() : nullptr, getLogger());
bool keepOnTop =_keepLogWindowOnTop.get();
#ifdef Q_OS_WIN
_logDialog = new LogDialog(keepOnTop ? qApp->getWindow() : nullptr, getLogger());
#else
_logDialog = new LogDialog(nullptr, getLogger());
if (keepOnTop) {
Qt::WindowFlags flags = _logDialog->windowFlags() | Qt::Tool;
_logDialog->setWindowFlags(flags);
}
#endif
}
if (_logDialog->isVisible()) {

View file

@ -218,6 +218,7 @@ public:
bool getDesktopTabletBecomesToolbarSetting() { return _desktopTabletBecomesToolbarSetting.get(); }
bool getLogWindowOnTopSetting() { return _keepLogWindowOnTop.get(); }
void setLogWindowOnTopSetting(bool keepOnTop) { _keepLogWindowOnTop.set(keepOnTop); }
void setDesktopTabletBecomesToolbarSetting(bool value);
bool getHmdTabletBecomesToolbarSetting() { return _hmdTabletBecomesToolbarSetting.get(); }
void setHmdTabletBecomesToolbarSetting(bool value);

View file

@ -154,7 +154,11 @@ LogDialog::LogDialog(QWidget* parent, AbstractLoggerInterface* logger) : BaseLog
_keepOnTopBox = new QCheckBox(" Keep window on top", this);
bool isOnTop = qApp-> getLogWindowOnTopSetting();
_keepOnTopBox->setCheckState(isOnTop ? Qt::Checked : Qt::Unchecked);
#ifdef Q_OS_WIN
connect(_keepOnTopBox, &QCheckBox::stateChanged, qApp, &Application::recreateLogWindow);
#else
connect(_keepOnTopBox, &QCheckBox::stateChanged, this, &LogDialog::handleKeepWindowOnTop);
#endif
_keepOnTopBox->show();
_extraDebuggingBox = new QCheckBox("Extra debugging", this);
@ -248,6 +252,23 @@ void LogDialog::handleInfoPrintBox(int state) {
printLogFile();
}
void LogDialog::handleKeepWindowOnTop(int state) {
bool keepOnTop = (state != 0);
Qt::WindowFlags flags = windowFlags();
if (keepOnTop) {
flags |= Qt::Tool;
} else {
flags &= ~Qt::Tool;
}
setWindowFlags(flags);
qApp->setLogWindowOnTopSetting(keepOnTop);
show();
}
void LogDialog::handleCriticalPrintBox(int state) {
_logger->setCriticalPrint(state != 0);
printLogFile();

View file

@ -34,6 +34,7 @@ public slots:
private slots:
void handleRevealButton();
void handleExtraDebuggingCheckbox(int);
void handleKeepWindowOnTop(int);
void handleDebugPrintBox(int);
void handleInfoPrintBox(int);
void handleCriticalPrintBox(int);