mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 01:22:25 +02:00
resizing
- fixed layout
This commit is contained in:
parent
21b54fd07a
commit
913783c0f1
8 changed files with 1296 additions and 524 deletions
|
@ -113,22 +113,145 @@
|
|||
<context>
|
||||
<name>Menu</name>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="437"/>
|
||||
<location filename="src/Menu.cpp" line="439"/>
|
||||
<source>Open .ini config file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="439"/>
|
||||
<location filename="src/Menu.cpp" line="451"/>
|
||||
<location filename="src/Menu.cpp" line="441"/>
|
||||
<location filename="src/Menu.cpp" line="453"/>
|
||||
<source>Text files (*.ini)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Menu.cpp" line="449"/>
|
||||
<location filename="src/Menu.cpp" line="451"/>
|
||||
<source>Save .ini config file</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PreferencesDialog</name>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="187"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="555"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="221"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="556"/>
|
||||
<source><html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="257"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="557"/>
|
||||
<source>Not showing a name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="285"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="558"/>
|
||||
<source>Head</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="337"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="559"/>
|
||||
<source>Body</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="399"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="560"/>
|
||||
<source>Advanced Tuning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="426"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="561"/>
|
||||
<source>It's not recomended that you play with these settings unless you've looked into exactly what they do.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="462"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="562"/>
|
||||
<source><p>Avatar</p></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="509"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="563"/>
|
||||
<source>Lean scale (applies to Faceshift users)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="591"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="564"/>
|
||||
<source>Vertical field of view</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="676"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="565"/>
|
||||
<source>Avatar scale (default is 1.0)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="755"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="566"/>
|
||||
<source>Pupil dillation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="828"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="567"/>
|
||||
<source>Audio Jitter Buffer Samples (0 for automatic)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="913"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="568"/>
|
||||
<source>Faceshift eye detection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="990"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="569"/>
|
||||
<source><html><head/><body><p>Voxels</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1019"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="570"/>
|
||||
<source>Maximum voxels</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1095"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="571"/>
|
||||
<source>Max voxels sent each second</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="1170"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="572"/>
|
||||
<source>PushButton</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="89"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="553"/>
|
||||
<source>Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/preferencesDialog.ui" line="105"/>
|
||||
<location filename="../build/interface/ui_preferencesDialog.h" line="554"/>
|
||||
<source>Save all changes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
}
|
||||
|
||||
FramelessDialog {
|
||||
background-color: rgb(255, 255, 255);
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
@ -67,12 +66,15 @@ QSpinBox::down-button {
|
|||
|
||||
QDoubleSpinBox::up-button,
|
||||
QSpinBox::up-button {
|
||||
|
||||
margin-top:2px;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-button,
|
||||
QSpinBox::down-button {
|
||||
margin-bottom:3px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
|
11
interface/resources/styles/preferences.qss
Normal file
11
interface/resources/styles/preferences.qss
Normal file
|
@ -0,0 +1,11 @@
|
|||
QLabel#avatarLabel {
|
||||
background-image: url(styles/avatar.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
}
|
||||
|
||||
QLabel#advancedTuningLabel {
|
||||
background-image: url(styles/wrench.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
}
|
|
@ -695,8 +695,9 @@ void Menu::loginForCurrentDomain() {
|
|||
void Menu::editPreferences() {
|
||||
if (! _preferencesDialog) {
|
||||
_preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget());
|
||||
_preferencesDialog->show();
|
||||
}
|
||||
_preferencesDialog->show();
|
||||
_preferencesDialog->raise();
|
||||
}
|
||||
|
||||
void Menu::goToDomain(const QString newDomain) {
|
||||
|
|
|
@ -8,20 +8,46 @@
|
|||
|
||||
#include <QFile>
|
||||
#include <QPushButton>
|
||||
#include <QSizeGrip>
|
||||
|
||||
#include "Application.h"
|
||||
#include "FramelessDialog.h"
|
||||
|
||||
FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint) {
|
||||
|
||||
QFile styleSheet(Application::resourcesPath() + "styles/global.qss");
|
||||
if (styleSheet.open(QIODevice::ReadOnly)) {
|
||||
QDir::setCurrent(Application::resourcesPath());
|
||||
setStyleSheet(styleSheet.readAll());
|
||||
}
|
||||
|
||||
setWindowOpacity(0.95);
|
||||
setWindowOpacity(0.9);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
isResizing = false;
|
||||
}
|
||||
|
||||
void FramelessDialog::setStyleSheet(const QString& fileName) {
|
||||
QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss");
|
||||
QFile styleSheet(Application::resourcesPath() + fileName);
|
||||
if (styleSheet.open(QIODevice::ReadOnly) && globalStyleSheet.open(QIODevice::ReadOnly) ) {
|
||||
QDir::setCurrent(Application::resourcesPath());
|
||||
QDialog::setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll());
|
||||
}
|
||||
}
|
||||
void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) {
|
||||
if (abs(mouseEvent->pos().x() - size().width()) < 2 && mouseEvent->button() == Qt::LeftButton) {
|
||||
isResizing = true;
|
||||
QApplication::setOverrideCursor(Qt::SizeHorCursor);
|
||||
}
|
||||
// propagate the event
|
||||
QDialog::mousePressEvent(mouseEvent);
|
||||
}
|
||||
|
||||
void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) {
|
||||
QApplication::restoreOverrideCursor();
|
||||
isResizing = false;
|
||||
// propagate the event
|
||||
QDialog::mouseReleaseEvent(mouseEvent);
|
||||
}
|
||||
|
||||
void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) {
|
||||
if (isResizing) {
|
||||
resize(mouseEvent->pos().x(), size().height());
|
||||
}
|
||||
QDialog::mouseMoveEvent(mouseEvent);
|
||||
}
|
||||
|
||||
FramelessDialog::~FramelessDialog() {
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
#define __hifi__FramelessDialog__
|
||||
|
||||
#include <QDialog>
|
||||
#include <QGridLayout>
|
||||
#include <QString>
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionTitleBar>
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
|
||||
class FramelessDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
@ -21,6 +21,15 @@ class FramelessDialog : public QDialog {
|
|||
public:
|
||||
FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
||||
virtual ~FramelessDialog();
|
||||
void setStyleSheet(const QString& fileName);
|
||||
|
||||
protected:
|
||||
void mouseMoveEvent(QMouseEvent* mouseEvent);
|
||||
void mousePressEvent(QMouseEvent* mouseEvent);
|
||||
void mouseReleaseEvent(QMouseEvent* mouseEvent);
|
||||
|
||||
private:
|
||||
bool isResizing;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) {
|
||||
ui.setupUi(this);
|
||||
setStyleSheet("styles/preferences.qss");
|
||||
loadPreferences();
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue