mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 16:24:47 +02:00
styling
bad merge fix
This commit is contained in:
parent
ada15df89d
commit
6383457e4e
4 changed files with 35 additions and 134 deletions
|
@ -26,10 +26,40 @@ QLabel p {
|
||||||
QPushButton {
|
QPushButton {
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
border-radius: 9px;
|
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
padding: 10px 15px;
|
padding: 10px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSpinBox {
|
||||||
|
padding: 5px;
|
||||||
|
border-width: 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QSpinBox::up-button {
|
||||||
|
|
||||||
|
width: 25px;
|
||||||
|
height: 18px;
|
||||||
|
background-image: url(resources/styles/up.svg);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border: 1px #ccc solid;
|
||||||
|
|
||||||
|
border-top-left-radius: 2px;
|
||||||
|
border-top-right-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSpinBox::down-button {
|
||||||
|
|
||||||
|
width: 25px;
|
||||||
|
height: 18px;
|
||||||
|
background-image: url(resources/styles/down.svg);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border: 1px #ccc solid;
|
||||||
|
|
||||||
|
border-top-left-radius: 2px;
|
||||||
|
border-top-right-radius: 2px;
|
||||||
|
}
|
||||||
|
|
|
@ -792,139 +792,10 @@ void Menu::loginForCurrentDomain() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::editPreferences() {
|
void Menu::editPreferences() {
|
||||||
Application* applicationInstance = Application::getInstance();
|
if(! _preferencesDialog) {
|
||||||
|
_preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget());
|
||||||
QDialog dialog(applicationInstance->getWindow());
|
|
||||||
dialog.setWindowTitle("Interface Preferences");
|
|
||||||
|
|
||||||
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
|
|
||||||
dialog.setLayout(layout);
|
|
||||||
|
|
||||||
QFormLayout* form = new QFormLayout();
|
|
||||||
layout->addLayout(form, 1);
|
|
||||||
|
|
||||||
QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString();
|
|
||||||
QLineEdit* faceURLEdit = new QLineEdit(faceURLString);
|
|
||||||
faceURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
|
||||||
faceURLEdit->setPlaceholderText(DEFAULT_HEAD_MODEL_URL.toString());
|
|
||||||
form->addRow("Face URL:", faceURLEdit);
|
|
||||||
|
|
||||||
QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString();
|
|
||||||
QLineEdit* skeletonURLEdit = new QLineEdit(skeletonURLString);
|
|
||||||
skeletonURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
|
||||||
skeletonURLEdit->setPlaceholderText(DEFAULT_BODY_MODEL_URL.toString());
|
|
||||||
form->addRow("Skeleton URL:", skeletonURLEdit);
|
|
||||||
|
|
||||||
QString displayNameString = applicationInstance->getAvatar()->getDisplayName();
|
|
||||||
QLineEdit* displayNameEdit = new QLineEdit(displayNameString);
|
|
||||||
displayNameEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
|
||||||
form->addRow("Display name:", displayNameEdit);
|
|
||||||
|
|
||||||
QSlider* pupilDilation = new QSlider(Qt::Horizontal);
|
|
||||||
pupilDilation->setValue(applicationInstance->getAvatar()->getHead()->getPupilDilation() * pupilDilation->maximum());
|
|
||||||
form->addRow("Pupil Dilation:", pupilDilation);
|
|
||||||
|
|
||||||
QSlider* faceshiftEyeDeflection = new QSlider(Qt::Horizontal);
|
|
||||||
faceshiftEyeDeflection->setValue(_faceshiftEyeDeflection * faceshiftEyeDeflection->maximum());
|
|
||||||
form->addRow("Faceshift Eye Deflection:", faceshiftEyeDeflection);
|
|
||||||
|
|
||||||
QSpinBox* fieldOfView = new QSpinBox();
|
|
||||||
fieldOfView->setMaximum(180);
|
|
||||||
fieldOfView->setMinimum(1);
|
|
||||||
fieldOfView->setValue(_fieldOfView);
|
|
||||||
form->addRow("Vertical Field of View (Degrees):", fieldOfView);
|
|
||||||
|
|
||||||
QDoubleSpinBox* leanScale = new QDoubleSpinBox();
|
|
||||||
leanScale->setValue(applicationInstance->getAvatar()->getLeanScale());
|
|
||||||
form->addRow("Lean Scale:", leanScale);
|
|
||||||
|
|
||||||
QDoubleSpinBox* avatarScale = new QDoubleSpinBox();
|
|
||||||
avatarScale->setValue(applicationInstance->getAvatar()->getScale());
|
|
||||||
form->addRow("Avatar Scale:", avatarScale);
|
|
||||||
|
|
||||||
QSpinBox* audioJitterBufferSamples = new QSpinBox();
|
|
||||||
audioJitterBufferSamples->setMaximum(10000);
|
|
||||||
audioJitterBufferSamples->setMinimum(-10000);
|
|
||||||
audioJitterBufferSamples->setValue(_audioJitterBufferSamples);
|
|
||||||
form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples);
|
|
||||||
|
|
||||||
QSpinBox* maxVoxels = new QSpinBox();
|
|
||||||
const int MAX_MAX_VOXELS = 5000000;
|
|
||||||
const int MIN_MAX_VOXELS = 0;
|
|
||||||
const int STEP_MAX_VOXELS = 50000;
|
|
||||||
maxVoxels->setMaximum(MAX_MAX_VOXELS);
|
|
||||||
maxVoxels->setMinimum(MIN_MAX_VOXELS);
|
|
||||||
maxVoxels->setSingleStep(STEP_MAX_VOXELS);
|
|
||||||
maxVoxels->setValue(_maxVoxels);
|
|
||||||
form->addRow("Maximum Voxels:", maxVoxels);
|
|
||||||
|
|
||||||
QSpinBox* maxVoxelsPPS = new QSpinBox();
|
|
||||||
const int MAX_MAX_VOXELS_PPS = 6000;
|
|
||||||
const int MIN_MAX_VOXELS_PPS = 60;
|
|
||||||
const int STEP_MAX_VOXELS_PPS = 10;
|
|
||||||
maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS);
|
|
||||||
maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS);
|
|
||||||
maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS);
|
|
||||||
maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond);
|
|
||||||
form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS);
|
|
||||||
|
|
||||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
||||||
dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept()));
|
|
||||||
dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject()));
|
|
||||||
layout->addWidget(buttons);
|
|
||||||
|
|
||||||
int ret = dialog.exec();
|
|
||||||
if (ret == QDialog::Accepted) {
|
|
||||||
QUrl faceModelURL(faceURLEdit->text());
|
|
||||||
|
|
||||||
bool shouldDispatchIdentityPacket = false;
|
|
||||||
|
|
||||||
if (faceModelURL.toString() != faceURLString) {
|
|
||||||
// change the faceModelURL in the profile, it will also update this user's BlendFace
|
|
||||||
applicationInstance->getAvatar()->setFaceModelURL(faceModelURL);
|
|
||||||
shouldDispatchIdentityPacket = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QUrl skeletonModelURL(skeletonURLEdit->text());
|
|
||||||
|
|
||||||
if (skeletonModelURL.toString() != skeletonURLString) {
|
|
||||||
// change the skeletonModelURL in the profile, it will also update this user's Body
|
|
||||||
applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL);
|
|
||||||
shouldDispatchIdentityPacket = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString displayNameStr(displayNameEdit->text());
|
|
||||||
|
|
||||||
if (displayNameStr != displayNameString) {
|
|
||||||
applicationInstance->getAvatar()->setDisplayName(displayNameStr);
|
|
||||||
shouldDispatchIdentityPacket = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldDispatchIdentityPacket) {
|
|
||||||
applicationInstance->getAvatar()->sendIdentityPacket();
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());
|
|
||||||
|
|
||||||
_maxVoxels = maxVoxels->value();
|
|
||||||
applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels);
|
|
||||||
|
|
||||||
_maxVoxelPacketsPerSecond = maxVoxelsPPS->value();
|
|
||||||
|
|
||||||
applicationInstance->getAvatar()->setLeanScale(leanScale->value());
|
|
||||||
applicationInstance->getAvatar()->setClampedTargetScale(avatarScale->value());
|
|
||||||
|
|
||||||
_audioJitterBufferSamples = audioJitterBufferSamples->value();
|
|
||||||
|
|
||||||
if (_audioJitterBufferSamples != 0) {
|
|
||||||
applicationInstance->getAudio()->setJitterBufferSamples(_audioJitterBufferSamples);
|
|
||||||
}
|
|
||||||
|
|
||||||
_fieldOfView = fieldOfView->value();
|
|
||||||
applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height());
|
|
||||||
|
|
||||||
_faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_preferencesDialog->show();
|
_preferencesDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDial
|
||||||
setStyleSheet(styleSheet.readAll());
|
setStyleSheet(styleSheet.readAll());
|
||||||
}
|
}
|
||||||
setWindowOpacity(0.95);
|
setWindowOpacity(0.95);
|
||||||
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
FramelessDialog::~FramelessDialog() {
|
FramelessDialog::~FramelessDialog() {
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) {
|
PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) {
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
|
||||||
loadPreferences();
|
loadPreferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue