From 8e2879e5ff7ed4bede2a40ebedf35a8ed36d6c3c Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 15 Jan 2014 23:14:45 +0100 Subject: [PATCH] Layout fixes --- interface/resources/styles/import_dialog.qss | 21 ++++++++++------ interface/src/ImportDialog.cpp | 26 +++++++++++++++++--- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/interface/resources/styles/import_dialog.qss b/interface/resources/styles/import_dialog.qss index f9d765b238..2c994fe816 100644 --- a/interface/resources/styles/import_dialog.qss +++ b/interface/resources/styles/import_dialog.qss @@ -15,22 +15,25 @@ QLabel { color: #333333; } -QLabel#fileNameLabel { - margin-top: 18px; - padding: 10px 0 0 7px; +QLabel#infoLabel { + padding: 7px 0 0 7px; + color: #666666; } QPushButton { border-width: 0; border-radius: 9px; font-size: 18px; - padding: 16px 0px; + padding: 17px 0px 15px; width: 107px; - margin: 20px 6px 18px; + margin-top: 20px; + margin-bottom: 18px; } QPushButton#importButton { color: #FFFFFF; + font-weight: bold; + margin-right: 6px; } QPushButton#importButton:enabled { @@ -44,10 +47,12 @@ QPushButton#importButton:!enabled { QPushButton#cancelButton { color: #333333; background-color: #FFFFFF; + width: 74px; + margin-right: 11px; } QSidebar, QTreeView { - border: 1px solid #E5E5E5; + border: 1px solid #C5C5C5; font-size: 14px; margin: 0px; } @@ -67,8 +72,8 @@ QTreeView QHeaderView { QTreeView QHeaderView:section { border-left: none; border-top: none; - border-bottom: 1px solid #E5E5E5; - border-right: 1px solid #E5E5E5; + border-bottom: 1px solid #C5C5C5; + border-right: 1px solid #C5C5C5; background: white; color: #666666; padding: 10px 20px; diff --git a/interface/src/ImportDialog.cpp b/interface/src/ImportDialog.cpp index 2832534131..0d2363b6c7 100644 --- a/interface/src/ImportDialog.cpp +++ b/interface/src/ImportDialog.cpp @@ -19,8 +19,10 @@ const QString WINDOW_NAME = QObject::tr("Import Voxels"); const QString IMPORT_BUTTON_NAME = QObject::tr("Import"); const QString IMPORT_INFO = QObject::tr("Import %1 as voxels"); const QString CANCEL_BUTTON_NAME = QObject::tr("Cancel"); -const QString INFO_LABEL_TEXT = QObject::tr("This will load selected file into Hifi and\n" - "allow you to place it with Command V"); +const QString INFO_LABEL_TEXT = QObject::tr("
" + "This will load the selected file into Hifi and allow you
" + "to place it with %1-V; you must be in select or
" + "add mode (S or V keys will toggle mode) to place.
"); const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); @@ -99,7 +101,16 @@ _cancelButton(CANCEL_BUTTON_NAME, this) { setFileMode(QFileDialog::ExistingFile); setViewMode(QFileDialog::Detail); +#ifdef Q_OS_MAC + QString cmdString = ("Command"); +#else + QString cmdString = ("Control"); +#endif + QLabel *infoLabel = new QLabel(QString(INFO_LABEL_TEXT).arg(cmdString)); + infoLabel->setObjectName("infoLabel"); + QGridLayout* gridLayout = (QGridLayout*) layout(); + gridLayout->addWidget(infoLabel, 2, 0, 2, 1); gridLayout->addWidget(&_cancelButton, 2, 1, 2, 1); gridLayout->addWidget(&_importButton, 2, 2, 2, 1); @@ -187,6 +198,9 @@ void ImportDialog::setLayout() { widget = findChild("fileTypeLabel"); widget->hide(); + widget = findChild("fileNameLabel"); + widget->hide(); + widget = findChild("buttonBox"); widget->hide(); @@ -254,8 +268,12 @@ void ImportDialog::setImportTypes() { // set custom file icons setIconProvider(new HiFiIconProvider(iconsMap)); setNameFilter(importFormatsFilterList); - + +#ifdef Q_OS_MAC + QString cmdString = ("Command"); +#else + QString cmdString = ("Control"); +#endif setLabelText(QFileDialog::LookIn, QString(IMPORT_INFO).arg(importFormatsInfo)); - setLabelText(QFileDialog::FileName, INFO_LABEL_TEXT); } }