diff --git a/interface/resources/styles/preferences.qss b/interface/resources/styles/preferences.qss deleted file mode 100644 index 40e35c8e52..0000000000 --- a/interface/resources/styles/preferences.qss +++ /dev/null @@ -1,23 +0,0 @@ -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; -} - -QPushButton#buttonBrowseHead, -QPushButton#buttonBrowseBody, -QPushButton#buttonBrowseLocation, -QPushButton#buttonBrowseScriptsLocation { - background-image: url(styles/search.svg); - background-repeat: no-repeat; - background-position: center center; - background-color: #fff; - border-radius: 0; - padding: 0; -} diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 2e2c10458d..2f638592e9 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -1049,7 +1049,7 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (!_preferencesDialog) { - _preferencesDialog = new PreferencesDialog(Application::getInstance()->getWindow()); + _preferencesDialog = new PreferencesDialog(); _preferencesDialog->show(); } else { _preferencesDialog->close(); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 4ebd5f4c1a..f04d3b182c 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -16,16 +16,13 @@ #include "PreferencesDialog.h" #include "UserActivityLogger.h" -const int SCROLL_PANEL_BOTTOM_MARGIN = 30; -const int OK_BUTTON_RIGHT_MARGIN = 30; -const int BUTTONS_TOP_MARGIN = 24; - -PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags, POSITION_LEFT) { +PreferencesDialog::PreferencesDialog() : + QDialog(Application::getInstance()->getWindow()) { + + setAttribute(Qt::WA_DeleteOnClose); ui.setupUi(this); - setStyleSheetFile("styles/preferences.qss"); loadPreferences(); - connect(ui.closeButton, &QPushButton::clicked, this, &QDialog::close); connect(ui.buttonBrowseHead, &QPushButton::clicked, this, &PreferencesDialog::openHeadModelBrowser); connect(ui.buttonBrowseBody, &QPushButton::clicked, this, &PreferencesDialog::openBodyModelBrowser); @@ -49,78 +46,48 @@ void PreferencesDialog::setSkeletonUrl(QString modelUrl) { } void PreferencesDialog::openHeadModelBrowser() { - setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); - show(); - ModelsBrowser modelBrowser(HEAD_MODEL); connect(&modelBrowser, &ModelsBrowser::selected, this, &PreferencesDialog::setHeadUrl); modelBrowser.browse(); - - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - show(); } void PreferencesDialog::openBodyModelBrowser() { - setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); - show(); - ModelsBrowser modelBrowser(SKELETON_MODEL); connect(&modelBrowser, &ModelsBrowser::selected, this, &PreferencesDialog::setSkeletonUrl); modelBrowser.browse(); - - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - show(); } void PreferencesDialog::openSnapshotLocationBrowser() { - setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); - show(); - QString dir = QFileDialog::getExistingDirectory(this, tr("Snapshots Location"), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!dir.isNull() && !dir.isEmpty()) { ui.snapshotLocationEdit->setText(dir); } - - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - show(); } void PreferencesDialog::openScriptsLocationBrowser() { - setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); - show(); - QString dir = QFileDialog::getExistingDirectory(this, tr("Scripts Location"), ui.scriptsLocationEdit->text(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!dir.isNull() && !dir.isEmpty()) { ui.scriptsLocationEdit->setText(dir); } - - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - show(); } void PreferencesDialog::resizeEvent(QResizeEvent *resizeEvent) { - + // keep buttons panel at the bottom - ui.buttonsPanel->setGeometry(0, size().height() - ui.buttonsPanel->height(), size().width(), ui.buttonsPanel->height()); - + ui.buttonsPanel->setGeometry(0, + size().height() - ui.buttonsPanel->height(), + size().width(), + ui.buttonsPanel->height()); + // set width and height of srcollarea to match bottom panel and width ui.scrollArea->setGeometry(ui.scrollArea->geometry().x(), ui.scrollArea->geometry().y(), size().width(), - size().height() - ui.buttonsPanel->height() - - SCROLL_PANEL_BOTTOM_MARGIN - ui.scrollArea->geometry().y()); - - // move Save button to left position - ui.defaultButton->move(size().width() - OK_BUTTON_RIGHT_MARGIN - ui.defaultButton->size().width(), BUTTONS_TOP_MARGIN); - - // move Save button to left position - ui.cancelButton->move(ui.defaultButton->pos().x() - ui.cancelButton->size().width(), BUTTONS_TOP_MARGIN); - - // move close button - ui.closeButton->move(size().width() - OK_BUTTON_RIGHT_MARGIN - ui.closeButton->size().width(), ui.closeButton->pos().y()); + size().height() - ui.buttonsPanel->height() - ui.scrollArea->geometry().y()); + } void PreferencesDialog::loadPreferences() { diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h index 0573304eda..f2646080ef 100644 --- a/interface/src/ui/PreferencesDialog.h +++ b/interface/src/ui/PreferencesDialog.h @@ -12,20 +12,20 @@ #ifndef hifi_PreferencesDialog_h #define hifi_PreferencesDialog_h -#include "FramelessDialog.h" #include "ui_preferencesDialog.h" +#include #include -class PreferencesDialog : public FramelessDialog { +class PreferencesDialog : public QDialog { Q_OBJECT public: - PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + PreferencesDialog(); protected: void resizeEvent(QResizeEvent* resizeEvent); - + private: void loadPreferences(); void savePreferences(); diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 566c24e4e3..937c9f0f04 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -1,13 +1,13 @@ PreferencesDialog - + 0 0 - 638 - 652 + 500 + 609 @@ -18,124 +18,23 @@ - 610 + 500 0 - - 0.950000000000000 + + + 500 + 16777215 + - - - - 0 - 560 - 611 - 97 - - - - - 0 - 0 - - - - - 0 - 97 - - - - - Arial - - - - background-color: #0e7077 - - - - - 310 - 24 - 91 - 50 - - - - - 0 - 0 - - - - - 0 - 50 - - - - - Arial - 18 - 50 - false - - - - - - - Cancel - - - - - - 400 - 24 - 188 - 50 - - - - - 0 - 0 - - - - - 188 - 49 - - - - - Arial - 18 - - - - background-color: #fff; -color: #0e7077 - - - Save all changes - - - true - - - 0 - 30 - 494 - 361 + 0 + 501 + 501 @@ -155,8 +54,8 @@ color: #0e7077 0 0 - 494 - 1456 + 501 + 1350 @@ -175,31 +74,6 @@ color: #0e7077 30 - - - - - 0 - 0 - - - - - Arial - 24 - - - - color: #0e7077 - - - Avatar - - - 25 - - - @@ -220,9 +94,6 @@ color: #0e7077 16 - - color: #0e7077 - <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> @@ -284,9 +155,6 @@ color: #0e7077 16 - - color: #0e7077 - Head @@ -311,11 +179,6 @@ color: #0e7077 0 - - - Arial - - @@ -336,34 +199,13 @@ color: #0e7077 - - - 0 - 0 - - - - - 30 - 30 - - - - - 30 - 30 - - - - - - + Browse - 30 - 30 + 0 + 0 @@ -390,9 +232,6 @@ color: #0e7077 16 - - color: #0e7077 - Body @@ -414,11 +253,6 @@ color: #0e7077 0 - - - Arial - - @@ -439,34 +273,13 @@ color: #0e7077 - - - 0 - 0 - - - - - 30 - 30 - - - - - 30 - 30 - - - - - - + Browse - 30 - 30 + 0 + 0 @@ -495,9 +308,6 @@ color: #0e7077 false - - color: #0e7077 - Snapshots @@ -526,9 +336,6 @@ color: #0e7077 16 - - color: #0e7077 - Place my Snapshots here: @@ -578,34 +385,13 @@ color: #0e7077 - - - 0 - 0 - - - - - 30 - 30 - - - - - 30 - 30 - - - - - - + Browse - 30 - 30 + 0 + 0 @@ -634,9 +420,6 @@ color: #0e7077 false - - color: #0e7077 - Scripts @@ -665,9 +448,6 @@ color: #0e7077 16 - - color: #0e7077 - Load scripts from this directory: @@ -717,34 +497,13 @@ color: #0e7077 - - - 0 - 0 - - - - - 30 - 30 - - - - - 30 - 30 - - - - - - + Browse - 30 - 30 + 0 + 0 @@ -756,22 +515,15 @@ color: #0e7077 - - - 0 - 0 - - - - background: #0e7077; -color: #fff; -border-radius: 4px; -font: bold 14px; -padding: 10px;margin-top:10px - Load Default Scripts + + + 0 + 0 + + @@ -810,9 +562,6 @@ padding: 10px;margin-top:10px 16 - - color: #0e7077 - Privacy @@ -890,7 +639,7 @@ padding: 10px;margin-top:10px - 32 + 22 0 @@ -905,8 +654,8 @@ padding: 10px;margin-top:10px - 32 - 32 + 0 + 0 @@ -950,7 +699,7 @@ padding: 10px;margin-top:10px - color: #0e7077 + Advanced Tuning @@ -959,7 +708,7 @@ padding: 10px;margin-top:10px Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - 25 + 0 @@ -1016,9 +765,6 @@ padding: 10px;margin-top:10px false - - color: #0e7077 - Avatar @@ -1082,16 +828,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 95 - 36 + 100 + 0 @@ -1178,8 +918,8 @@ padding: 10px;margin-top:10px - 95 - 36 + 100 + 0 @@ -1277,21 +1017,15 @@ padding: 10px;margin-top:10px - + 0 0 - 95 - 36 - - - - - 70 - 16777215 + 100 + 0 @@ -1358,16 +1092,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 95 - 36 + 100 + 0 @@ -1448,7 +1176,7 @@ padding: 10px;margin-top:10px - 125 + 130 0 @@ -1519,22 +1247,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 95 - 36 - - - - - 70 - 16777215 + 100 + 0 @@ -1556,98 +1272,84 @@ padding: 10px;margin-top:10px - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Max Frames Over Desired - - - 15 - - - maxFramesOverDesiredSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - 0 - - - 10000 - - - 1 - - - - - - - + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Max Frames Over Desired + + + 15 + + + maxFramesOverDesiredSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 100 + 0 + + + + + Arial + + + + 0 + + + 10000 + + + 1 + + + + + @@ -1711,7 +1413,7 @@ padding: 10px;margin-top:10px - 125 + 130 0 @@ -1749,9 +1451,6 @@ padding: 10px;margin-top:10px false - - color: #0e7077 - Voxels @@ -1815,16 +1514,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 125 - 36 + 100 + 0 @@ -1894,22 +1587,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 95 - 36 - - - - - 70 - 16777215 + 100 + 0 @@ -1932,12 +1613,6 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - 0 @@ -1952,9 +1627,6 @@ padding: 10px;margin-top:10px false - - color: #0e7077 - Oculus Rift @@ -2018,16 +1690,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 125 - 36 + 100 + 0 @@ -2073,9 +1739,6 @@ padding: 10px;margin-top:10px false - - color: #0e7077 - Sixense Controllers @@ -2139,18 +1802,6 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - - - 32 - 0 - - 0 @@ -2162,8 +1813,8 @@ padding: 10px;margin-top:10px - 32 - 32 + 0 + 0 @@ -2225,16 +1876,10 @@ padding: 10px;margin-top:10px - - - 0 - 0 - - - 125 - 36 + 100 + 0 @@ -2258,64 +1903,71 @@ padding: 10px;margin-top:10px - + - 540 - 24 - 31 - 31 + 0 + 530 + 501 + 60 - - - PreferAntialias - + + QFrame::NoFrame - - + + QFrame::Raised + + + + 0 + 10 + 491 + 41 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + false + + + + + + + Save all changes + + + true + + + false + + + + + - - - FramelessDialog - 1 - - - - - cancelButton - clicked() - PreferencesDialog - close() - - - 966 - 557 - - - 528 - 0 - - - - - defaultButton - clicked() - PreferencesDialog - accept() - - - 1070 - 557 - - - 20 - 20 - - - - +