mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 20:42:56 +02:00
CR Fixes
This commit is contained in:
parent
c9605be193
commit
a1c6843bd4
4 changed files with 26 additions and 23 deletions
|
@ -1,9 +1,12 @@
|
||||||
//
|
//
|
||||||
// FramelessDialog.cpp
|
// FramelessDialog.cpp
|
||||||
// hifi
|
// interface/src/ui
|
||||||
//
|
//
|
||||||
// Created by Stojce Slavkovski on 2/20/14.
|
// Created by Stojce Slavkovski on 2/20/14.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
@ -25,20 +28,17 @@ QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) {
|
||||||
bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) {
|
bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::Move:
|
case QEvent::Move:
|
||||||
|
|
||||||
if (sender == parentWidget()) {
|
if (sender == parentWidget()) {
|
||||||
// move to upper left corner on app move
|
// move to upper left corner on app move
|
||||||
move(parentWidget()->geometry().topLeft());
|
move(parentWidget()->geometry().topLeft());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::Resize:
|
case QEvent::Resize:
|
||||||
if (sender == parentWidget()) {
|
if (sender == parentWidget()) {
|
||||||
// keep full app height on resizing the app
|
// keep full app height on resizing the app
|
||||||
setFixedHeight(parentWidget()->size().height());
|
setFixedHeight(parentWidget()->size().height());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::WindowStateChange:
|
case QEvent::WindowStateChange:
|
||||||
if (parentWidget()->isMinimized()) {
|
if (parentWidget()->isMinimized()) {
|
||||||
setHidden(true);
|
setHidden(true);
|
||||||
|
@ -46,16 +46,13 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) {
|
||||||
setHidden(false);
|
setHidden(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::ApplicationDeactivate:
|
case QEvent::ApplicationDeactivate:
|
||||||
// hide on minimize and focus lost
|
// hide on minimize and focus lost
|
||||||
setHidden(true);
|
setHidden(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::ApplicationActivate:
|
case QEvent::ApplicationActivate:
|
||||||
setHidden(false);
|
setHidden(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -63,10 +60,6 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FramelessDialog::~FramelessDialog() {
|
|
||||||
deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessDialog::setStyleSheetFile(const QString& fileName) {
|
void FramelessDialog::setStyleSheetFile(const QString& fileName) {
|
||||||
QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss");
|
QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss");
|
||||||
QFile styleSheet(Application::resourcesPath() + fileName);
|
QFile styleSheet(Application::resourcesPath() + fileName);
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
//
|
//
|
||||||
// FramelessDialog.h
|
// FramelessDialog.h
|
||||||
// hifi
|
// interface/src/ui
|
||||||
//
|
//
|
||||||
// Created by Stojce Slavkovski on 2/20/14.
|
// Created by Stojce Slavkovski on 2/20/14.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef __hifi__FramelessDialog__
|
|
||||||
#define __hifi__FramelessDialog__
|
#ifndef hifi_FramelessDialog_h
|
||||||
|
#define hifi_FramelessDialog_h
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
@ -16,7 +20,6 @@ class FramelessDialog : public QDialog {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
||||||
~FramelessDialog();
|
|
||||||
void setStyleSheetFile(const QString& fileName);
|
void setStyleSheetFile(const QString& fileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -32,4 +35,4 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__hifi__FramelessDialog__) */
|
#endif // hifi_FramelessDialog_h
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
//
|
//
|
||||||
// PreferencesDialog.cpp
|
// PreferencesDialog.cpp
|
||||||
// hifi
|
// interface/src/ui
|
||||||
//
|
//
|
||||||
// Created by Stojce Slavkovski on 2/22/14.
|
// Created by Stojce Slavkovski on 2/20/14.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include "PreferencesDialog.h"
|
#include "PreferencesDialog.h"
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
//
|
//
|
||||||
// PreferencesDialog.h
|
// PreferencesDialog.h
|
||||||
// hifi
|
// interface/src/ui
|
||||||
//
|
//
|
||||||
// Created by Stojce Slavkovski on 2/22/14.
|
// Created by Stojce Slavkovski on 2/20/14.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef __hifi__PreferencesDialog__
|
#ifndef hifi_PreferencesDialog_h
|
||||||
#define __hifi__PreferencesDialog__
|
#define hifi_PreferencesDialog_h
|
||||||
|
|
||||||
#include "FramelessDialog.h"
|
#include "FramelessDialog.h"
|
||||||
#include "ui_preferencesDialog.h"
|
#include "ui_preferencesDialog.h"
|
||||||
|
@ -42,4 +45,4 @@ private slots:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__hifi__PreferencesDialog__) */
|
#endif // hifi_PreferencesDialog_h
|
||||||
|
|
Loading…
Reference in a new issue