Remove custom styling

This commit is contained in:
stojce 2014-08-23 00:16:25 +02:00
parent 4f3f0989f5
commit 7e250bc899
5 changed files with 213 additions and 617 deletions

View file

@ -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;
}

View file

@ -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();

View file

@ -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() {

View file

@ -12,20 +12,20 @@
#ifndef hifi_PreferencesDialog_h
#define hifi_PreferencesDialog_h
#include "FramelessDialog.h"
#include "ui_preferencesDialog.h"
#include <QDialog>
#include <QString>
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();

File diff suppressed because it is too large Load diff